To use a BAPI in an application program, application developers need to know:
· Which BAPI provides the required data, that is, they need to know what the BAPI can do.
· How the BAPI is called, that is what are the parameters and fields of the BAPI interface.
Application developers access the technical meta data and documentation of BAPIs from the Business Object Repository.
This section contains general guidelines for documenting BAPIs. For internal use, SAP provides detailed guidelines on writing BAPI documentation. You can get a copy of the guidelines from your contact person in the BAPI Development group.
BAPIs are business interfaces to the SAP System and users are not required to have a thorough knowledge of the SAP System and the ABAP development environment.
Readers of BAPI documentation are often not ABAP experts or business application experts.
To give application developers a complete picture of the functionality of a BAPI, the following documentation must be provided:
Create this documentation in the Function Builder in the function module that the BAPI is based on. The purpose of this documentation is to explain what the method does and how the communication with external programs works. The documentation should help customers decide whether a method is appropriate to perform the task in question and it should therefore provide answers to the following questions:
· What is the business function of the BAPI and what can it be used for?
· What exactly are the functions of the BAPI?
· Are there any important limitations, that is, functions that this BAPI cannot perform?
· What must you pay particular attention to with this BAPI? For example, is special authorization required to use this BAPI?
· Are there any Customizing dependencies?
· What dependencies are there between this BAPI and other BAPIs, and between individual method parameters?
If the BAPI uses a COMMIT WORK command or works with buffering, you must include this in the documentation.
Documentation on the individual parameters is also written in the Function Builder in the associated function module. Parameter documentation should provide answers to the following questions:
· What is the parameter used for?
· Which fields must be filled, that is, what are the mandatory fields?
· What are the dependencies between fields?
· Are there any fixed values and what do they do?
· What are the default values of the parameter? All the fields that are assigned default values by Customizing and are therefore write-protected, must be documented.
· Which return codes may be returned to the calling program directly or indirectly in the Return parameter?
A calling program can call data element documentation (F1 help) for a field in a BAPI parameter using the Service BAPI BapiService.FieldHelpGetDocu (see Providing Input Help).
For this reason you have to write data element documentation for each field in BAPI parameters.
To provide the complete context of a BAPI, the information below must also be available:
· Documentation on the business object type the BAPI is implemented for.
· Documentation on the key fields of the business object type.