cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue

Former Member
0 Kudos

Hi all.

I want to map from a XML to an Idoc, and create one segment in the Idoc for each textline in the XML. There can me many Item nodes, and each Item node can have many Texline nodes. I want one Idoc segment for each unike Item, AND segment for each Textline:

XML:

-Header

-Items

-Item#1 [0..n]

-Textline#1 [0..n]

-Textline#2 [0..n]

-Item#2 [0..n]

-Textline#1 [0..n]

-Textline#2 [0..n]

Each Textline should generate one segment in the Idoc:

/PREQCR01/IDOC/E1BPEBANTX segment#1 Item#1

-TEXT_LINE #1

/PREQCR01/IDOC/E1BPEBANTX segment#2 Item#1

-TEXT_LINE #2

/PREQCR01/IDOC/E1BPEBANTX segment#3 Item#2

-TEXT_LINE #1

/PREQCR01/IDOC/E1BPEBANTX segment#4 Item#2

-TEXT_LINE #2

Any suggestions?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey,

<i>>>-Header

-Items

-Item#1 [0..n]

-Textline#1 [0..n]

-Textline#2 [0..n]

-Item#2 [0..n]

-Textline#1 [0..n]

-Textline#2 [0..n]</i>

if this is ur structure then,

in the target structure keep the idoc as 0...ub and map the item node to idoc

and write a small udf with two arguments one a and b for textline1 and textline2 respectively and select the context in udf.

then try with this code

for(int i=0;i<=a.length-1;i++)

{

result.addValue(a<i>);

}

for(int i=0;i<=b.length-1;i++)

{

result.addValue(b<i>);

}

and map the output to segment under idoc which has to be 0...ub.

try this and lemme know if it works out.

regards

jithesh