Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Business Transaction Events for Filtering Outbound Master IDOCs

 

Summary

This post narrates the use of P/S (Publish & Subscribe) Business Transaction Events for Filtering of Outbound IDOCs of Master Data.

Author(s):  Vinod Kumar T

   
Company:     NIIT Technologies Limited
Created on:    16.10.2010
Author(s) Bio
Vinod Kumar is an ABAP Consultant working with NIIT Technologies Limited.

Scenario

Standard SAP program RBDMIDOC is used to trigger the Outbound IDOCs based on Change pointer concept.  ALE Distribution Model (BD64) and partner configuration (WE20) is used to determine the receiving partners.  IDOCs are transmitted to all the partners defined in above configuration. 

Process Flow

Standard program RBDMIDOC refers the table TBDME to get the function module which is to be executed for creating IDOCs.  For example, the message type COND_A (Pricing conditions) , Standard function module MASTERIDOC_CREATE_SMD_COND_A is executed to generate the IDOCs.  The function module extracts all the records which are not yet processed using the function module CHANGE_POINTERS_READ.  These records will be converted as per segments in the Basic IDOC type / message type and will be transmitted to all the Partners which are maintained in WE20 (Partner Profile Configuration) and BD64 (Distribution Model). 

Change Requirement

  1. IDOCs to be generated for specific Partners based on Business requirements.  In this scenario, IDOCs need to filters so that the unwanted Partner doesn't receive the IDOC.
  2. IDOCs to be generated based on some dynamic criteria based on the Data records of the IDOC.  For example, IDOCs need to be generated only if the pricing condition value is greater than 100 and Condition type is 'XXXX'.

Use of P&S (Publish & Subscribe) BTE. 

Publish & Subscribe Business Transaction Event (P/S BTE) can be used to filter the generation of IDOCs.  Customized function module with complex filtering conditions can be assigned to this BTE which will be triggered during the Outbound Processing of IDOC.
 

List of P/S Business Transaction Events attached to Outbound IDOC Processing

 

 

01.    CC000110 - ECMMAS : Outbound Processing for ALE Distrib. Unit

Message Type

ECMMAS - Engineering Change Management

Processing Function Module

MASTER_IDOC_CREATE_SMD_ECMMAS

BTE Function Module

SAMPLE_INTERFACE_CC000110

 
02.    CHR00100 - CHRMAS: Outbound Processing for ALE Distribution

Message Type

CHRMAS - Class system: Characteristics master

Processing Function Module

MASTERIDOC_CREATE_SMD_CHRMAS

BTE Function Module

SAMPLE_INTERFACE_CHR00100

 
03.    CLF00100 - CLFMAS : Outbound Processing for ALE Distribution

Message Type

CLFMAS - Class system: Classification master

Processing Function Module

MASTERIDOC_CREATE_SMD_CLFMAS

BTE Function Module

SAMPLE_INTERFACE_CLF00100

  
04.    CLS00100 - CLSMAS : Outbound Orocessing for ALE Distribn unit

Message Type

CLSMAS - Class system: Classes master

Processing Function Module

MASTERIDOC_CREATE_SMD_CLSMAS

BTE Function Module

SAMPLE_INTERFACE_CLS00100

  
05.   CS000105 - BOMMAT: Outbound Processing for ALE Distribn unit

Message Type

BOMMAT - BOMs: Material BOM

Processing Function Module

MDM_IDOC_CREATE_SMD_BOMMAT

BTE Function Module

SAMPLE_INTERFACE_CS000105

  

06    CV000100 - DOCMAS : Outbound Processing for ALE Distribn unit

Message Type

DOCMAS - Master document

Processing Function Module

MASTERIDOC_CREATE_SMD_DOCMAS

BTE Function Module

SAMPLE_INTERFACE_CV000100

  

07.   DEP00100 - DEPNET : Outbound Processing for ALE Distribn Unit

Message Type

DEPNET - Dependency net

Processing Function Module

MASTERIDOC_CREATE_SMD_DEPNET

BTE Function Module

SAMPLE_INTERFACE_DEP00100

  

08.    DOL00100 - DOLMAS : Outbound processing for ALE Distribn Unit

Message Type

DOLMAS - Document-object links

Processing Function Module

MASTERIDOC_CREATE_SMD_DOLMAS

BTE Function Module

SAMPLE_INTERFACE_DOL00100

  

09.    KNO00100 - KNOMAS : Outbound Processing for ALE Distribn Unit

Message Type

KNOMAS - Global object dependencies

Processing Function Module

MASTERIDOC_CREATE_SMD_KNOMAS

BTE Function Module

SAMPLE_INTERFACE_KNO00100

  

10.    MGV00100 - MATMAS : Outbound processing for ALE Distribn Unit

Message Type

MATMAS - Material master

Processing Function Module

MASTERIDOC_CREATE_SMD_MATMAS

BTE Function Module

SAMPLE_INTERFACE_MGV00100

  

11.    VFU00100 - VFNMAS : Outbound Processing for ALE Distribn Unit

Message Type

VFNMAS - Variant function

Processing Function Module

MASTERIDOC_CREATE_SMD_VFNMAS

BTE Function Module

SAMPLE_INTERFACE_VFU00100

  

12.    VKOA0100 - COND_A: Outbound Processing for ALE Distribn Unit

Message Type

COND_A - Conditions: master data for price determination

Processing Function Module

MASTERIDOC_CREATE_SMD_COND_A

BTE Function Module

SAMPLE_INTERFACE_VKOA0100

  

13.    VTA00100 - VTAMAS : Outbound Processing for ALE Distribution

Message Type

VTAMAS - Structure of variant table

Processing Function Module

MASTERIDOC_CREATE_SMD_VTAMAS

BTE Function Module

SAMPLE_INTERFACE_VTA00100

  

14.    VTM00100 - VTMMAS  : Outbound Processing for ALE Distribution

Message Type

VTMMAS - Contents of variant table

Processing Function Module

MASTERIDOC_CREATE_SMD_VTMMAS

BTE Function Module

SAMPLE_INTERFACE_VTM00100

 Configurations Required to Activate BTE

    1. Create a Function group using Transaction code SE80.
    2. Copy the standard BTE Function module (for Eg. SAMPLE_INTERFACE_VKOA0100 for Pricing conditions) to Z-Funtion module (Eg. ZSAMPLE_INTERFACE_VKOA0100) in the above function group using Transaction code SE37 and activate it.
    3. Create Customer Product (Transaction code FIBF -> Settings -> Products -> ... of a customer)
    4. Add the appropriate P&S BTE and assign the Z-Function module created in Step-b using menu option(Transaction code FIBF -> Settings -> P/S Modules -> ... of a customer)
    5. See this WiKi post which explains the steps to configure P&S BTE for Pricing conditions P&S BTE settings for Pricing Conditions Outbound IDOC Filtering

Sample code Written in Z-FM : ZSAMPLE_INTERFACE_VKOA0100 (For Pricing Conditions IDOC)  

Error rendering macro 'code': Invalid value specified for parameter 'lang'
FUNCTION zsample_interface_vkoa0100.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      IDOC_DATA STRUCTURE  EDIDD
*"  CHANGING
*"     REFERENCE(IDOC_HEADER) TYPE  EDIDC
*"  EXCEPTIONS
*"      ERROR
*"----------------------------------------------------------------------
* Event rissen by the ALE outbound process for COND_A.

* It allows to modify the idoc's control header the idoc data aswell
* as serialization information created by the standard SAP outbound
* process.

* Raising the EXCEPTION ERROR will prevent the IDOC from being
* submitted to the ALE layer.

* BE CAREFUL WITH ANY CHANGES TO IDOC_CONTROL. IT MAY EFFECT YOUR WHOLE
* ALE-SCENARIO

* Filtering of IDOCs based on Receiving Partner can be done using the 
* validation in structure IDOC_HEADER.


  DATA : lv_flag   TYPE char01,
         lv_kbetr  TYPE kbetr.
  CLEAR : lv_flag, lv_kbetr.
  LOOP AT idoc_data.
    IF idoc_data-segnam EQ 'E1KONP'.
      MOVE idoc_data-sdata+64(16) TO lv_kbetr.
      IF lv_kbetr LT 100.
        MOVE 'X' TO lv_flag.
        EXIT.
      ENDIF.
    ENDIF.
  ENDLOOP.
  IF lv_flag EQ 'X'.
    REFRESH : idoc_data.
    RAISE error.
  ENDIF.

ENDFUNCTION.

 

Related Content

Please include at least three references to SDN documents or web pages.
Business Transaction Event - VKOA0100 - For Outbound Pricing IDOC Filtering 

Useful Information

Business Transaction events for IDOC Filtering