In one of our SNC Implementations, we came across a requirement in which we have to apply a custom Business Logic for calculating Stock On Hand in SMI Scenario of Supplier Collaboration.
In SMI (Supplier Managed Inventory) Scenario, customer transfers his Demand and Stock Information to SAP SNC from his SAP ERP system to share the Customer’s Inventory information to Supplier. The Supplier will get to see that information in a Grid format maintained in pre-defined time buckets format and current stock information also.
In our implementation the transfer of Demand and Stock information done a regular background job which runs Program RSMIPROACT and an IDOC of type PROACT.PROACT01 will be generated. This IDOC will be transferred to SAP PI and will get transformed to the XML Message “ProductActivityNotification_In” and will get posted in SAP SNC.
Here in this case the custom requirement is to modify the Stock information in the XML Message “ProductActivityNotification_In” before posting the information into SAP SNC based on customer’s own safety stock logic. The Customer in this case is having a specific requirement where instead of showing the exact Stock On Hand transferred from SAP ERP to the Supplier, Customer wants to deduct safety stock from actual stock and the result stock will be displayed as Stock On Hand.
To implement this Logic, we need to calculate Safety Stock based on actual Stock On Hand we got from SAP ERP and then we have to deduct that Safety Stock amount from the actual stock before posting the information in SAP SNC.
To implement this logic, we used standard Business Add-In (BADI)/Enhancement Spot provided by SAP and implemented the Enhancement Spot for defining the Safety Stock Logic.
The Enhancement Spot contains a method called “CALCULATE_STOCKONHAND” in which we need to implement the Safety Stock Logic.
Sample Implementation Logic:
Import Parameters :
IV_PROCESS – Supplier Colloboration process Code (eg: SMI for SMI Monitor Etc)
Change Parameter :
CT_INVENTORY – Stock data in Application format.
Need to write the code to change the Changing parameter CT_INVENTORY based on the data in Importing parameters.
The Logic should be like this.
IF IV_PROCESS Equals to ‘SMI’ (in case of SMI Scenarios)
Recalculate the value Quantity field of Table Type CT_INVENTORY where CAT eq ‘ ‘.
(CAT is stock category, for unrestricted stock the CAT value is ” “)
Eg: Quantity = quantity – quantiy*33/100.
Based on above Logic, the Stock On hand will be reduced by 33% before saving the Demand and Stock information in SAP SNC.