Defining Methods in the BOR Using the BOR/BAPI Wizard 

Prerequisites

If the function module which your BAPI is based on has been fully implemented or modified you can define it as a method of an SAP business object type or SAP interface type in the Business Object Repository (BOR). You use the BOR/BAPI Wizard to do this.

Procedure

First find the relevant SAP business object type in the BOR:

  1. Choose Tools ® Business Framework ® BAPI Development ® Business Object Builder.

On the initial Business Object Builder screen you can directly access the SAP business object type or interface type if you know the technical name of the object (object type). You have already identified the technical name of the object.

Otherwise choose Business Object Repository.

The application hierarchy is displayed. Search for the required business object type or interface type in the application hierarchy and double click it to open it.

  1. When the business object type or interface type is displayed, choose Change.

Creating BAPIs as Methods of Business Object Types or Interface Types

To define your BAPI as a method of a business object type or interface type:

  1. Select Utilities ® API Methods ® Add method.
  2. In the next dialog box enter the name of the function module, for example, BAPI_COMPANYCODE_GETDETAIL, and choose Continue.
  3. In the next dialog box specify the following information for the method to be defined:

A default name for the method is provided, based on the name of the function module. You may have to modify the suggested name:

Example: If the name of the function module is SALESORDER_GETSTATUS, the suggested method name might be BapiSalesorderGetstatus. You should edit this so that the resulting name is GetStatus.

Enter meaningful descriptions for your BAPI.

Enter relevant details for your BAPI. Make sure that a BAPI is not dialog orientated. BAPIs are usually implemented synchronously.

  1. Choose Next Step.

A list of parameters and default names is displayed which you need to edit as required. Modify the parameter names as follows:

  1. Choose Next Step.

To create the method choose Yes in the next dialog box.

Result

After the program has been generated and executed, check that all the definitions have been made correctly by the BOR/BAPI Wizard. To do this, look at the newly created method of the business object type or interface type.

The BOR/BAPI Wizard is used only to create new BAPIs for the first time. It is not used to make changes to existing BAPIs.

If you make changes to the underlying function module after you have created the BAPI in the BOR, for example, if you make compatible interface enhancements or modify short texts, such changes do not automatically take effect in the BOR. You have to make these changes manually in the BOR. For information about creating and modifying business object types, see the documentation on the Business Object Builder.