Distributing Master Data (Outbound)


A function module needs to be defined for each message type. This function module generates and dispatches the IDOC for the master data. The naming convention for the function module is MASTERIDOC_CREATE_SMD_XXXXX where XXXXX is the name of the message type.

The function module executes the change pointers and generates IDOC in the following manner

Read all the changed pointers from change pointer table BDCP that has not been processed for the message type using function module CHANGE_POINTERS_READ.

  • For each record retrieved from table BDCP populate IDOC segments. For each segment the first field MSGFN is filled in the following manner

009 – For any new master data

004 – For any change in master data

003 – For any deletion in the master data

018 – If there was no change to the particular segment but the segment have to               be included because hierarchy subordinate segments have to be dispatched

·         Pass the IDOC to the ALE layer by calling the function module MASTER IDOC_DISTRIBUTE

·         For the master data that are processed set the change pointer status to ‘Processed’ in table BDCP by calling function module CHANGE_POINTER_STATUS_WRITE.

Ø       Adding message type to partner profile

Transaction BD64 

Add message type for the master data to the distribution model and from menu path ‘Environment’ generate partner profile.            

Ø             Create IDOC from change pointers 

Transaction BD21 - Program RBDMIDOC. 

SAP includes a scheduled program, RBDMIDOC that runs periodically to check the change pointers for a particular message type. RBDMIDOC references the correct IDOC program for any given type via TBDME, which is maintained through transaction BD60. 


In the production system, it is obvious that the users will not launch the BD21 transaction by themselves. A periodic job will be scheduled to execute the RBDMIDOC program, which is actually run by BD21 transaction, with a variant containing the right message type.

Population custom field for extended IDOC. 

For any modification or population of custom fields in extended IDOC through this program RBDMIDOC or RDBSEXXX a user exit is available in function module MASTERIDOC_CREATE_XXXXX where XXXXX is the message type. 

Function module MASTERIDOC_CREATE_XXXXX is called from the function module MASTERIDOC_CREATE_REQ_XXXXX for program RBDSEXXX or MASTERIDOC_CREATE_SMD_XXXXX for program RBDMIDOC as defined in transaction BD60. 

For e.g for message type MATMAS for material download

Function Module:                       MASTERIDOC_CREATE_MATMAS

USER EXIT:                   EXIT_SAPLMV01_002

ENHANCEMENT:                      MGV00001

Extended IDOC Field:     IDOC_CIMTYPE 

Set Change Document Flag on for custom fields

Transaction SE11

If change pointers are to be written for custom fields then the change document flag at the domain level should be activated for that field. Then maintain an entry for this field in transaction BD52. Changes to custom fields will be only picked if the change document for such fields is maintained in table BDCP. 

Reference Links: 

  1. http://help.sap.com/saphelp_45b/helpdata/en/78/2178da51ce11d189570000e829fbbd/content.htm

  2. http://help.sap.com/saphelp_nw04/helpdata/en/12/83e03c19758e71e10000000a114084/content.htm

  3.  https://www.sdn.sap.com/irj/sdn/thread?threadID=133101

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image