cancel
Showing results for 
Search instead for 
Did you mean: 

Suggest Mapping : Idoc2File

Former Member
0 Kudos

Hi Experts,

I am using (INVOIC )Idoc to file scenario. As per requirement I have mapped segment EIEDP01 to target structure RECORD. Because all (5) fields comes under this segment . But only one field Invoice_No falls in different segment i.e E1EDK01

If I excecute present mapping it is showing below output.

But I want is Invoice _No should be appear in 2nd target structure as well.

<?xml version="1.0" encoding="UTF-8" ?>

- <ns0:MT_INVOICE_FILE xmlns:ns0="http://tempuri.org">

- <RECORD>

<Invoice_No>1091902118</Invoice_No>

<Name> POWER TECH</Name>

<Item_No>000001</Item_No>

<Plant>PG01</Plant>

<Quantity>150.000</Quantity>

<Item_Code>G1</Item_Code>

</RECORD>

- <RECORD>

<Name>POWER TECH</Name>

<Item_No>000002</Item_No>

<Plant>PG01</Plant>

<Quantity>95.000</Quantity>

<Item_Code>F1103A050150</Item_Code>

</RECORD>

</ns0:MT_INVOICE_FILE>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

There is one more simple solution. Rather using UseOneAsMany you can also use CopyValue(0). You can find CopyValue under Constants node. Your mapping will be like this...

Invoice_No>CopyValue(0)>Invoice_No.

Former Member
0 Kudos

Hi All,

Thanks a lot ! Copy by Value function worked for Me .

Answers (4)

Answers (4)

Former Member
0 Kudos

Try this mapping:

BELNR -


E1EDP01--


useOneAsMany---- Invoice_No (BELNR)

E1EDP01 -


In the mapping, right click on function useOneAsMany and check the 'Dispaly Queue' option.

If any error is there (especially, the length of the queues in case of useOneAsMany), then it wil be displayed.

If the issue is there, change the context of second argument (assign it to next higher level) and try again.

-Supriya.

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

you can use also copyValue standar function, by this way you can reuse that value many times.

if that solution does not apply go later for useOneAsMany

Former Member
0 Kudos

Hi,

Use "useOneAsMany" function.

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

Thanks

Amit

Former Member
0 Kudos

Hi Anshul,

Is the Segment E1EDK01 with field Invoice_No is repeating as many no of times as the segment EIEDP01?

If yes, then it is just one to one mapping.

But if not, then you have to use 'useOneAsMany' node function and have to repeat the filed Invoice_No based on the segment EIEDP01.

-Supriya.

Former Member
0 Kudos

Thanks for inputs.Yes, I need field Invoice_No should be repeat no of times as the segment EIEDP01

I used u201CUse one as Manyu201D function and as there are 3 (Invoice_No=BELNR) in Sender Idoc side.

I mapped E1EDK01 ->BELNR in Idoc context |

Mapped E1EDP02 -> BELNR with Idoc context | ---> Invoice_No (BELNR)

E1EDK02- > BELNR with 3rd context |

But it is not creating Target, showing below error:-

Runtime exception when processing target-fieldmapping /ns0:MT_INVOICE_FILE/RECORD/Invoice_No; r~</SAP:Stack>

Where I am wrong ?

Former Member
0 Kudos

Hi,

BELNR(under E1EDK01 as 1st arg)----


E1EDP01(node as 2 arg)--


useOneAsMany---- Invoice_No (BELNR)

map any filed under segment E1EDP01(as 3 arg)----


Thanks

Amit