cancel
Showing results for 
Search instead for 
Did you mean: 

lookup for value while mapping

Former Member
0 Kudos

Hi ,

I have a situation in hand and i am looking for a performance effective solution .May be anyone can help me.

I have a PO where i have to map it to a xml . at the item level i have to fetch a field from the SAP Backend and then populate the XML with that value.

I can write a lookup for that field using the JCO lookup.

but this code will execute for each line item . right !!!.

Can i do this in one call and get the field data for all the line items and then split it according to each occurance of line item

Regards

Nikhil

Accepted Solutions (0)

Answers (3)

Answers (3)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>>I can write a lookup for that field using the JCO lookup.

but this code will execute for each line item . right !!!.

never!! use advanced function of type <b>queue</b>

if you send this PO from SAP or to SAP

you can do the lookup in an IDOC user exit...

<b>much better performance</b>

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

you can write a custom RFC which gathers data at one go as import parameters / table and can call it from mapping using Mapping lookup API and use the result into your actual mapping. may be if you are using simple message mapping and if this becomes too complex then re consider use of Java mappings instead.

bhavesh_kantilal
Active Contributor
0 Kudos

Nikhil,

This can be done but with some changes in the RFC.

1. Make changes in the RFC such that it can handle multiple records and send the response in multipkle records . ( The RFC code should contain TABLE to handle this ).

2. Write an Advanced user Defined Function that will take all the input fields as the input, call the RFC and get the response values. Stored them in an array declared in the Java Section ( from Sp 14 onwards, there is a java section that allows you to declare Global Variables and use them anywehere in your mapping ).

3. This user defined function should be called at the mapping of the root nodes.

4. Now , write another UDF , that will read the values out of the global variable array using a global counter , map it to the target and increment the same.

Regards

Bhavesh