Start of Content Area

Procedure documentation Implementing Your Own BAPIs  Locate the document in its SAP Library structure

SAP provides a large number of BAPIs. If you want to implement your own BAPIs, you have to use your own namespace.

Procedure

You have the following alternatives:

      You can develop your own BAPI in the customer namespace.

      You can modify a BAPI delivered in the standard system.

1.       Copy and modify the function module belonging to the original BAPI.

2.       In the Business Object Repository create a subobject type for your BAPI object type in the customer namespace (Tools Business Framework BAPI Development Business Object Builder).

When you create the subobject type the methods of the business object inherit the subtype.

3.       Set the status of the object type to Implemented (Edit Change release status Object type).

4.       You can change and delete the methods of the subtype or enhance them with your own methods.

 

Notes about Asynchronous BAPIs

If you want to implement an asynchronous ALE business process, you have to Maintain a BAPI/ALE Interface from the BAPI.

If you implement a BAPI as an asynchronous interface, in addition to following the standard programming BAPI guidelines, keep in mind the following:

·         The BAPI must not issue a COMMIT WORK command.

·         The BAPI return parameter must use the reference structure BAPIRET2.

·         All BAPI export parameters with the exception of the return parameter are ignored and are not included in the IDoc that is generated.

·         Status records log the BAPI return parameter values.

After the function module which converts the IDoc into the corresponding BAPI in the receiving system has been called, status records are written for the IDoc in which messages sent in the return parameter are logged.

If, in at least one of the entries of return parameter, the field Type in the return parameter is filled with A (abort) or E (error), this means:

·         Type A:

Status 51 (error, application document not posted) is written for all status records, after a ROLLBACK WORK has been executed.

·         Type E:

Status 51 (error, application document not posted) is written for all status records and a ROLLBACK WORK is executed.

Otherwise status 53 (application document posted) is written and a COMMIT WORK executed.

 

 

End of Content Area