cancel
Showing results for 
Search instead for 
Did you mean: 

Right scenario with Proxy

Former Member
0 Kudos

Hi Dear Friends,

I have such model scenario.

I read data from text file and write them to SAP by means of BAPI.

Each row from file is mapped to the BAPI. So as many rows in file as many times the RFC Adapter will be called.

I have implemented this scenario with RFC adapter by two different approaches:

1). with multimapping 1:N;

2). without multimapping.

In first approach I read file once, in second approach I read file as many times as quantity of the rows in file.

For example, if there are 5 rows in file,

1) in first approach I have 6 messages in RWB Adapter Engine (one - for file adapter, five - for RFC adapter); Elements of read file are splitted to five BAPIs;

2) in second approach I have 10 messages in RWB Adapter Engine (five - for file adapter, five - for RFC adapter).

So as for performance the first approach is more preferable, isn't it?

<b>I want to implement the same scenario with Proxy</b>, my WAS is 6.40.

How can I do it by right way? Need I use loop in ABAP code or not?

Thank you in advance.

With the best regards,

Natalia Maslova.

Accepted Solutions (1)

Accepted Solutions (1)

turmoll
Active Contributor
0 Kudos

Hi,

Since you can not implement multimapping (split on AE) using proxy then you go for second approach. In such case you will need to loop at all rows of file. The question is: which data type you should use to exchange data? It might be just a table with rows that correspon exectly file's rows or you can do some mapping to stucture which more or less reflects BAPIs structures, it's up to you.

Regards,

Jakub

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Natalia !

I suggest that you define a multi-row data type in Integration Repository, that is define an element with occurance 0..unbounded and inside this one, one simple element for each field of the input file. This will be the foundation for the message interface that you will need to generate the abap proxy, to make the proxy able to receive the complete set of records in just one call. Then inside the abap proxy code, you will need to use a loop to cycle between each element of the incoming data (from XI) and process each field as you need. Of course you can make a BAPI call for each record inside the abap proxy, I think this approach will give more performance because the abap proxy needs no adapter, while the RFC adapter uses more resources. One thing: the use of a loop inside the abap proxy code depends on how do you process the data...if you will call some BAPIs that are able to receive a table of data, then the transfer of data from XI to those BAPI parameters will be straightforward, on the other hand, if those BAPIs can only process one record per time, then you will need a loop.

Regards,

Matias.

turmoll
Active Contributor
0 Kudos

Natalia,

You mentioned that one row of your source file corresponds to one BAPI call. You will pass the entire file into the inbound proxy. This will force you to use loop at each file row.

The question you should ask yourself is whether you want to commit BAPI after one loop pass or after loop is finished. It is up to the requirements you have and how you want to treat the file content whether you have one transaction file or the file of transactions.

Regards,

Jakub

former_member192343
Active Contributor
0 Kudos

You should map your file structure to right XML structure, and recieve this XML at PROXY side. Now you can do with this data what you want. For example, read row by row and call your bapi for each row.