Multiple occurrence of file to single occurrence of RFC

By Chandra Dasari, PI Competency Lead, YASH Technologies

Business Description:

In our Landscape we were supposed to interact SAP Release 4.7 system (production system) from SAP XI using RFC.

The roles of R/3 are configured as Application Server mediating the data transfer using SAP XI which acts as Integration Server from Source to Target System.

The scenario is SAP XI reads multiple records from the source system and sends the same to RFC. Finally, the RFC updates the records in Application System.  

Technical Challenge: 

In our current scenario, the RFC accepts one record at a given time and updates in data Base as the occurrences of RFC in export parameters is 1:1. Hence here the RFC doesn’t support collecting multiple documents.

From customer’s point they are not willing to go for any new developments from ABAP side. 

Feasibility Study & identification of solutions (Some of them…) 

After completing the technical feasibility of the scenario we have concluded with following options in draft phase. 

  1. Either we can develop a wrapper function on top of RFC and change the occurrence to 0...unbounded, then handle the application logic in RFC on application server. But problem arises in Interface Determination as we cannot get pull the Inbound Interface from IR as the original RFC is 1:1 and the modified one has 0...unbounded occurrences.

Draw Back: New development has to be taken care on R/3 System, which might be time consuming and requires an ABAP developer. 

  1. Either Post One record at a time.

Draw Back: multiple records will come in the form of CSV file, this is ruled off. 

  1. Either develops ABAP-Server proxy and handles the calls by developing the application logic in server proxy and finally calls the RFC using the loop so that multiple records can be collected and posted.

Draw Back: Same as point one but more flexible solution than that. Again requires development on application server and again there are dependencies of RFC wherein total code needs to be re-written. 

  1. Try using Multi Mapping Concepts offered by SAP XI.

Draw Backs:  though this approach is well suited but it has its own restrictions, The target requires to be 0...unbounded to use multi mapping. Even if we change the occurrence of RFC to 0.. Unbounded in Interface & Message mapping, after observations we found it will post only one record. 

  1. Finally use BPM concepts & to handle the issue.

There was one Pattern, which solves one of our problems. So we made use of that pattern.

For show casing the technical solution we created simple RFC module in Backend.

Time to put down in XI/PI server. 

PART-0 PREPARATION 

Create a Z<table> to store the records in data base table 

Create function module

Path -> SE37 create the function module in function group. Check the remote enabled option. The import parameters should be sent by pass by value.

Create a Z<RFC> to send the input parameters

Write the source code to update the data base table created in earlier step. 

 

 

FUNCTION ZSCARR_INS_ASY.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(CARRID) TYPE  ZSCARR-CARRID OPTIONAL
*"     VALUE(CARRNAME) TYPE  ZSCARR-CARRNAME OPTIONAL
*"     VALUE(URL) TYPE  ZSCARR-URL OPTIONAL
*"----------------------------------------------------------------------
DATA : ITAB TYPE ZSCARR.
ITAB-CARRID = CARRID.
ITAB-CARRNAME = CARRNAME.
ITAB-URL = URL.
INSERT INTO ZSCARR VALUES ITAB.
ENDFUNCTION. 

PART-1 SYSTEM LAND SCAPE DIRECTORY

  • Create the product

  • Create the Software component for the above created Product

  • Define technical Systems

  •  Define Business systems & assign the related integration Server for the business systems. 

PART-2 INTEGRATION REPOSITORY 

  • Import the Software component into Integration repository

  • Create the name space

  • Enable the option “import of RFC/IDOC permitted “

  • Import the ZRFC from R/3 backend.

Data Type:

  Create the Source Data type

 

No Target Data Type is required as we are importing the RFC from backend into IR.

Message Type:

Source Message type, create message type & assign the data type created earlier 

 

No Target Message Type is required as we are importing the RFC from backend into IR. 

Message interface:

The Message interfaces needed to be created.

 1. File Coming from File System

 

Create an abstract interface as shown; this is the entry point for starting the BPM

Since BPM can understand only Abstract interfaces we need to design one. 

File Abs Going to BPM

Abstract interface picked up from Imported Objects->RFC->ZSCARR_INS_ASY 

 

Integration process:

The Integration process needed to be created for this scenario 

 

Graphical Definition

 

Container Elements

Create the Container Elements as shown the “type” displayed here displays only the Abstract message interfaces 

 

 

 

 

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