Sunday, 02 May 2021 08:13

Complete Guide on trigger an outbound IDoc when Good receipt posted in S4

Written by Jaith Ambepitiya
Rate this item
(0 votes)
“© 2020. SAP SE or an SAP affiliate company. All rights reserved.” “Used with permission of SAP SE”

Background :

There are certain ways that we could use in S4 to trigger an outbound IDocs. For example, using change pointers, Output type determination. The ideal fit needs to be chosen based on the requirement. Moreover, when master data creation or delta changes have to be informed to another system change pointers are the best fit where for transactional data, output determination is widely used.

Nevertheless, what if, there is no standard process code found (WE41 / TMSG1 table) for IDoc basic type/message which is required by business requirment.

In this scenario, we need to send the material document information which was posted (VL32N, MIGO or Inbound IDocs ) in S4 while good receving to external system. For that Basic type MBGMCR04 and MBGMCR were used and output determination couldn’t help this.

Solution :

A BADI which is triggered for VL32N, MIGO and IDocs had to be chosen. The reason to find out such a BADI is recommended over using completely a custom ABAP program since otherwise custom abap logics should be written to populate IDoc structures and this would make life harder when it comes to UAT and post go live support.

MB_DOCUMENT_BADI should be implemnted and method MB_DOCUMENT_UPDATE shoud be used. Function module MASTER_IDOC_DISTRIBUTE was leveraged to create the outbound IDoc.

up until this point everything sounds good in terms of sending IDoc to externl party. But for the S4 business user, there is no any link to the IDoc triggered for the interface via material document. So it is crucial to maintain the relationship for a better user experince. This blog post will discuss in detail how to update the IDoc number triggered to see in the relationship browser of material document as well.

Technical configurations steps :

All the details which is required to populate IDoc structures could be found in importing parameters, such as XMKPF and XMSEG tables.

Note: In case a data couldn’t be found in those structures and a custom logic should be written, it is recommend to maintain those under structure mapping in AIF (application interface framework) if available. if AIF is available in your landscape make sure to fill EDIDC data align with AIF partner profile and IDoc will be pushed to AIF port.

once IDoc structures are filled FM : MASTER_IDOC_DISTRIBUTE should be called.

 CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' EXPORTING master_idoc_control = ls_edidc * OBJ_TYPE = '' * CHNUM = 
Continue reading here
Read 32 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.