Understanding and working with ABAP Mapping

By Yugandhar Kotha, YASH PI Competency Core Team, YASH Technologies

This document gives you clear understanding of ABAP Mapping, how to enable the option to use ABAP Mapping class in XI Interface Mappings, how to parse and read the input XML source structure and build the output XML target structure. 

Below are different ways of achieving this conversion in XI: 

  1. Message Mapping (Graphical Mapping using Mapping Editor in XI)
  2. Java Mapping
  3. ABAP Mapping
  4. XSLT Mapping

The rest of the document gives you pre-requisites and steps that are necessary for making use of ABAP Mapping class.

Pre-requisites and Steps required for developing ABAP Mapping Classes 

Pre-requisites: Enable ABAP Mapping: 

Add additional mapping types in your exchange profile

  • Open http://<host>:<port>/exchangeProfile/index.html

  • Choose IntegrationBuilder ->IntegrationBuilder.Repository -> com.sap.aii.repository.mapping.additionaltypes

  • Maintain the Entry R3_ABAP|Abapclass;R3_XSLT|XSL (ABAPEngine)

Check whether the data has been successfully read from the exchange profile:

  • Open http://<host>:<port>/rep/support/admin/index.html

  • Choose Administration of Properties -> All Properties . If the value associated to parameter com.sap.aii.repository.mapping.additionaltypes is not correct, Choose at the top of the page and refresh.

Steps to create an ABAP Mapping Class:

  1. Create a new ABAP class in transaction SE24 of ABAP Stack of XI,

 

  1. The ABAP Class has to implement the interface IF_MAPPING

 

  1. The method EXECUTE of this interface needs to be developed, this method will be called from during mapping, the method has the following parameters:

 

The SOURCE parameter contains the input XML structure in XSTRING format.

The mapping program needs to construct the RESULT xstring, which will be used for the construction of output XML structure. 

  1. The explanation of the ABAP Mapping is provided later in the document in the section Steps to be followed in the ABAP Mapping Class.

Scenario Demonstrating the usage of ABAP Mapping

             

Ø       The scenario here involves the conversion of a customer format xml file containing the information of the employees in one specific format to another format. The source file is available on the FTP and the Sender file adapter picks it. This file is deleted and archived on a different directory on the FTP. The source XML file is converted into target XML file by the ABAP mapping program and this target file is placed on the FTP again on a different directory. 

Ø       Here is the source XML structure:  

Ø       Here is the target XML structure:  

OBJECTS DEVELOPED FOR THE SCENARIO 

Ø       The following are the object details that are developed for this scenario:

Objects developed in the Integration Repository

o        DATA TYPES

§         DT_Emp_Det  

§         DT_Employees

o        MESSAGE TYPE

§         MT_Emp_Det  

§         MT_Employees

o        MESSAGE INTERFACES

§         MI_Emp_Det_OB  

§         MI_Employees_IB  

o        MESSAGE MAPPING

§         No Message Mapping is required as we could directly specify the mapping object as ABAP Mapping class in the Interface mapping object. 

o        INTERFACE MAPPING

§         IM_MI_Emp_Det_OB_MI_Employees_IB  

Objects created in the Integration Directory 

o        Business Service YASH_FTP (the same business service is used as Sender and Receiver )

o        Communication Channels

§         CC_XML_Sender_FIle

§         CC_XML_Receiver_FIle

o        Receiver Agreement  

o        Sender Agreement  

o        Interface Determination  

o        Receiver Determination

Click here to continue...

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image