Professional Documents
Culture Documents
Usage of SOAP Lookup and RFC Lookup in A Single Mapping Program
Usage of SOAP Lookup and RFC Lookup in A Single Mapping Program
Applies to:
SAP Netweaver™ Exchange Infrastructure SP13.
Summary
This article provides details on the usage of the SOAP lookup and RFC lookup along with the multi mapping
in the single mapping program and explains how to fetch the data using the look up’s and creating files in
their respective business system.
Author Bio
Pavan Kumar Nukala is an SAP PI Consultant in Yash Technologies
Table of Contents
Introduction .........................................................................................................................................................3
Structure of RFC.................................................................................................................................................4
Creation of Outbound Data Types......................................................................................................................6
Creation of Inbound Data Types.........................................................................................................................7
Creation of Message Interfaces..........................................................................................................................8
Mapping ............................................................................................................................................................10
Test the Mapping ..............................................................................................................................................12
Configurations in the Integration Directory .......................................................................................................13
Related Content................................................................................................................................................18
Disclaimer and Liability Notice..........................................................................................................................19
Introduction
We had a requirement in which we want to send the request to the RFC in SAP system and the
WEBSERVICE both at a time and the values which we retrieve from the both systems should create the
separate files in their respective business system.
I tried with the different approaches and finally I come up this approach. While trying with different
approaches I found that synchronous flow of messages does not support multiple receivers. Here I used the
concept of Lookup’s to overcome this issue. And lookup’s helped me a lot and solve the issue very easily.
And along with the lookup’s I used the concept of MULTIMAPPING.
I used the web service as Conversion Rate and created the custom RFC which has the input and output
parameters. The RFC which was created in R/3 system has the functionality to take input and deliver the
output.
Structure of RFC
The above screen shows the input parameters of the RFC and the output parameter is as shown below:
The below screen shows the simple code to fetch the data from the custom table based on the input
parameters.
Based on the web service and the RFC, create the Source data type and message types.
Source data type has the fields FromCurrency and ToCurrency.Create the two inbound data types, one is
for the web service and the other is for the RFC with same structure having the field as ForexRate as below
Create one outbound message type and two inbound message types based on the above data types which
were not mentioned here.
Create the two inbound interfaces for RFC and web service. Inbound interface for the web service which is
asynchronous.
Mapping
Create the message mapping. While creating mapping program add the inbound message types explicitly
under the message tab as shown below
After adding the outbound message type and inbound message types perform the mapping between the
fields as shown below.
In the above screen the input fields FromCurrency and ToCurrency are mapped to the target field
ForexRate which is under message type MT_IB_SoapLookup using the UDF SoapLookUp.
In the above screen the input fields FromCurrency and ToCurrency are mapped to the target field
ForexRate which is under message type MT_IB_RFCLOOKUP using the UDF RFCLookup.
Configure the two receiver communication channels in the ID, one is for the SOAP adapter and the other is
for the RFC adapter. Since we are using the soaplook and the rfclookup in our mapping we need to maintain
the business system name and the respective communication channel names in the UDF.These
communication channels will help to get the output from the RFC and web service based on the values given
in the input fields in the message mapping.
Testing the message mapping. If you observe the below screen based on the input values the output got
generated from the RFC and Web service. The Field ForexRate which has the value 79.4937 is coming from
the web service (of course it may vary from day to day) and the ForexRate which is having the value 80 is
coming from the RFC.
Create the interface mapping between the outbound interface and the two inbound interfaces as shown
below. In the inbound side add the two interfaces by using the add button.
Create the two File receiver communication channels and maintain the required parameters which were not
showed here.
Create the SOAP receiver communication channel and maintain the target URL and soap action.
Create the RFC receiver communication channel and maintain the details of the target R/3 system.
Create the one sender agreement for sender file adapter and two receiver agreements for the receiver file
adapters and create Enhanced interface determination and one receiver determination, no need to create
any receiver agreements for the RFC and SOAP communication channels. The creation of agreements was
not shown here as it is quite easy.
Create the interface determination and select the radio button enhanced and select the interface mapping.
After the source file has picked successfully log on to ABAP stack and hit the transaction SXMB_MONI and
observe the pipeline steps. Under message mapping step under the payload you can see the two payloads
as shown below. Right click on the below selected fields and open them in window one and window two.
In this document I am not giving any code for the UDF’s SOAPLOOKUP and RFCLOOKUP.Since there is
no much difference in the code only thing is to change the business systems and communication channels
For better understand of the code and lookup’s refer the below links.
Related Content
Please refer the below links for more information on lookup’s.
https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/5001
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a03e7b02-eea4-2910-089f-
8214c6d1b439&overridelayout=true
http://help.sap.com