on 04-13-2011 5:31 AM
Hi,
I have an idoc to file scenario:
Idoc looks like this
Idoc
Header
E1BPE1WLMV (0.....999)
field1
E1BPE1MALG (0.....999)
field2
Target
Details
field3
My requirement is that :
field 3 should b mapped to only the first occurence of field1. (and not the subsequent occurences).
Please suggest how can i proceed ?
Thanks guys...but I have got some more inputs for my requirement now:
Source:
Idoc
Header
E1BPE1WLMV (0.....999)
field1
E1BPE1MALG (0.....999)
field2
Target:
Details
field3 (= field1)
field4 (=field2)
The Details should be created for unique combination of field1 and field 2. For e.g.
Field 1 comes 2,3,4
Field 2 comes 1,5
Then detail should be created 6 times for
field1= 2 & field2= 1
field1= 2 & field2= 5
field1= 3 & field2= 1
field1= 3 & field2= 5
field1= 4 & field2= 1
field1= 4 & field2= 5
Could you please help ?
Edited by: jayagupta21 on Apr 14, 2011 7:24 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U have to write an UDF for the same. It will be very easy to implement the logic by writing an UDF.
Need to Create an UDF of type All values of Queue.
Have four arguements as follows:
field1-> removeContext() -> UDF arguement1
field2-> removeContext() -> UDF arguement2
field1 -> count -> removeContext -> UDF arguement3
field2 -> count -> removeContext -> UDF arguement4
Inside UDF,
int counter1 = var3.length; // gives the number of field1 items in the incoming Idoc
int counter2 = var4.length; // gives the number of field2 items in the incoming Idoc
Use a for loop and apply ur logic.
The values get stored in the form of arrays and you need to check them and apply your logic.
Cheers,
Souvik
Hello,
Use copyValue to achieve your requirement
field1 -> copyValue:0 -> field3
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use Field 1--> Remove context --> Collapse Context --> Field 3.
If this doesnt solve your issue, please provide source payload & required target payload.
-Gouri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.