The customer enhancement concept makes it possible for customers to process tables they have defined themselves in a BAPI.
To enable the customers to implement this type of enhancement, at least the following precautions must be implemented in the BAPI:
The extension parameters at the BAPI interface and the BAdIs are mandatory. In contrast, the order in which the data from the new customer tables is passed to or taken from the extension containers is entirely up to the customer.
As a result, the use of BAPI table extensions is not absolutely necessary for the types of enhancement described above. We do recommend, however, defining help structures for the new tables, as they allow the extension containers to be filled and evaluated with more certainty.
In the example below, BAPI TravelAgency.CreateFromData is used to illustrate which components are involved in this type of enhancement. In this example, the customer has created her own table, YSTRAVELAG, in addition to the underlying SAP tables for the BAPI, and uses this table to store additional data for object TravelAgency.
The Defined Customer Table
The customer table YSTRAVELAG has the following structure:
The Corresponding Help Structure
To simplify the filling and analysis of the extension parameters, each customer table should have a data structure containing the fields from the corresponding customer table that will be taken into account in the BAPI. In the process, make sure to observe the following:
The following diagram shows how help structure YBAPI_YSTRAVELAG should appear for this example:
Creating the help structure is optional, and only makes it easier to fill and evaluate the extension container. As an alternative, you can use other help structures or none at all.
Extension Parameters and BAPIs
As mentioned above, the two extension parameters (ExtensionIn and ExtensionOut) in the BAPI interface are used to pass on the enhancements to the BAPI function module or forward them from the function module to the calling program 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 extension containers.
If the help structure is used in the form described above, then the data structure in these containers is the same as the structure described underAppending Customer Fields (apart from one exception). The only difference is that field STRUCTURE of structure BAPIPAREX passes on the name of the corresponding help structure instead of the name of the BAPI table extension.
Continuing the above example, the extension container could look like this if help structure YBAPI_YSTRAVELAG was used:
The values "BOEING747", "LUFTHANSA", and "456 SEATS" in the first data record would be written to the fields of customer table YSTRAVELAG specified in YBAPI_YSTRAVELAG. The table line in which the values will be inserted is identified by key "4711".
The check and further processing of the data from the import container and the filling of the export container take place subsequently in BAdIs supplied by the BAPI developer.