Maximo Open Forum

 View Only

Skipping receipts at COMP status for inspection flagged items/materials

  • 1.  Skipping receipts at COMP status for inspection flagged items/materials

    Posted 06-21-2023 11:52

    Hello All,

    We have a requirement to skip receipts at COMP status for inspection flagged items/materials as the actual receipt is done by the warehouse team at WINSP status and the change inspection status is being done subsequent month and by that time the previous period is closed by the Finance team resulting in the receipts not being able to make it to Oracle.

    What all are the best solutions to alleviate this issue? Assuming that nothing could be done to solve this issue, we tried to write a skip rule to skip the receipts at COMP status for inspection related goods but that is also not working, what could be wrong with the configuration done.

    The object structure is MXRECEIPT and 2 rules were written to the publish channel as below

    1. XML rule to skip the status of COMP.
    2. Object rule- Relationship - > POLINE - >inspectionrequiredflag- >1

    Below is the snippet of the user exit class

    public class TEUOraReceiptOutUserExit
      extends TEUOraCommonInOutUserExit
    {
      private ControlsCache controls = getMaxIfaceControl();
      
      public TEUOraReceiptOutUserExit()
        throws MXException, RemoteException
      {}
      
      public StructureData setUserValueOut(StructureData irData)
        throws MXException, RemoteException
      {
        TEUUtilities.mifLogInfo("Entering: MXOraReceiptOutUserExit - setUserValueOut(ir)");
        
        TEUUtilities.mifLogInfo("Lets call super....");
        irData = super.setUserValueOut(irData);
        
        TEUUtilities.mifLogInfo("Leaving: MXOraReceiptOutUserExit - setUserValueOut(ir)");
        return irData;
      }
      
      public StructureData setUserValueOut(StructureData irData, StructureData erData)
        throws MXException, RemoteException
      {
        TEUUtilities.mifLogInfo("Entering: MXOraReceiptOutUserExit - setUserValueOut(ir, er)");
        
        TEUUtilities.mifLogInfo("Lets call super...");
        erData = super.setUserValueOut(irData, erData);
        TEUUtilities.mifLogInfo("after super...");
        
        irData.breakData();
        irData.setCurrentPosition(0);
        
        erData.breakData();
        erData.setCurrentPosition(0);
        
        String poNum = erData.getCurrentData("PONUM");
        String siteId = erData.getCurrentData("SITEID");
        String orgId = erData.getCurrentData("ORGID");
        String status = erData.getCurrentData("STATUS");
        TEUUtilities.mifLogInfo("Current PONUM: " + poNum);
        TEUUtilities.mifLogInfo("Current SITEID: " + siteId);
        TEUUtilities.mifLogInfo("Current ORGID: " + orgId);
        TEUUtilities.mifLogInfo("Current STATUS: " + status);
        
        String poLineNum = erData.getCurrentData("POLINENUM");
        TEUUtilities.mifLogInfo("Processing Receipt Line with POLINENUM: " + poLineNum);
        
        TEUUtilities.mifLogInfo("Check if this Receipt is created for Oracle PO, check value of OA_OWNERSYSID...");
        if (irData.isCurrentDataNull("PONUM"))
        {
          TEUUtilities.mifLogInfo("PONUM is null, this Receipt is not for Oracle PO");
          TEUUtilities.mifLogInfo("Do not send this Receipt to Oracle, Skip transaction.");
          throw new MXApplicationException("iface", "SKIP_TRANSACTION");
        }
        String ownerSysId = irData.getCurrentData("OA_OWNERSYSID");
        TEUUtilities.mifLogInfo("OA_OWNERSYSID value is: " + ownerSysId);
        TEUUtilities.mifLogInfo("OA_OWNERSYSID is not null, check if Receipt is created for Oracle PO...");
        if (ownerSysId.equalsIgnoreCase("OA"))
        {
          TEUUtilities.mifLogInfo("OA_OWNERSYSID is OA, this Receipt is created for Oracle PO, proceed...");
        }
        else
        {
          TEUUtilities.mifLogInfo("OA_OWNERSYSID value is not OA, this Receipt is not for Oracle PO");
          TEUUtilities.mifLogInfo("Do not send this Receipt to Oracle, Skip transaction.");
          throw new MXApplicationException("iface", "SKIP_TRANSACTION");
        }
        String oaEnterBy = irData.getCurrentData("ENTERBY");
        oaEnterBy = this.controls.getXREFControlValue("OA12", "TEUEMPNUMXREF", null, null, oaEnterBy, true);
        erData.setCurrentData("ENTERBY", oaEnterBy);
        TEUUtilities.mifLogInfo("Receipt Line ENTERBY field set to value: " + erData.getCurrentData("ENTERBY"));
        
        String oaShipTo = irData.getCurrentData("OA_SHIPTO");
        oaShipTo = this.controls.getXREFControlValue("OA12", "TEUSTBTXREF", null, null, oaShipTo, true);
        erData.setCurrentData("OA_SHIPTO", oaShipTo);
        TEUUtilities.mifLogInfo("Receipt Line OA_SHIPTO field set to value: " + erData.getCurrentData("OA_SHIPTO"));
        
        String recLdDesc = erData.getCurrentData("DESCRIPTION_LONGDESCRIPTION");
        if ((recLdDesc != null) && (recLdDesc != ""))
        {
          recLdDesc = TEUUtilities.convertRichText(recLdDesc);
          erData.setCurrentData("DESCRIPTION_LONGDESCRIPTION", recLdDesc);
        }
        TEUUtilities.mifLogInfo("Leaving: MXOraReceiptOutUserExit - setUserValueOut(ir, er)");
        return erData;
      }
    }


    #Administration
    #Customizations
    #EverythingMaximo
    #HSE/OilandGas
    #Integrations

    ------------------------------
    Mahadevan Ramakrishnan
    ------------------------------