cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping from nested to one table (sales order) XML to IDOC

Former Member
0 Kudos

Hello,

I have to map a xml file to the IDOC SALESORDER_CREATEFROMDAT2.SALESORDER_CREATEFROMDAT202.

How I can map the the longtext from the XML file to the IDOC struktur.

Part of the XML file, there could be n times BPosition with n times longtext. The longtext must be map with a table. I some case its a mapping from nested to mornal table.

<BPosition>

<lpos>1</lpos>

<bbl_sap_nr/>

<milvonr/>

<kurztitel/>

<anzbest/>

<anzliefer/>

<kostenpflichtig/>

<longtext>

<line>pos1 zeile1</line>

<line>pos1 zeile 2</line>

</longtext>

</BPosition>

thanks for your help.

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos
there could be n times BPosition

Do you wnat to have multiple (n) IDOCS for n BPositions? If yes then you can follow the method called IDOC Bundling. If no, then may be some more details about the requirement will be required.

with n times longtext. The longtext must be map with a table

The target field (in the IDOC) should also be repeating and then it will be a direct mapping between the source and target nodes with proper Context Handling.

I some case its a mapping from nested to mornal table.

Does it mean that you may have only one occurence of BPosition and/ or LongText? I dont think any other change is required for this....however if there will be a field (based on whose value) the target needs to be generated , the the same has to be implemented in the maping.

Regards,

Abhishek.

Former Member
0 Kudos

Hi, I have to map this 1 XML to 1 IDOC

XML:

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

<ns0:MT_Milver xmlns:ns0="http://ccssap.bfi.admin.ch/milver">

<bestellung>

<besteller>

<bestellnr/>

<auftragdefit/>

<wempfdebit/>

<bestelldat/>

<lieferdat/>

<anzpos/>

<language/>

<adrzeile1/>

<adrzeile2/>

<adrzeile3/>

<adrzeile4/>

</besteller>

<Kopf>

<Lkopf>Kopf1 zeile1</Lkopf>

<Lkopf>Kopf1 zeile2</Lkopf>

</Kopf>

<BPosition>

<lpos>1</lpos>

<matnr/>

<milvonr/>

<kurztitel/>

<anzbest/>

<anzliefer/>

<kostenpflichtig/>

<bemerkung>

<line>pos1 zeile1</line>

<line>pos1 zeile 2</line>

</bemerkung>

</BPosition>

<BPosition>

<lpos>2</lpos>

<matnr/>

<milvonr/>

<kurztitel/>

<anzbest/>

<anzliefer/>

<kostenpflichtig/>

<bemerkung>

<line>pos2 zeile1</line>

<line>pos2 zeile 2</line>

</bemerkung>

</BPosition>

</bestellung>

</ns0:MT_Milver>

IDOC:

The Idoc have a segment for the longtext (table).I have to map, lpos, line into E1BPSDTEXT from SALESORDER_CREATEFROMDAT2. Its now more clear?

stefan_grube
Active Contributor
0 Kudos

line - removeContexts - E1BPSDTEXT

line - splitByValue(each value) - TEXT_LINE

1. lpos 2. line 3. line - splitByValue(each value) -> useOneAsMany - > ITM_NUMBER

Former Member
0 Kudos

Thank you very much! But I have to change the order like this?

1. lpos 2. line 3. line - useOneAsMany - > splitByValue(each value) -> ITM_NUMBER

And its possible to do this only if line isnt an empty string?

stefan_grube
Active Contributor
0 Kudos

> Thank you very much! But I have to change the order like this?

> 1. lpos 2. line 3. line - useOneAsMany - > splitByValue(each value) -> ITM_NUMBER

You can do this also. The result should be the same

> And its possible to do this only if line isnt an empty string?

In that case do this:

1. line 2. contant("") -> EqualS -> not -> createIf -> removeContexts - E1BPSDTEXT

Answers (1)

Answers (1)

Former Member
0 Kudos

My function:

1. lpos 2. line 3. line - splitByValue(each value) -> useOneAsMany - > ITM_NUMBER

Problem with useOneAsMany funktion Error:

To Many Value in the first queue in the function usaOneAsMany- it must be the same number of context in both queue.

lpos is the position number and line the position text, now the position text is not obligatoy, so the <attribut> line don't exist in the xml.this causes the error, its possible to put a default empty line or how i can handel this error.

thanks

Edited by: Ofer Fritz on Jul 26, 2010 10:13 AM