Show TOC

Maintaining Referential Integrity in BAPI WrappersLocate this document in the navigation structure

Definition

You need to follow certain guidelines when developing BAPI wrappers. The guidelines enable you to maintain integrity between the header and item records of a back-end business object in the Data Orchestration Engine (DOE).

These rules are applicable for:

  • The data objects that you create in the DOE

  • The data objects that you import from existing syncBOs and edit in the DOE

The rules are not applicable for the data objects that are imported from existing syncBOs.

Use

You need to follow certain rules when developing BAPI wrappers and use the following functions:

  1. GetDetail function with more than two levels of data object nodes in the hierarchy

  2. GetBulkDetail function with two levels of data object nodes in the hierarchy

  3. GetBulkDetail function with more than two levels of data object nodes in the hierarchy

  4. Special case with four or more levels of node hierarchy

General Rule

If a node contains a field that has the same name and data type as the parent's back-end key field, the DOE considers the field as the parent node's back-end key field in the current node. That is, the DOE assumes that the back-end system uses the:

  • Fields that have the same name and data type in both the parent and child nodes

  • Fields that are marked as back-end key fields in the parent node

Note

To enable the automatic key mapping scenario, you need to select the Automatic Key Mapping checkbox on the Data Object Overview screen. Alternatively, you can choose Explicit Key Map in the child nodes.

GetDetail Function with More Than Two Levels of Data Object Nodes in the Hierarchy

Here, each node from the third level must contain a field that:

  • Has the same name and data type as the name and data type of the parent node's back-end key field.

  • Is considered by the middleware as the immediate parent node's back-end key field.

  • Is marked as a back-end field.

  • Carries the same semantics in the corresponding item structure of the BAPI wrappers. That is, the fields in an item should refer to the parent item's back-end key.

  • Is mapped to the corresponding fields of items of the BAPI wrapper.

Example

When you call the GetDetail function, the back-end system enters the values for the mapped item fields:

Figure 1: Three-Level Node Hierarchy

GetBulkDetail Function with Two Levels of Data Object Nodes in the Hierarchy

The following rules apply:

  • Each field marked as a back-end key in the root node must have a field with same name and data type in the child node.

  • Mark the fields in the child node as back-end fields.

  • The corresponding item structure of the BAPI wrappers must have fields that carry the same semantics. That is, the fields in an item must refer to the parent item's back-end key.

  • Map the fields in the data object node to the corresponding fields of the BAPI Wrapper items.

Example

When you call the GetBulkDetail function, the back-end system enters values for the mapped item fields.

Figure 2: Two-Level Node Hierarchy

GetBulkDetail Function with More Than Two Levels of Data Object Nodes in the Hierarchy

The following rules apply:

  • The node at the second level must have fields with the same name and data type as the name and data type of the root node's back-end key fields.

  • Each node from the third level must contain fields with the same name and data type as the name and data type of the root node's back-end key field.

  • Each node from the third level must contain fields with the same name and data type as the name and data type of the immediate parent node's back-end key fields.

  • Mark each of these fields as back-end fields.

  • The corresponding item structure of the BAPI wrappers must contain the fields that carry the same semantics.

  • Map the fields in the data object node to the corresponding fields of the BAPI wrapper items.

Example

When you call the GetBulkDetail function, the back-end system enters values for the mapped item fields.

Figure 3: Three-Level Node Hierarchy

Special Case with Four or More Levels of Data Objects

In cases where instances on two or more levels have the same key values although they belong to different hierarchies, it is mandatory that:

  • In the case of GetDetail: All nodes starting from the third level must have the same name and data type as the back-end key fields of all the nodes above it. However, you need to exclude the back-end key fields of the root node. These are marked as the back-end key fields of the current node.

    In the case of GetBulkDetail: All nodes starting from the second level and including the back-end key fields of the root node must have the same name and data type as the back-end key fields of all the nodes above it.

  • The corresponding item structure of the BAPI wrappers must contain the fields that carry the same semantics.

  • The fields in the data object node must be mapped to the corresponding fields of the BAPI wrapper items.

Example

When you call the GetDetail and the GetBulkDetail functions, the back-end system enters values for the mapped item fields.

Figure 4: Four-Level Node Hierarchy for GetDetail Function
Figure 5: Four-Level Node Hierarchy for GetBulkDetail Function
Note

The BAPI wrappers do not change, irrespective of whether the sync type is DOE triggered or back-end triggered. However, you can use either a key-push or an instance push for a back-end triggered BAPI wrapper.

  • In the case of a key-push, you need to call the SMMW_BE_CALL_DELTABO function module with your back-end keys and the back-end business object name that you specify while creating the back-end adapter. You need to make the call from the back-end system, specifying an RFC destination that connects to the DOE. The DOE then calls the GetDetail BAPI wrapper and gets the complete instances corresponding to the keys sent.

  • In the case of an instance push, you need to specify the name of the function module in the back-end adapter. The system also generates the function module. Call this function module from your back-end system and send the complete instance together with the task type (I/U/D).