The Main objective of this paper is to
- Brief about PROACT IDoc.
- 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.
CALL FUNCTION ‘SMI_MASTERIDOC_CREATE_PROACT’
pi_supplier = l_supplier ” Vendor
pi_logsys = fp_g_logsys ” Logical system
pi_plant = fp_g_werk ” Plant
pi_mat_source = li_mat_source ” Product Source table
pi_articles = li_product_cap ” Capped Materials List table
pi_labst_items = li_labst ” Unrestricted-use stock (Total Area) table
pi_klabst_items = li_klabst ” Unrestricted-use stock (consignment)table
pi_slabst_items = li_slabst ” Unrestricted-use stock (equity) table
pi_insme_items = li_insme ” Quality inspection (Total Area)table
pi_kinsme_items = li_kinsme ” Inspection stock (consignment)table
pi_sinsme_items = li_sinsme ” Inspection stock (equity) table
pi_speme_items = li_speme ” Blocked Stock (Total Area) table
pi_kspeme_items = li_kspeme ” Blocked Stock (consignment) table
pi_sspeme_items = li_sspeme ” Blocked Stock (equity) table
pi_umlme_items = li_umlme ” Stock in Transfer table
pi_demand_items = li_demand ” Demand data (SMI) table
pi_docnum = l_idoc_temfp_id ” Doc Number
pi_koneig_flag = c_true ” Flag
pi_labst_flag = c_true ” Flag
pi_insme_flag = c_true ” Flag
pi_speme_flag = c_true ” Flag
pi_umlme_flag = l_stockintransfer ” Flag
iv_dependent_ind = l_ms ” Flag (SPACE)
pe_idoc_header_item = lw_idoc_header_item “IDoc Header Data
pe_idoc_data_items = li_idoc_data_items. “IDoc item Data