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 Event - VKOA0100 - For Outbound Pricing IDOC Filtering

 

Summary

This post narrates the use of Business Transaction Event for filtering of Pricing Conditions Outbound IDOCs.

Author(s):  Vinod Kumar T

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

Scenario

Pricing conditions are transmitted to different ALE Partners through the Program RBDMIDOC.  Standard Message type COND_A is used to create the IDOCs. 

How IDOCs are Created?

Standard program RBDMIDOC refers the table TBDME to get the function module which is to be executed for creating IDOCs.  For message type COND_A, Standard function module MASTERIDOC_CREATE_SMD_COND_A is executed to generate the IDOCs.  Since this function module works on the concept of CHANGE POINTERS all the pricing condition records which are not yet processed will be picked up 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).

Business Requirement

As per the new requirement, Conditions records satisfying certain requirements are only to be transmitted (eg. All the records with pricing condition value greater than 100 & Receiving Partner is XXXXX).  Data filtering using BD64 (Distribution Model) was not able to handle the such complex filtering of IDOCs.

BTE as a Solution

Business Transaction Event VKOA0100 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.

Configurations Required to Activate BTE

  • Create a Function group using Transaction code SE80.
  • Copy the standard function module SAMPLE_INTERFACE_VKOA0100 to ZSAMPLE_INTERFACE_VKOA0100 in the above function group using Transaction code SE37 and activate it.
  • Create Customer Product (Transaction code FIBF -> Settings -> Products -> ... of a customer
  • Create Customer P&S Module (Transaction code FIBF -> Settings -> P/S Modules -> ... of a Customer

Sample code Written in FM : ZSAMPLE_INTERFACE_VKOA0100

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.
1. SAP Note : 0391776
2. ALE Outbound IDOC Filtering http://help.sap.com/saphelp_nw70ehp1/helpdata/en/6f/1cde057a4b11d396b20004ac96334b/frameset.htmReference

Useful Information

Filtering of Pricing conditions Outbound IDOCs