Brief the procedure of extending/customizing PROACT IDoc to inform vendors about the stock situation and forecast and to trigger it from Custom code.
Introduction to PROACT IDoc
PROACT IDoc is used to transfer demand and stock data to SAP Supply Network Collaboration (SAP SNC) and SAP Inventory Collaboration Hub (SAP ICH) so that a supplier can see it and plan deliveries accordingly. The standard report to trigger IDoc are RSMIPROACT and RSMIPROACT02. Its reads/packs stock and demand data in ERP system to be send to the SAP SNC/ICH system.
The business scenarios PROACT IDoc can be used are:
● Supplier Managed Inventory (SMI)
● Release Processing (RP)
● Dynamic Replenishment (DR)
The IDoc generated are on the basis of vendors so if 50 materials with seven vendors as sources, it creates seven PROACT01 IDocs containing the demand and stock data for the number of materials of each vendor. The system takes account of which vendor is the source for which material when it creates the IDocs.
Now we are going to focus on extending/customizing the IDoc to send additional/Custom information.
Procedure to extend PROACT IDoc
The method we will use to extend the PROACT IDoc is implementing a Business Add-In (BADI) in the standard Function Module which is used to create the IDoc.
The process will be as follows:
Create the Custom Segment with the field you want to add in WE31 and release the segment by using “SET RELEASE”.
Create an Extended IDoc type and Link it to Standard Basic IDoc type “PROACT01” using WE30.
Add the custom segment to the Extended IDoc type and release the same by using “SET RELEASE”.
Create a second entry for message type “PROACT” in WE82 with basic IDoc type as “PROACT01” and Extended IDoc type name.
Implement the BADI “SMI_IDOC_PROACT_OUT”/method “CHANGE_BEFORE_SEND” to fill the custom segment.The BADI has been provided as an exit to Function Module “SMI_MASTERIDOC_CREATE_PROACT”.
Data for the custom segment can be fetched inside the BADI. The only passing parameter to BADI are the IDoc item and header data table ,so data in the standard segments can be used fetch custom data.
a) e1adrm1-partner_id contains Plant info when e1adrm1-partner_q = _WE.
b) e1adrm1-partner_id contains Vendor info when e1adrm1- partner_q = _LF.
c) e1edp19-idtnr contains MATNR.
But if you want to trigger the IDoc from a custom program the additional method which needs to be followed are as follows:
Copy the Perform “idoc_create_proact” from the standard program RSMIPROACT2 (Include SMIPRF01) .The perform sorts and sends the IDoc based on vendor. The perform has many checkbox variables which are not mandatory and can be passed based on the requirement.
The passing parameter for the perform are Vendor list, Material source data and Plant ,its collects data and breaks them down into several Internal tables (which are the passing parameter for the FM 'SMI_MASTERIDOC_CREATE_PROACT')
The maximum number of material number which can be send for a vendor is capped at 200.