on 06-30-2009 3:04 AM
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
Hi Ravi.
I reviewed your question and is not necesary to use UDF.. Split by Value,Collapse Context, Remove Context.
Only map your field by field.. like this. It's symply.
.../E1PARENT1/field_p1 = /File/F1
.../E1PARENT1/E1CHILD1 = /Field/F2
.../E1PARENT1/E1CHILD_field_c1 = /Field/F2
Edited by: Luis Ortiz on Jun 30, 2009 2:51 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the IDOC target
E1PARENT1 (o to 99 occurance)
E1PARENT1-field_p1
E1PARENT1-E1CHILD1 (0 to 5 occurance)
E1PARENT1-E1CHILD1-field_c1
I resolved using standard function of message mapping. The mistake was SplitByvalue(value change), when changed to SplitByvalue(each value) got desired result. Here is the mapping to benefit others. Please correct or add if any, thanks.
a) Target - Parent segment
SOURCE-RECS->RemoveContext -> E1PARENT1
SOURCE-RECS-F1->RemoveContext -> E1PARENT1-field_p1
b) Target - Child segment
SOURCE-RECS->RemoveContext -> SplitByValue(each value) -> E1PARENT1-E1CHILD1
SOURCE-RECS-F1->RemoveContext -> SplitByValue(each value) -> E1PARENT1-E1CHILD1-field_c1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.