cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid multiple RFC calls for file->BAPI interface

Former Member
0 Kudos

Hello,

I have a requirement that i get a csv file with hundreds of records related to material price changes. I have to call 2 BAPI's, one is to change price and 2nd one is to save the price. I am doing it in this way:

1) Mapped source file structure to 2 BAPI's by changing the occurrence  to 0 to unbounded( Multi mapping concept).

2) changed the occurrence in operation mapping as well.

Now the thing is it is processing each record as one message in PI and making RFC call for every line of record. I would like to avoid multiple RFC calls and multiple messages in PI and would like to see just 2 messages( one per BAPI).

I am just wondering is there any way that we can implement this with out using proxy to call BAPI inside proxy.

Accepted Solutions (0)

Answers (3)

Answers (3)

Muniyappan
Active Contributor
0 Kudos

Hi,

the root node needs to have occurrence 1:1 then only, it will create one single message. tag messages does not count, as it is runtime tag.

looking at you mapping, it is multimapping, i.e bapi_matval_price_change has 0..unbounded occurrence.

if you test message mapping with source message(with 100 records), it will created 100 bapi_matval_price_change nodes. so you are getting 100 messages.

i think you have two options.

1. modify existing RFC and add root tag to bapi_matval_price_change .

2. create proxy(as you mentioned). here also you have to add root tag to bapi_matval_price_change.

if you can, please change it to proxy.

Regards,

Muni

Former Member
0 Kudos

Thank you Souvik & Muni.

Yes you are correct, my requirement is multi mapping and I changed the occurrence of BAPI to 0-unbounded because i am getting multiple records in source file and that needs to be mapped to BAPI.

If i do not change the occurrence, it is just creating only one record. If you see the structure of the BAPI, most of the segments occurrence is 1-1 only so i can not repeat them to accommodate multiple records.

Each record in file will have a unique material number and if you see the BAPI, there is no way that we can repeat the material field for multiple records since the occurrence is 1-1.

I would like to avoid proxy and wrapper BAPI methods.

Former Member
0 Kudos

Hello NV,

Based on your requirement, if you just want the corresponding BAPI structures grouped into Message1 and Message2 (but without the root nodes, i.e., without Message1 and Message2 root nodes, only the BAPIs), then kindly change the occurrence of Message1 and 2 to 0..1 from 1..1. After that, in the same operation mapping use 2 more steps of message mappings, wherein in each of the steps you'll have the BAPI structure (leave Message1 and 2 unmapped) being mapped to the same BAPI but without the header nodes (Message 1 and 2) on the target side. Note that each BAPI structure on the target side will have a root node.

Kindly do not use anything in the signature tab in this case. Also please maintain ignoreRecordsetName as true. In this manner, the root node on the target side will be ignored.

In Receiver Interface Tab, please use the root message type names used in the last 2 step message mapping of the operation mapping.

Former Member
0 Kudos

Hello NV,

Could you please perform 3 things:

1. In FCC, maintain ignoreRecordsetname as False. Also set a record set name for the entire structure with its occurrence as 1..1 in each mapping.

2. Maintain the occurrence in operation mapping as 2.

3. Maintain the Maximum RFC connection as 2.

Regards,

Souvik

Former Member
0 Kudos

Hello Souvik,

Thank you for your reply.

1. In FCC, maintain ignoreRecordsetname as False. Also set a record set name for the entire structure with its occurrence as 1..1 in each mapping.

Yes i have maintained ignoreRecordsetName = False. But i did not get the point on "set the record set name for entire structure with it's occurrence as 1..1 in each mapping" meaning? Please see below my mapping  structure if you can suggest any based on that.

2. Maintain the occurrence in operation mapping as 2.

I do not see the occurrence as 2 in operation mapping

3. Maintain the Maximum RFC connection as 2.

Yes i did.

Former Member
0 Kudos

Hello NV,

Thanks for the clarification through screenshot from your end as well.

I'll state my clarification as per the above corresponding points.

1. The screenshot shows that the target structure is ok with a root structure at top.

2. By maintaining occurrence as 2, I meant maintaining multiplicity as 2.

3. Its the RFC maximum connections which you have maintained.

For doing point 2, in signature tab of message mapping you need to have 1 service interface on the source side, and 2 service interfaces on the target side. In Interface determination as well, these service interfaces will be maintained with only one operation mapping. This will then give multiplicity of 2 in Interface determination.

Regards,

Souvik

Message was edited by: Souvik Bhattacharjee

Former Member
0 Kudos

Hello Souvik,

Point No: 1 - Maintained ignoreRecordsetName  False and entered recordset name. I am not sure whether am i missing anything here in FCC but i am getting Error: com.sap.engine.interfaces.messaging.api.exception.RetryControlException: Split mapping created no messages, cannot proceed. Review your mapping setup: splitting to 0 messages is not allowed

Point No 2: Maintained in same way and it is clear.

Point no: 3 is clear.

Former Member
0 Kudos

When i maintain FCC like below it's working perfectly fine but as i explained in my first post, it is creating one separate message per each record in file( 100 records in file means its creating 200 messages in PI).

Former Member
0 Kudos

Hello NV,

In the signature tab, on the target side, instead of using BAPI RFC messages, kindly use Message1 and Message2.

Reason being, if you use BAPI RFC messages on the target side (which has occurrences of unbounded), then it causes multiplicity of service interface at Interface Determination level, and hence multiplicity of message (200 in your case for ex.).

Also, please maintain ignoreRecordsetName as true. I was wrong when I had suggested it as false.

Regards,

Souvik

Former Member
0 Kudos

For example: if i have 100 records in csv file i am seeing 200 messages created in PI(one message per record since it has to call 2 BAPI's, it's 2 times of 100 records).