Mapping Multiple Service Interfaces

Objective

After completing this lesson, you will be able to create an operation mapping in the ESR

Structure Mapping

Usually, the outbound interface of the sender software component and the inbound interface of the receiver software component are not identical.

This means that you must define mapping procedures to assign fields that are semantically identical (structure mapping) and conversion rules to convert to the target format (value mapping).

Structure of the Sender Outbound Interface

A structure mapping defines how the fields of the inbound message are to be mapped to the fields of the outbound message that will be sent to the receiver system. The figure, Structure of the Sender Outbound Interface, shows the structure of the sender message for the example scenario.

Data for a material master has to be transferred. A material master is specified uniquely by the MaterialID field. The fields IndustrySector, BaseUnit, and MaterialType are always transferred for the material. The document can also contain the MaterialGroup field (not used in this example). You can include as many language-specific descriptions for the material as required by using the substructure Description. The relevant language is saved as an ISO-language abbreviation in the Language field. The subnode Description can also occur more than once.

Structure of the Receiver Inbound Interface

For a receiver inbound interface too, the material is identified uniquely by the MaterialID field. The same fields for the material are expected as before. However, the target structure has an additional date field that the source document does not have. Furthermore, the target document can receive multiple materials.

The descriptions of the materials are not shown as substructures of the material, but instead are transferred in a separate node that is on the same level as the Material node. To enable the descriptions to be reassigned to the correct material in the target system, each Description node has the relevant ID in the MaterialID field. Both nodes are optional and can occur more than once in the document. Therefore, the inbound interface of the target system can be used both to import new materials and to include additional descriptions, for example, from a translation system.

Assignment Rules

To ensure that the target document is created correctly using the data from the source document, assignment rules need to be defined in the mapping program.

The assignment rules are as follows:

  • You must create an instance of the Material node in the target document, and an instance of the Description node for each instance of the subsegment Description in the source structure.
  • You must copy the fields MaterialID, IndustrySector, BaseUnit, MaterialGroup, and MaterialType from the source document to the fields of the same name in the target document.
  • The target field Date has no equivalent source field. The mapping program must enter an appropriate value here.
  • To assign language-dependent descriptions, you must copy the MaterialID field from the main segment of the source document to every instance of the Description segment in the target document. However, the Language and Description fields must be copied to a separate target node for each source node.

Value Mapping

Apart from assigning fields in the structure mapping, you often need to carry out conversions or calculations.

Examples of When to Carry Out Conversions

  • If the source document has a date field in the format yyyymmdd but the target document expects the format dd.mm.yyyy, a conversion is required.
  • If the material IDs in the source and target systems are not identical, the ID is converted using a conversion table.

Interface Options in Operation Mappings

The operation mapping creates a connection between the outbound and inbound interfaces. In the operation mapping, you define which mapping program defines the mapping procedures from a particular outbound interface to a particular inbound interface.

In the operation mapping, you can usually reference a service interface of type Outbound, an Intermediate Document (IDoc) type, or a Remote Function Call (RFC) interface as the outbound interface. You can reference a service interface of type Inbound, an IDoc type, or an RFC interface as the inbound interface. You can save the mapping procedure by using a message mapping, an eXtensible Stylesheet Language (XSL) mapping, a Java class, an ABAP class, or an ABAP XSL transformation. You can reference the appropriate mapping program in the operation mapping.

Mapping Program Types

Mapping Technologies Supported by SAP Process Integration (PI)

  • Message Mapping

    This is a graphical tool in the ESR that enables you to define the structure and value mappings. A Java program is generated from the logical definition in this case.

  • Java Class

    A Java program converts the mapping that you create manually.

  • XSL

    You use XSL to convert the mapping.

Note

ABAP mappings and ABAP XSL are used to double-stack systems and cannot be used on a Java-only process integration installation such as Advanced Adapter Engine Extended (AEX).

Asynchronous Operation Mappings

The figure, Design View – Operation Mapping in Example Scenario, shows the operation mapping for asynchronous interfaces.

Synchronous Operation Mapping

In the case of synchronous interfaces, there is one data package for the query and one for the response from the server synchronous interface. For this reason, the operation mapping must contain mapping programs for both the query and the response. The client outbound interface contains an outbound message for the query and an inbound message for the response. The server inbound interface contains a target message for the query and an outbound message for the response.

If the client outbound message and the server target message do not have identical structures, create a mapping program. Similarly, if the server outbound message and the client inbound message do not have identical structures, create a mapping program. You can perform several mappings, one after the other.

Hint

If a fault message type is used in the service interfaces, a mapping program may also be necessary.

Create Operation Mappings

Business Scenario

In an integration scenario, the sender outbound interface, and the receiver inbound interface do not have the same structure. A mapping program is used to map the source document to the target document. You want to understand how the objects concerned are configured.

Create an operation mapping OM_BIT500_## in namespace http://education.sap.com/scb##. Use your message mapping to connect the sender interface SI_Material_outb in software component SC_BIT5000_##_A to the receiver interface SI_Materials_inb in software component SC_BIT500_##_B.

Exercise Information

Note

In this exercise, when the values include ##, replace the character with a two-digit number (01–30).

Exercise Options

You can perform this exercise in two ways:

  1. Live Environment: choose Start Exercise, and from the entry page choose Open PDF Document. Follow the steps described in this pdf in your own system landscape.
  2. Simulation: choose Start Exercise, and from the entry page choose Start Tutorial. Watch the step-by-step instructions within the simulation.

Note

We recommend running the simulation first.

Task 1: Create Operation Mappings

Steps

  1. Create an operation mapping OM_BIT500_##.

    1. Navigate to WindowPerspectiveOpen PerspectiveOther. Select Enterprise Service Repository Perspective.

    2. If required, log on with your BIT500-## credentials.

    3. Navigate to your Software Component SC_BIT500_##_B.

    4. Right-click http://education.sap.com/scb## and choose NewOperation Mapping.

    5. Enter OM_BIT500_## in the name field. Verify that the software component SC_BIT500_##_B 1.0 of education.com is maintained in the Software Component Version field. Verify also that the corresponding namespace http://education.sap.com/scb## is maintained in the namespace field.

    6. Choose Finish.

    7. Select your Change List or create a new one.

    8. Choose OK.

  2. Assign service interfaces to the sender and receiver.

    1. In the Source Operation screen area, choose the Add button for the Name field..

    2. In the Select Operation Type dialog box, choose SC_BIT500_##_A, 1.0 of education.comhttp://educaton.sap.com/sca##SI_Material_outbSI_Material_outb.

    3. Choose OK.

    4. In the Target Operation screen area, choose the Add button for the Name field.

    5. In the Select Operation Type dialog box, choose SC_BIT500_##_B, 1.0 of education.comhttp://education.sap.com/scb##SI_Material_inbSI_Material_inb.

    6. Choose OK.

    7. Save your entries.

  3. Assign your message mapping as a mapping program.

    1. Switch to the Definition tab page. .

    2. Double click the Expression Editor sign on the line between the Source and the Target Operation.

    3. In the Mapping Programs box click the Add button.

      Result

      Message Mapping appears automatically in the Type field.
    4. Use the F4 input help in the Name field to select your Message Mapping Program MM##_MaterialA_MaterialsB.

    5. Choose the OK button twice.

    6. Save the operation mapping.

  4. Activate your objects.

    1. Expand your change list. Choose your operation mapping.

    2. On the context menu of your operation mapping choose Activate.

    3. Close the confirmation box.

Log in to track your progress & complete quizzes