Defining the Interface Structure of the BAPI

Purpose

In this step you are going to define the scope and interface structure of the BAPI, that is, the individual import, export and table parameters required for calling the BAPI. You will specify the names of these parameters in the section Naming Parameters in the Function Module.

You cannot use change and exception parameters in a function module which implements a BAPI.

Process Flow

Try to structure the BAPI as clearly as possible. Match the import parameters with each other to avoid having redundant data in the interface.

To identify the interface parameters for your BAPI, proceed as follows:

  1. Check that the key fields of the SAP business object type in question are required and specify how they are going to be used in the BAPI interface. The key fields of the SAP business object type are some of the most important BAPI parameters.
    • If a key value is to be passed to the BAPI by the calling program, the key field must be set as an import parameter in the function module of the BAPI. That way a specific instance of the business object type is identified.

For example, this could be a customer number (CustomerNo) in the BAPIs Customer.GetDetail() and Customer.CheckPassword(), or the number of a sales document in the BAPI SalesOrder.GetStatus().

    • For BAPIs that generate instances, for example, the BAPIs Create() or CreateFromData(), each key field of the business object type should be set as an export parameter in the BAPI function module.

These BAPIs return one key value, for example, an order number in the BAPI SalesOrder.CreateFromData().

    • For BAPIs that are class methods no key field is set as the BAPI function module’s own parameter.

Class methods are instance-independent and are called without the use of key values. Usually they return a table with a selection of key values. Exceptions are write BAPIs, as described in the list item above.

  1. Specify what other data is relevant in import, export or table parameters for the BAPI. Check that the parameters can be implemented as standardized parameters.

You have to create an export parameter, Return, to send messages back to the calling program. For details, see Return Parameters (Error Handling).