Defining the Interface
A BAPI parameter must be defined in the method of the business object type in the BOR as well as in the function module. In both cases the definition must be identical except for the key fields of the business object type.
The
Key Fields of a business object type are used to identify a business object type at a semantic and technical level. The whole key, rather than parts of it is always used (fully defined key). This has semantic reasons (an instance is identified by the key) as well as technical reasons (keys are generated in the BOR and various checks are made against existing key fields). If a BAPI refers to a specific instance of a business object type, together with other parameters, the key fields of the business object type are transferred to the method in the BOR to identify the instance. In this case the key fields are not listed again under the method parameters in the BOR. This distinction cannot be made in the function module, which is why the key fields must be listed here as parameters.
The following conventions apply to key fields for function module interfaces:
|
With instance methods all the BOR key fields are mandatory import parameters in the function module. BOR key fields must not be defined as export parameters in the function module. |
|
With class methods BOR key fields must not be defined as export parameters in the function module (exception: Create methods) Neither are BOR key fields allowed to be defined as import parameters in the function module. |
|
With create methods all the BOR key fields of the method are defined as export parameters in the function module. BOR key fields must not be defined as import parameters in the function module (this applies to all class methods). Create methods are classified as instance-independent in the BOR. |
If, in accordance with the above guidelines, key fields are defined as parameters in the function module, the conventions below apply:
|
The fully defined key is used and not a partial key. |
|
There is a parameter in the function module for each key field of the business object type. |
|
The parameter in the function module and the BOR key field have the same name. |

In the above explanation a key field means a parameter that is used to identify a runtime instance (in the OO sense) and that has the same name as the key field of the business object type. It is of course possible to use other parameters to display the required business information represented by the key.
Example
: In accordance with the above guidelines, a Create BAPI of the business object type CompanyCode (key CompanyCodeID) must not have an import parameter CompanyCodeID. The name of the company code to be created could instead be transferred, for example, as field ID in the parameter CompanyCodeData.
Function module interfaces must also satisfy the conventions below:
|
The structure BAPIPAREX must be used for the parameters ExtensionIn and ExtensionOut. |
|
The
Return Parameter is based on the structure BAPIRET2. |
|
The function module must be RFC-enabled. |
|
Underscores ("_") are not allowed in parameter names.
Only upper case letters can be used in the Function Builder, so here the components of parameter names cannot be separated by the use of upper and lower case letters. |