cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Lookup within Graphical Mapping: Multiple calls to append output to 0..n Structure possible?

Former Member
0 Kudos

!Dear PI Experts

I got a question on the (graphical) Message Mapping.

Use Case: The source message (left hand side of the Message Mapping) inputs multiple Sales Order Documents IDs, for each we want to make a RFC Lookup to get Details for its Sales Order Document Items and append the BAPI output to the target structure (right hand side of the message mapping).

Technically, we want to fill an unbounded target structure (0..n cardinality) by calling multiple times a Backend-BAPI via RFC Lookup and then mapping/appending the BAPIs output (a table with multiple rows to be precise) to a corresponding structure (0..n) in the target field mapping.

In the Test-Tab of the Message Mapping in ESR, everything works fine! Yet, when doing it "live" through the pipeline (NW 7.40 AEX, Java Only PO) is is not working out but just fills one (the first) returned item to the target. We played around with context switches by adding them or removing them, but nothing solved the issue.

Is there a reasoning for this behaviour? Do we need to code an iterator in an UDF by our selfs around that?

Thanks a lot for your support!

Cheers

Benedikt

Accepted Solutions (0)

Answers (2)

Answers (2)

ambrish_mishra
Active Contributor
0 Kudos

Hi Benedikt,

IMO,for this design, the best appraoch would be to have a 2 step mapping. In the first step, send the sales order document IDs as a table and get a table back with details. This means one RFC call to ECC. FOr this you will have to code the RFC to return a table. Enrich the intermediate targget structure with details and in the next mapping step, you can do multi-mapping if you want to generate multiple message. On hindsight, it may not be required.

Hope it helps!

Ambrish

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>RFC Lookup to get Details for its Sales Order DocumentItems and append the BAPI output to the target structure (right hand side of the message mapping).

this is a bad approach for this task, you should write a wrapper on the BAPI which will work with multiple calls at the same time and just call it once from PI - you should never do multiple calls for the same thing from PI if this can be done with just one and in your case it's a pretty simple change,

Regards,

Michal Krawczyk