Integration Repository is a design time tool where we can design and develop different objects involved in XI Integration. This helps us create integration scenarios, message types, data types, interfaces and mapping objects and designing integration processes. These objects are organized under the software component versions. These SWC versions hence need to be imported from SLD before we can begin IR development.
In the previous article, we discussed the scenario and SLD settings required for the same. Here we will understand the IR part.
Go to XI Start Page (Transaction SXMB_IFR) and choose Integration Repository.
- Go to menu path Tools -> Transfer from System Landscape Directory -> Import Software Component Versions…
- Select your SWC and click ‘Import’
- The newly created SWC should now appear in the left frame. Expand the SWC, and double-click on the version
- On the Definition tab, select the Interface Import option as ‘Import of RFC and IDoc Interfaces from SAP Systems Permitted’
- Specify the System name and Client of the SAP system
- Add a namespace to the SWC to hold the repository objects
- Namespaces can be defined in two ways:
- URI format – http://abc.com/xi/scenarios
- URN format – urn:abc-com:xi:scenarios
- Namespaces can be defined in two ways:
Import IDoc Interface from SAP System
- Expand the SWC and right-click on Imported Objects
- Choose to Import RFCs and IDocs
- Provide Logon credentials
- Choose the IDoc ZRZSO_MT.ZRZORDER, and continue
- Click ‘Finish’ to import the IDoc
Define Data Types
- Under ‘Interface Objects’ within your namespace, right-click on ‘Data types’ and select ‘New…’
- Define four data types – SalesItem_DT, SalesHeader_DT, Customer_DT, and Orders_DT as shown
- Save the objects
Create Message Type
- In the left frame, right-click on ‘Message Types’ and select ‘New…’
- Note that the root element of the XML business document must match the message type exactly (case-sensitive)
- For the section ‘Data Type Used’ select the data type Orders_DT
- Save the object
Create Message Interface
The message interfaces in the integration repository can be of three types – Outbound Interface, Inbound interface and Abstract Interface. Outbound interfaces are used to communicate with XI, which receives messages from senders. XI in turn uses Inbound interfaces to route the messages to receivers. The Abstract interfaces are used for communication between integration server and ccBPM.
Interfaces can further be classified into Asynchronous and Synchronous depending on the direction of message flow. Asynchronous interfaces allow unidirectional message flow, while synchronous ones can communicate bidirectionally (request and response).
- From the left frame create a new message interface object called ‘Orders_out’
- The interface should be outbound and asynchronous
- Specify the message type as ‘Orders’
- Save the object
Create Message Mapping
SAP XI supports four kinds of mapping Graphical Mapping, Java Mapping, ABAP Mapping and XSLT mapping to map the source message to the receiver message. We will create a Graphical Message Mapping in this example.
- Expand ‘Mapping Objects’ under your namespace and right-click on ‘Message Mappings’ to create a new message mapping called Orders_ZRZORDERS
- Select ‘Orders’ as source message and ZRZSO_MT.ZRZORDER as target message
- Define mappings rules using the graphical mapping editor
- Disable the IDoc control segment as it will be populated automatically by the adapter
- Use the arithmetic function ‘counter’ to map the SEGMENT fields of IDoc segments
- Assign a constant ‘1’ to BEGIN field of the IDoc
- Save the object
- Mapping rules applied are as shown below
- To test the mapping, select ‘Generate Instance’ on the Test tab
- Fill in the values in the XML instance. Alternatively, you may upload an XML file containing data from your desktop
- Click on ‘Execute Mapping’
- In the right-hand side, you should see the IDoc populated with appropriate values
- Integration Engine converts the input XML document into XML-IDoc format based on the mapping rules. The conversion is shown below
Create Interface Mapping
- Create an object of type ‘Interface Mappings’ named ‘Orders_out_ZRZORDERS’
- Specify source interface, target interface and the mapping program as shown below
- Save the object
Finally, go to the change list tab and activate it. Thus, we are done with Repository part. In the next part of this series, we shall understand the configuration aspects using XI Integration Directory.