Specifying Development Objects in ABAP Dictionary

Purpose

After you have specified the contents and names of the required interface parameters, you can identify and define the required data objects in the ABAP Dictionary.

Process Flow

Note the following guidelines:

·        You can use individual fields, structures and tables as parameters. Every parameter must refer to a Dictionary object.

Note that all the parameters must be defined as structures. If a parameter consists of one field only, this must be linked to a field in a BAPI structure.

Complex data types, such as table fields in structures, are not allowed.

·        You have to create your own data structures for the BAPI interface that are independent of the data structures generally used in the SAP application. This enables changes to be made in SAP applications without affecting BAPIs.

Give meaningful names to the data structures you create. Names should begin with the prefix BAPI.

·        You must not use INCLUDE structures in BAPI structures, because enhancements to INCLUDE structures generally lead to incompatible changes to the BAPI structure. For further information see Incompatible Enhancements. BAPI structures themselves should not be used in other structures.

Structure S1 consists of fields F1 and F2. Structure S2 includes structure S1 and has a field F3. If a field F3 is added to structure S1, this causes an incompatible change to structure S2 and leads to a name clash of the F3 fields. 

The graphic below illustrates the problem:

·        You can use existing data elements and domains for fields in BAPI structures. If possible only use central data elements and domains contained in SAP NetWeaver. The associated development classes begin with B or S.

Before you use an existing data element or domain, you should consult the respective colleague responsible for the object.

·        Choose meaningful names in English for the fields in the structures. Up until Release 4.0 ten characters were available for naming structures; from Release 4.0 you can use up to 30 characters. You can use alphanumeric characters and underscores.

As of Release 4.0 default field names in English exist for data elements in the ABAP Dictionary. Whenever possible use these names for the field and parameter names.

The report BBAPIFLD generates the English default names for the fields and parameters. To use this report refer to the report documentation. 

If German field names are used in the internal work structures of a BAPI you can use the transaction described in Converting Between Internal and External Data Formats, to convert the German field names into English.

In the example in the previous steps, the reference fields/tables shown below were identified for the parameters.

The first example here uses structures created in Release 3.1. In this Release structure names had a maximum of 10 characters.

The second example shows how you could name the structures more meaningfully in Release 4.0.

     Parameters and their Reference Fields in Release 3.1

Parameter in the Function Module

Reference Field/Table

COMPANYCODEID

BAPI0002_2-COMP_CODE

COMPANYCODEDETAIL                   

BAPI0002_2

COMPANYCODEADDRESS

BAPI0002_2

RETURN

BAPIRETURN1

     Parameters and their Reference Fields in Release 4.0

Parameter in the Function Module

Reference Field/Table

COMPANYCODE

BAPI0002_2-COMP_CODE

COMPANYCODEDETAIL                   

BAPI0002_COMPANYCODEDETAIL

COMPANYCODEADDRESS

BAPI0002_COMPANYCODEADDRESS

RETURN

BAPIRETURN1