cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping: Values are populating in wrong order into the target structure

former_member257758
Participant
0 Kudos

Hello Guru's

I am doing the scenario IDOC to XML. During the mapping values are not populating in the same order in which I have defined the target structure. I am mapping different fields from different segments to different hierarchical structure fields in target. Pls see the below screens shot for more explanation.

But the output is in different order. Here is result XML.

<ShptCtryFinalDest>MO</ShptCtryFinalDest>

- <Invoice>

- <InvoiceFreightAndOtherCharges>

<ChargeCode>INV</ChargeCode>

<FromCurrCode>USD</FromCurrCode>

</InvoiceFreightAndOtherCharges>

</Invoice>

- <Invoice>

<InvoiceNo>1000019790</InvoiceNo>

<InvoiceDate>20130215</InvoiceDate>

</Invoice>

+ <Item
As per the definition InvoiceNo and InvoiceDate should come first under <Invoice> Node and then <InvoiceFreightAndOtherCharges>. Can you pls suggest how to do it.
Thanks
Arun

Accepted Solutions (0)

Answers (2)

Answers (2)

nabendu_sen
Active Contributor
0 Kudos

Hi Arun,

Just make false changes to DT and MT and activate. Also check the cache status, then see if anything changes. Usually it should not happen.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Arun,

                 If we consider the first invoice segment

<Invoice> 

-      <InvoiceFreightAndOtherCharges> 

     <ChargeCode>INV</ChargeCode> 

     <FromCurrCode>USD</FromCurrCode> 

</InvoiceFreightAndOtherCharges>

we see

<InvoiceFreightAndOtherCharges> segment is present. In invoice segment min occurence of invoice number and invoice Date is zero. Thus if invoice number and invoice Date do not arrive in target mapping will not produce error and instead show the next element which is InvoiceFreightAndOtherCharges.  In the following segment of invoice

-  <Invoice> 

   <InvoiceNo>1000019790</InvoiceNo> 

 

      <InvoiceDate>20130215</InvoiceDate> 

</Invoice>

InvoiceFreightAndOtherCharges element is absent as its min occurrence has been set to zero.

In the context queue InvoiceFreightAndOtherCharges do not appear in the source side thus you can't see it in target.

The context of source element is also maintained in target side unless you use "remove context".

I am not sure if there is any other problems in the mapping as you have not given screen shot of how you mapped the fields from source to target. Please wait for experts to respond to this thread.

Regards

Anupam