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:
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. 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.
|
|
You have to create separate data structures for BAPIs
that are independent of the data structures generally used in the SAP
application. 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). |
|
All data structure names must begin with <namespace>BAPI. |
|
BAPI structure names should be as meaningful as possible. |
|
You must not use APPENDs and INCLUDEs in BAPI data structures. Reason: APPENDs and INCLUDEs can cause Incompatibilities, if BAPI data structures are changed. |
|
Always try to use existing central data elements and domains for fields. |
|
|
|
The fields in structures must have meaningful English names with a maximum of 30 characters. 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.
|
|
A meaningful English default field name with a maximum of 30 characters should be defined for each data element. 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.
|
You may have to define single values or a value table for the domain so that F4 help is available for use. |
|
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. 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
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. |
|
|||
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 |
|
|
|
|
||
All currency fields use the domain BAPICURR. In special cases the domain BAPICUREXT can also be used. 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. |
|
|||
You must always use a period for the decimal point. |
|
|||
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: |
|
|||
With quantity fields the reference field/reference table must be correctly set to the unit of measure field. |
|
|||
All the date elements for date fields must have the format YYYYMMDD.
|
|
|||
|
|
|
||
So that an IDoc for asynchronous communication can be generated from a BAPI, the following conditions must be satisfied:
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>. |
|
Single fields in a data structure can only be a maximum of 250 bytes.
|
If IBUs, partners and customers are creating data structures (domains or data elements), the namespaces provided by SAP must be complied with. 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.
|