cancel
Showing results for 
Search instead for 
Did you mean: 

IDoc segment issue

Former Member
0 Kudos

Hi,

I have file to Idoc scenario, where my input file structure like below and need to create Idoc segments in SAP.

Input Structure:

Record (1--Unbounded)

Header (1-1)

Item_Details (1- Unbounded)

Child_ItemsInfo (1 -Unbounded)

Item_1 (1--1)

abc

def

Item_2 (1--1)

abc

def

Item_3 (1--1)

abc

def

Now..I need to generate an Idoc segment "Z1ABCD", as many as child Item segments(Item_1,Item_2,Item_3) occurs in my input structure. I have used duplicate subtree on Idoc segment "Z1ABCD" and copied 2 more times.Now I have 3 "Z1ABCD" segments in my IDoc.

Lets say, if my input structure have 2 Child_ItemsInfo, then I need to generate 6 "Z1ABCD" segments in Idoc. I'm able generate these segments.

My code generating all the Item_1 segments then Item_2 segments like that...But I'm expecting a "Z1ABCD" segment at Item_details node level...like Item1,2,3 and then Item1,2,3....Please help me out!

Note: My mapping looks like this;

Item_1 ->remove context>Split by value(each) ->CollapseContext->Z1ABCD

Item_2 ->remove context>Split by value(each) ->CollapseContext->Z1ABCD

Item_3 ->remove context>Split by value(each) ->CollapseContext->Z1ABCD

the target structure which I'm lookin for like below...(for 2 Child_ItemsInfo from my input structure)

1.Z1ABCD (Item_1 info)

2.Z1ABCD (Item_2 info)

3.Z1ABCD (Item_3 info)

4.Z1ABCD (Item_1 info)

5.Z1ABCD (Item_2 info)

6.Z1ABCD (Item_3 info)

But my code generating the segments like below;

1.Z1ABCD (Item_1 info)

2.Z1ABCD (Item_1 info)

3.Z1ABCD (Item_2 info)

4.Z1ABCD (Item_2 info)

5.Z1ABCD (Item_3 info)

6.Z1ABCD (Item_3 info)

Esha

Edited by: esha nadh on Mar 9, 2011 9:14 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Repeat the target segment (Z1ABCD) for 2 times and Map the Items segment node to first Z1ABCD segment and map the same items segment to Z1ABCD node again.

In the first Z1ABCD node first field map only item segment in first field.

In the second Z1ABCD node 2nd field map only item segment in second field.

Ex:

Sender Side I assume item_1, item_2,... are in Item_Details (1- Unbounded) node, and Item_1 in fields are say A and B.

Now the map is

Item_details -


> Z1ABCD (original node)

A---> Z1ABCD node in first field

Item_details -


> Z1ABCD (repeated node)

B---> Z1ABCD node in second field

Then you will get the required ouput.

Regards

Ramesh

Former Member
0 Kudos

I am bit confused .

Why are you using this ...

remove context-->Split by value(each) --->CollapseContext

Do Direct assignment like below

even the context should not change . it shoule be default .,

Item_1 - > Z1ABCD

Item_2 - > Z1ABCD

Item_3 - > Z1ABCD

isnt it working fine ??????

actually it should ..

In your case .

IZ1ABCD for Item_1 coming together because . you Used removeContext So Both Item_1 comest together .. and then you doing transformation .. so the result are coming together...

Try Like Direct assignment . I hoping it should work fine

regds

PS