Start of Content Area

Background documentation Actions in the ABAP Dictionary  Locate the document in its SAP Library structure

The first step of the implementation phase is to define all the data structures (including domains and data elements) in the ABAP Dictionary. These data structures are required for the parameters of the BAPI to be implemented. You can access the ABAP Dictionary from the project form in the BAPI Explorer.

The conventions below are important:

Conventions for BAPI Data Structures

This graphic is explained in the accompanying text

Each parameter must refer to a data structure in the ABAP Dictionary. In the case of structured parameters this is always to the whole BAPI data structure. But if the parameter consists of only one field, it must refer to a field in a BAPI structure.

Example

The structured parameters DestinationFrom and DestinationTo in the Flight.GetList method refer to the same BAPI structure, BAPISFLDST. The Airline parameter, which consists of one field only, refers to the BAPISFLKEY-AIRLINEID field.

 

This graphic is explained in the accompanying text

You have to create separate data structures for BAPIs that are independent of the data structures generally used in the SAP application.
Reason: When the BAPI is released the underlying structures of the BAPI are frozen and restrictions apply if you want to later change the structures. See also Enhancements to Released BAPIs.

Note

Existing internal structures can be mapped to existing BAPI structures with a field mapping function module that is automatically generated by a mapping tool (transaction BDBS).

This graphic is explained in the accompanying text

All data structure names must begin with <namespace>BAPI.

This graphic is explained in the accompanying text

BAPI structure names should be as meaningful as possible.

This graphic is explained in the accompanying text

You must not use APPENDs and INCLUDEs in BAPI data structures.

Reason: APPENDs and INCLUDEs can cause Incompatibilities, if BAPI data structures are changed.

This graphic is explained in the accompanying text

Always try to use existing central data elements and domains for fields.

 

 

 

Conventions for Field Names

This graphic is explained in the accompanying text

The fields in structures must have meaningful English names with a maximum of 30 characters.

Note

SAP Internal: Use report BAPIFELD to create a list of English field name proposals for an ABAP Dictionary structure. Refer to the report documentation to find out how to use the report.

 

This graphic is explained in the accompanying text

A meaningful English default field name with a maximum of 30 characters should be defined for each data element.

Note

SAP Internal: In the future the default name is always proposed by the SAP internal report BAPIFELD.

Procedure : You can take data objects that still need to be edited from the report BAPIFELD. In the ABAP Dictionary you can define the default field name of the data element by choosing Definition Default field name.

 

Conventions for Input Help

This graphic is explained in the accompanying text

You may have to define single values or a value table for the domain so that F4 help is available for use.

This graphic is explained in the accompanying text

All the useful Search Help (which can be used in the service BAPI Helpvalues.GetList) must be defined for the data structures/data elements. To do this a foreign key must be specified in the fields of a BAPI structure. If a search help has been defined in a field domain, a foreign key must also be defined.

Example

To do this, look at the BAPI structure BAPISFLDST, which is based on the parameters DestinationFrom and DestinationTo in the Flight.GetList method. The value table SAIRPORT is defined for the S_AIRPID domain for the AIRPORTID field in this structure. In the BAPI structure BAPISFLDST, a foreign key dependency is defined for this table.

Technical Conventions

This graphic is explained in the accompanying text

If an external key as well as an internal key has been defined in the database, the external key must always be used in the BAPI interface.

 

This graphic is explained in the accompanying text

For fields relevant for ISO (country, language, unit of measure, currency), additional fields for ISO codes are provided.

Always try to use the standard domains listed below for fields. We recommend that you use your own data elements for the fields. If it does not make sense to use your own data elements, use the standard data elements that are listed below.

 

 

Field

Standard Domains

Standard Data Element

 

Country (SAP code)

LAND1

LAND1

 

Country (ISO code)

INTCA

INTCA

 

Currency (SAP code)

WAERS

CURCY or WAERS

 

Currency (ISO code)

SOCD

ISOCD

 

Language (SAP code)

SPRAS

SPRAS

 

Language (ISO code)

LAISO

LAISO

 

Unit of measurement (SAP code)

MEINS

MSEHI oder MEINS

 

Unit of measurement (ISO code)

ISOCD_UNIT

ISOCD_UNIT

 

 

 

This graphic is explained in the accompanying text

All currency fields use the domain BAPICURR. In special cases the domain BAPICUREXT can also be used.

Example

The currency field PRICE (standard list price of the flight) in the BAPI structure BAPISBOPRI, which is based on the parameter TicketPrice in the method FlightBooking.CreateFromData, uses the BAPICURR domain.

 

This graphic is explained in the accompanying text

You must always use a period for the decimal point.

 

This graphic is explained in the accompanying text

All currency amounts and units of measure must have the decimal point in the correct place.

Reason: The BAPI always uses a standard amount format with commas. So when converting currency amounts use the function modules:
BAPI_CURRENCY_CONV_TO_EXTERNAL and
BAPI_CURRENCY_CONV_TO_INTERNAL.

 

This graphic is explained in the accompanying text

With quantity fields the reference field/reference table must be correctly set to the unit of measure field.

 

This graphic is explained in the accompanying text

All the date elements for date fields must have the format YYYYMMDD.

 

 

 

 

 

Conventions for BAPI/ALE Integration

So that an IDoc for asynchronous communication can be generated from a BAPI, the following conditions must be satisfied:

This graphic is explained in the accompanying text

BAPI structure names must not be longer than 27 characters, otherwise the automatically generated name for the associated segment will be too long and will have to be changed manually later.

Reason: The segment is generated following the convention <BAPI structure name> + <three digit number>.

This graphic is explained in the accompanying text

Single fields in a data structure can only be a maximum of 250 bytes.

 

Conventions for Customer Developments

This graphic is explained in the accompanying text

If IBUs, partners and customers are creating data structures (domains or data elements), the namespaces provided by SAP must be complied with.

Note

Make sure that SAP internal namespaces are consistent, too. This means that if a namespace is used for the whole application, the BAPIs must use the same namespace.

 

 

 

 

End of Content Area