cancel
Showing results for 
Search instead for 
Did you mean: 

Problems whith one mapping

Former Member
0 Kudos

Hi All,

First of all, sorry for my English.

I have the next xml:

    <E1EDKA1 SEGMENT="1">

      <PARVW>RS</PARVW>

      <LIFNR>0001101989</LIFNR>

      <NAME1>xx</NAME1>

      <NAME2>xx</NAME2>

      <STRAS>xx</STRAS>

      <ORT01>xx</ORT01>

      <PSTLZ>xx</PSTLZ>

      <LAND1>ES</LAND1>

      <TELF1>xx</TELF1>

      <SPRAS>S</SPRAS>

      <REGIO>08</REGIO>

      <BNAME>BATCHADM</BNAME>

      <PAORG>0021</PAORG>

    </E1EDKA1>

    <E1EDKA1 SEGMENT="1">

      <PARVW>AG</PARVW>

      <PARTN>0001101989</PARTN>

      <NAME1>xx</NAME1>

      <STRAS>xx</STRAS>

      <ORT01>xx</ORT01>

      <PSTLZ>xx</PSTLZ>

      <LAND1>xx</LAND1>

      <TELF1>xx</TELF1>

      <SPRAS>S</SPRAS>

      <REGIO>29</REGIO>

      <SPRAS_ISO>ES</SPRAS_ISO>

    </E1EDKA1>

    <E1EDKA1 SEGMENT="1">

      <PARVW>EM</PARVW>

      <PARTN>0000200437</PARTN>

      <NAME1>xx</NAME1>

      <STRAS>xx</STRAS>

      <ORT01>xx</ORT01>

      <PSTLZ>xx</PSTLZ>

      <LAND1>xx</LAND1>

      <TELF1>xx</TELF1>

      <SPRAS>S</SPRAS>

      <ANRED>Sr.</ANRED>

      <REGIO>46</REGIO>

      <SPRAS_ISO>ES</SPRAS_ISO>

    </E1EDKA1>

    <E1EDKA1 SEGMENT="1">

      <PARVW>RE</PARVW>

      <PARTN>0001101989</PARTN>

      <NAME1>xx</NAME1>

      <STRAS>xx</STRAS>

      <ORT01>xx</ORT01>

      <PSTLZ>xx</PSTLZ>

      <LAND1>ES</LAND1>

      <TELF1>xx</TELF1>

      <SPRAS>S</SPRAS>

      <REGIO>29</REGIO>

      <SPRAS_ISO>ES</SPRAS_ISO>

    </E1EDKA1>

    <E1EDKA1 SEGMENT="1">

      <PARVW>RG</PARVW>

      <PARTN>0001101989</PARTN>

      <NAME1>xx</NAME1>

      <STRAS>xx</STRAS>

      <ORT01>xx</ORT01>

      <PSTLZ>xx</PSTLZ>

      <LAND1>ES</LAND1>

      <TELF1>xx</TELF1>

      <SPRAS>S</SPRAS>

      <REGIO>29</REGIO>

      <SPRAS_ISO>ES</SPRAS_ISO>

      <ZCLIENTE_CAB_FACTURA SEGMENT="1">

        <INTCA>ES</INTCA>

        <INTCN3>042</INTCN3>

        <CITY_CODE>29710</CITY_CODE>

      </ZCLIENTE_CAB_FACTURA>

      <ZDATOS_PAGADOR SEGMENT="1">

        <SORT1>1101989</SORT1>

        <KVGR1>FA</KVGR1>

      </ZDATOS_PAGADOR>

    </E1EDKA1>

    <E1EDKA1 SEGMENT="1">

      <PARVW>BK</PARVW>

      <LIFNR>0021</LIFNR>

      <NAME1>xx</NAME1>

      <STRAS>xx</STRAS>

      <ORT01>xx</ORT01>

      <COUNC>xx</COUNC>

      <PSTLZ>xx</PSTLZ>

      <LAND1>xx</LAND1>

      <TELF1>xx</TELF1>

      <REGIO>08</REGIO>

    </E1EDKA1>

And I have the next mapping see mapping.jpg.

The problem is that I always retrieve as that value which is on the Constant EM, and never in the constant AG.

Someone can help me?

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I can only say one thing, thank you very much, and this solved the problem, you are really few cracks.

former_member184681
Active Contributor
0 Kudos

Dear Arturo,

Remember that it is always worth it to close the topic, so that people will know that it has the correct answer when they do the search on SDN for a similar issue.

Regards,

Greg

Answers (6)

Answers (6)

Former Member
0 Kudos

Well it does not work.

I have a iDoc INVOIC02 that maps into a MESSAGE TYPE will cause an update SQL in the database.

For each invoice line I have an update in the database. The problem is that the value of LFFA05 I just put it on the invoice line 2, in the rest gives me null and does not generate or the field.

Former Member
0 Kudos

Well now it seems that if I retrieve the value correctly. But the problem I have now is that the result is a Stament for each invoice line I have, and the value has to go on each line, and now just put it in the first line.

In the second and subsequent lines I <LFFA05> field disappears.

If not properly explained to me .... Pffffff that complicated everything is.

You are some cracks.

Former Member
0 Kudos

Hi,

Hope i understood you correctly and we both are on a same page..

Use splitby value(each value) just before <LFFA05>

Thanks

Amit Srivastava

former_member184681
Active Contributor
0 Kudos

Arturo,

Actually I got your requirement differently than Amit did . If I got it right, you only have one invoice as output, but it has multiple items, and you want to repeat this PARTN mapping result for each item, is that right? If so, use the useOneAsMany function just before the target field, with the mapping you have so far as the first attribute:

...mapping so far... -> useOneAsMany -> Result

As the second and third input, use the E1EDP01 source node.

Regards,

Greg

Former Member
0 Kudos

Well I've done the tests and still not working.

If you realize in the XML I have a combination that is:

<PARVW> RS </ PARVW>

<LIFNR> 0001101989 </ LIFNR>

<PARVW> AG </ PARVW>

<PARTN> 0001101989 </ PARTN>

<PARVW> EM </ PARVW>

<PARTN> 0000200437 </ PARTN>

<PARVW> RE </ PARVW>

<PARTN> 0001101989 </ PARTN>

RG <PARVW> </ PARVW>

<PARTN> 0001101989 </ PARTN>

<PARVW> BK </ PARVW>

<LIFNR> 0021 </ LIFNR>

I have 6 PARW, I have 4 PARTN and 2 LIFNR.

I get the feeling that when you retrieve the index of parvw containing the constant AG evidently recovered a 2. If we try to recover the 2nd partn, he has the EM. Not if I go far wrong?

former_member184681
Active Contributor
0 Kudos

Dear Arturo,

You wouldn't have to worry about that, if you used the mapWithDefault function right after PARTN, just like in the mapping I mentioned above. Did you try it already?

Regards,

Greg

Former Member
0 Kudos

Hi,

I hope you are having the default context of PARTN and PARVW and then using "MWD " as suggested?

Thanks

Amit Srivastva

iaki_vila
Active Contributor
0 Kudos

Hi Arturo,

Don't worry by your english, mine is worst

At first i dont see your constant "EM", in the mapping that you have showed there are only two: AG and another with an empty value.

May be im confused, but with the "exists" function doesnt depend if the IF/THEN is true or false, it only checks that the node exists, do you really want this?

Regards.

former_member184681
Active Contributor
0 Kudos

Hi,

Try with the following mapping:

Regards,

Greg

Former Member
0 Kudos

Hi,

Use Mapwithdefault after "PARTN" and then check??

Thanks

Amit Srivastava