
Implementing Your Own BAPIs
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 options:
When you create the subobject type the methods of the business object inherit the subtype.
For further information about creating new BAPIs and enhancing existing ones refer to Modifications and Customer Enhancements in the BAPI Programming guide.
Notes about Asynchronous BAPIs
If you want to implement an asynchronous ALE business process, you have to
Define 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:
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:
Status 51 (error, application document not posted) is written for all status records, after a ROLLBACK WORK has been executed.
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.