Skip to Content
  • The following discussion provides the steps for creating a custom field on table EKKO and populating the field using IDoc Message PURCONTRACT_CREATE.  The IDoc interface calls a BAPI (BAPI_CONTRACT_CREATE) to create the purchasing document.

This procedure includes steps for creating the custom field and populating it using the IDoc interface.  Assumption is that you are already familiar with creating IDocs.  The technique outlined below requires no custom programming using BAPI methods to populate the field; populating segment E1BPPAREX is sufficient. The instructions are based on an ECC 605 Support Pack 6 instance.

Extend structure BAPI_TE_MEOUTHEADER

  • Execute transaction SE11, input Data type = BAPI_TE_MEOUTHEADER, click Display
  • Double-click on CI_EKKODB, and confirm that you want to create the structure
  • Provide a Short Description, such as “Include table CI_EKKODB – Header”
  • Add fields as necessary.  There are restrictions on the allowed data types that are supported by function module BAPI_CONTRACT_CREATE.  For example, CHAR is allowed but packed fields are supported only with further development by BADI.  Consult the documentation for this BAPI as well as OSS notes on the function module
  • Save and activate the structure

When you view BAPI_TE_MEOUTHEADER, result will be a structure where first 10 positions are reserved for Component = NUMBER, followed by the set of fields you defined

BAPI_TE_MEOUTHEADER.JPG

Extend structure BAPI_TE_MEOUTHEADERX

  • Execute transaction SE11, input Data type = BAPI_TE_MEOUTHEADERX, click Display
  • Double-click on CI_EKKODBX, and confirm that you want to create the structure
  • Provide a Short Description, such as “Include table CI_EKKODBX – Header Change Parameter”
  • Click Predefined Type button
  • Add fields with the identical names, and in the identical sequence, as you did for BAPI_TE_MEOUTHEADER. For each field, choose Typing Method 1, Data Type CHAR, length 1
  • Save and activate the structure

When you view BAPI_TE_MEOUTHEADERX, result will be a structure where first 10 positions are reserved for Component = NUMBER, followed by the set of fields you defined

BAPI_TE_MEOUTHEADERX.JPG

Set up Partner

  • Execute transaction WE20
  • Create a partner per the particular requirements of your environment, and specifically with Message type = PURCONTRACT_CREATE and Process code = BAPI

WE20.JPG

Create Idoc

  • Create an IDoc using an external application, or using transaction WE19
  • Populate the control record per your system’s requirements, in particularsetting Message type = PURCONTRACT_CREATE
  • Populate the other data records per your requirement sufficient to satisfy mandatory fields and optional fields used in your environment
  • Populate two consecutive instances of segment E1BPPAREX
  • First instance, set STRUCTURE = “BAPI_TE_MEOUTHEADER” (without the quotes). Set VALUEPART1 = concatenated set of data values.  For example, suppose you created three custom character fields of varying lengths: ZFIELD1 (10), ZFIELD2 (25), ZFIELD3 (1).  You would set the value of VALUEPART1 as ten characters of blank spaces, followed by 10 characters of data, followed by 25 characters, followed by 1 character.  You have to set the first 10 characters as blanks to accommodate the NUMBER field in the BAPI_TE_MEOUTHEADER structure
  • Second instance, set STRUCTURE = “BAPI_TE_MEOUTHEADERX” (without the quotes).  For VALUEPART1, first ten characters are blank spaces, followed by as many character “X” values as you have custom fields.  If you have three custom fields, then VALUEPART1 will have ten spaces followed by “XXX” (without the quotes, of course)

E1BBBAREX1.JPG

E1BBBAREX2.JPG

Execute the interface

Post the IDoc.  Result should be a contract where table EKKO has data values in the custom fields you created in CI_EKKODB

EKKO.jpg

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply