cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping problem with lookups and context issues

Former Member
0 Kudos
62

Mapping, lookup and context problem

I hope someone can help me or point me in the right direction for the following mapping problem:

I have a structure (WDSL) that is similar to an IDOC that I have to map to the IDOC SalesOrderCreate. In the mapping there are some lookups that have to be performed to check the material numbers and customer numbers. The problem is that with one of the lookups, the queue in the mapping displays the correct value but when I test the mapping, one field stays empty.

Here is the inbound file:

<E1BPPARNR SEGMENT="1">

<PARTN_ROLE>WE</PARTN_ROLE>

<PARTN_NUMB>00001322</PARTN_NUMB>

<ZAJW_CCDE>B4363A66</ZAJW_CCDE>

<ZAJW_UKPT/>

</E1BPPARNR>

<E1BPPARNR SEGMENT="1">

<PARTN_ROLE>Z4</PARTN_ROLE>

<PARTN_NUMB>B4363A66</PARTN_NUMB>

<ZAJW_CCDE>B4363A66</ZAJW_CCDE>

</E1BPPARNR>

<E1BPPARNR SEGMENT="1">

<PARTN_ROLE>AG</PARTN_ROLE>

<PARTN_NUMB>99B1647</PARTN_NUMB>

<ZAJW_CCDE>B4363A66</ZAJW_CCDE>

</E1BPPARNR>

If any of the lookups produces an incorrect value in the functional module in R/3, it will fail and create an entry in a custom error log table. This can be accessed by the user to make the necessary changes to the system, e.g. create the customer.

The mapping is something like this:

For each different instance based on the Partner role, there is a different mapping for the partner number

<u>For partner role AG:</u>

One to one mapping

<u>For partner role WE:</u>

Do a lookup on the partner number to check if it is valid. In the lookup call, there are 4 extra fields sent to fill the error log table with extra information if needed, like timestamp, customermaterialnumber, delivery date and quantity.

<u>For partner role Z4:</u>

Do a lookup on the partner number to check if it is valid. This is a different lookup as for WE because different things have to be checked. In the lookup call, there are 4 extra fields sent to fill the error log table with extra information if needed, like timestamp, customermaterialnumber, delivery date and quantity.

And this <i><b>should</b></i> be the result:

<E1BPPARNR SEGMENT="1">

<PARTN_ROLE>WE</PARTN_ROLE>

<PARTN_NUMB>00001322</PARTN_NUMB>

</E1BPPARNR>

<E1BPPARNR SEGMENT="1">

<PARTN_ROLE>Z4</PARTN_ROLE>

<i><PARTN_NUMB>99B4363A66</PARTN_NUMB></i>

</E1BPPARNR>

<E1BPPARNR SEGMENT="1">

<PARTN_ROLE>AG</PARTN_ROLE>

<PARTN_NUMB>99B1647</PARTN_NUMB>

</E1BPPARNR>

The problem is that for partner role Z4, no value is given to the partner number if I test the mapping. It looks like this happens because I added the 4 extra fields from other segments. If I remove the fields or the lookup, everything works fine. This makes me think it could be something to do with contexes but nothing that I have tried works.

Another remark is that the order in which the instances is presented. If the AG instance is first, both the WE and Z4 mapping only produces the partner role but not the partner number. Also if the AG instance is presented last and the WE first, only the Z4 does not produce any partner number and similar if the Z4 is presented before WE, no partner number for WE.

If hope this makes sense. Please let me know if you need more info to help me.

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanx for the tip. I have read up some more about the context and that was exactly what the problem was. Because I use fields from different segments, they had to be in the exact same context to be used in the lokoups. My problem was also solved by getting all the fields into the same context and for the instances using the SplitByValue function.

Former Member
0 Kudos

This is probably due to context problems, have a look at all the fields you are using with your user-defined function, and make sure that all are on the same context level.

topdown - use "copyPerValue" and "SplitByValue"

bottomup - use "removeContext"