on 07-23-2009 4:59 AM
Hello All:
I tried this scenario using node function but not getting desired output in FILE.
This is IDOC to FILE scenario.
IDOC has segments and value of fields as below:
E1_ITEM (1)
E1_ITEM-key_field=KEY1
E1_ITEM-E1_CHILD (1st occurance)
E1_ITEM-E1_CHILD-f1=100
E1_ITEM-E1_CHILD-f2=x
E1_ITEM-E1_CHILD (2)
E1_ITEM-E1_CHILD-f1=100
E1_ITEM-E1_CHILD-f2=y
-
context change E1_ITEM
E1_ITEM (2)
E1_ITEM-key_field=KEY2
E1_ITEM-E1_CHILD (1)
E1_ITEM-E1_CHILD-f1=200 (Note: VALUE OF E1_CHILD-f2 is not there, that makes the result distorted)
-
context change E1_ITEM
E1_ITEM (3)
E1_ITEM-key_field=KEY3
E1_ITEM-E1_CHILD (1)
E1_ITEM-E1_CHILD-f1=100
E1_ITEM-E1_CHILD-f2=z
REQUIRED FILE output:- ( 2 fields, Please suggest how to get this result)
KEY1,x
KEY2,blank
KEY3,z
Logic:
1) Number of records in file equals number of E1_ITEM occurance.There are 3 E1_ITEM segments so 3 records in FILE
2) 1st field in flat file = E1_ITEM-key_field
3) 2nd field in flat file =
a) Read all E1_CHILD segments under E1_ITEM for that specific E1_ITEM context where E1_CHILD-f1 = 100
b) Read E1_CHILD-f2 for that E1_ITEM context (AFTER applying condition 'a' above)
For 1st E1_ITEM context E1_CHILD-f2=x and y. Pick first f2 value which is x
For 2nd E2_ITEM context there are no values as E1_CHILD-f1 NOT equals 100 (here value is 200)
For 3rd E2_ITEM context E1_CHILD-f2=z.
I tried graphical mapping using node function, but getting result in FILE as:
KEY1,x
KEY2,z
KEY3,
I tried increasing the context of E1_CHILD-f1, E1_CHILD-f2 to E1_ITEM that did not help.
Please provide pointers. Help much appreciated.
Hi,
Did you try using mapWithDefault under node functions?
E1_ITEM-E1_CHILD-f2 --> mapWithDefault --> targetnode
Please let me know if this works,
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.