Enhancing the BAPI with Import Data that Does Not Affect the Database Level


In another feasible enhancement scenario, the customers wants to pass on additional data to the BAPI that is only required at runtime. The difference to the enhancement types described above is that these values are not assigned to any fields in database tables. As a result, the data has a different structure in the extension container, since no key values have to be passed on to determine the corresponding line in the database table.

Examples of this type of enhancement include:

  • Adding additional selection criteria to a GetList() BAPI that limit the number of data records in the returned list
  • Adding additional filter criteria to a GetDetail() BAPI that determine which detailed information is displayed
  • Expanding the checkbox bar in a Change() BAPI that has been implemented according to the "Change after selection" concept

Implementation Considerations

The BAPI must contain the following items to support this type of enhancement:

  1. Extension parameters in the BAPI interface
    To pass on the additional data to the BAPI, the interface of the BAPI function module must have the ExtensionIn parameter.
  1. Business Add-Ins (BAdIs)
    For this case, as well, each BAPI function module must contain a maximum of two extra BAdIs in addition to the exits provided by the application. The customer can check the data that has been transferred or perform other processing activities in these BAdIs.

While the BAPI interface must contain the ExtensionIn parameter and the BAdI, the order in which the transferred data is arranged in the extension container is entirely up to the customer.
We recommend that you create help structures, however, whose fields represent the additional values. These data structures make evaluating the ExtensionIn parameter much easier and more reliable.


A GetList() BAPI is used below to illustrate the steps required to add an additional selection criteria to a BAPI. Because BAPI selection parameters always consist of the four fields SIGN, OPTION, HIGH, and LOW, these four additional values must be passed on to the BAPI within the ExtensionIn container.

The Corresponding Help Structure

To simplify the filling and evaluation of the ExtensionIn parameter, you should create data structures that contain related fields that are to be passed on to the BAPI.

In the example, you would create a data structure that contains the four fields SIGN, OPTION, HIGH, and LOW for the additional selection criteria.


Creating the help structure is optional, and only makes it easier to fill and evaluate the ExtensionIn container. As an alternative, you can use other help structures or none at all.

The ExtensionIn Parameter and BAPIs

As mentioned above, the ExtensionIn parameter in the BAPI interface is used to pass on the enhancements to the BAPI function module in container format.

In contrast to an enhancement using BAPI table extensions, there are no guidelines in this case for arranging the data in the ExtensionIn container.

If a help structure like the one described above were used, the data would have the following structure in the container:

Field STRUCTURE of structure BAPIPAREX contains the name of the help structure that contains the fields required for selection. In this case, field SIGN would be set to value "I", OPTION would be set to "CP", HIGH" would be set to "00000010", and LOW would be set to "00000001".

The system also checks and processes the data from the import container in the BAdIs that are supplied by the BAPI developer.