Skip to Content
0
Former Member
Jun 30, 2009 at 02:04 AM

FILE to IDOC using node functions; IDOC parent, child segment

60 Views

I have file with 10 recors.

Each record has f1,f2 (two fields)

The target IDOC segments are

E1PARENT1 occurance 0 to 99

E1PARENT1-field_p1

E1PARENT1-E1CHILD1 occurance 0 to 5

E1PARENT1-E1CHILD1-field_c1

I have to map

FILE field1 to E1PARENT1-field_p1

and

FILE field2 to E1PARENT1-E1CHILD1-field_c1

I tried

RemoveContext -> SplitByValue(value change) -> CollapseContext ->E1PARENT1

RemoveContext -> SplitByValue(value change) -> CollapseContext ->E1PARENT1-E1CHILD1

With above i'm getting output

a) parent IDOC segment E1PARENT1 repeated 10 times (source FILE got 10 records) .. .This is correct

b) The first parent segment E1PARENT1 got 5 child segments E1CHILD1. -- this is incorrect

c) The second parent segment E1PARENT1 has NO child segments E1CHILD1 -- this is incorrect

I want

first parent segment E1PARENT1 to have 1 child segment E1CHILD1 having 1st record field2 of input FILE

2nd parent segment E1PARENT1 to have 1 child segment E1CHILD1 having 2nd record field2 of input FILE

3rd parent segment E1PARENT1 to have 1 child segment E1CHILD1 having 3rd record field2 of input FILE

I think by changing occurance (ECC value is 0 to 5) of child IDOC segment E1PARENT1-E1CHILD1 to 1 could solve this issue. (I tried to change the text file, but it is no confusing where to change using Notepad). Basically i don't know how to control the queue context of CHILD segment of IDOC matching with PARENT segment of the IDOC.

Any better alternative. Please help. Thanks