on 11-08-2008 6:23 PM
Hello sdn
I need a java udf for :
If my source field has any value starting with "6904" then i dont need to create the target sgment.
Thanks
HI
You can achieve this without using UDF as told by Chirag
Do the following and try
E1EDP01:segment
TDID 69045
E1EDP01:segment
TDID 69048
E1EDP01:segment
TDID 98076
E1EDP01:segment
TDI 98764
For all the TDI nodes set same context
Then use substring(0,4) to get
6904
6904
9807
9876
now use the function Equals -> Constant (6904)
Source -> Substring (0,4) -> Equals -> Constant(6904) ->Not -> iFWithoutElse -> splitbyvalue -> Target
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I set the contrext to higher level ,even the queues look OK,when i look at split by value in the end ,but i am not getting the required result (desired result is to split at target segment ). IT would be good if i could see some screenshot.
Source
E1EDP01:segment
TDID 69045
E1EDP01:segment
TDID 69048
E1EDP01:segment
TDID 98076
E1EDP01:segment
TDI 98764
Target
P01:segment
For 3rd P01
P01:segment
For 4th P01
Thanks
Edited by: Guest1 guest on Nov 10, 2008 3:05 AM
Hi
Check the screen shot
http://www.flickr.com/photos/32274480@N06/3017335859/
http://www.flickr.com/photos/32274480@N06/3017335869/
Thanks
Gaurav
Hi
I tried similar logic but in the end as u had mentioned put the splitbyvalue.
I can try without spiltbyvalue tomorrow ,but i had otherwise same logic as yours.
Another thing i noticed is ,try creating a segment on target side instead of the field which you produced.
Eg: Target structure
PO1 : repeating segment
and see if you can get multiple PO1 segments with your logic. Point is to take a value from source segment which is repeating in nature and on target create a target segment by comparing a source field.
Thanks
Edited by: Guest1 guest on Nov 10, 2008 4:22 AM
Hi
I can tell you the source and target structure.
It is a IDOC to file scenario
SOURCE : IDOC
E1EDP01
TDID 690456
E1EDP01
TDID 000012
E1EDP01
TDID 690489
In the above source structure E1EDP01 is an IDOC segment which is repeating in nature and TDID is a field which has the above mentioned values.
TARGET : FILE
P01 : Repeating segment within the target file structure.
P01
Field 1
Field 2
P01
Field 1
Field 2
In the above scenario 2 target segments will be created.
I want 2 target segments by comparing value from a source field. If TDID=6904... then dont create target P01 segment.
Thanks
why do u need java UDF for the same.
u can use the std function,.
input value and constant map it to Equals function and use either create if or ifwithoutelse function.
chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First make all the value in one context so ur input will look like
69045
69048
98076
98764
Now use substring which will give output as
6904
6904
9807
9876
Now give this input to Equals Function as one input and use constant (6904)
This will give either false and true output.
Now give the output of Equals function to Not function and this Not output to Ifwithoutelse function and in then give the input value in one context.
Then use splitbyvalue and map it to target field.
chirag
If its true then
User | Count |
---|---|
81 | |
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.