on 08-04-2008 12:32 PM
Hi,
I have a file to IDOC scenario where the incoming XML strcuture contains the following data:
<EmployeeMasterData>
<Header> .....</Header>
<Body> ...
<Employee_Business_Unit>BU400199</Employee_Business_Unit>
<National_Insurance_Number>TN216600D</National_Insurance_Number>
......
</Body>
<Trailer>
<Identifier>FTR</Identifier>
<Number_Of_Records>1124</Number_Of_Records>
<Blank_Entry />
</Trailer>
</EmployeeMasterData>
The data in the National_Insurance_Number tag should be checked as follows:
If the first 2 characters in this tag contain 'TN' like above, the value moved to the target IDOC segment-field should be ' ' else, the value should be moved as it is.
I need to define a User defined function for this.
Can you please help me how to do this?
Regards,
Archana
Use SubString(0,2) in Standard Function .
compare it with "TN"... if equals assign " " else tat Value
no need to use UDF..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
U can also use standard functions as follows
1)Use if else boolean function
2)National_Insurance_No>substring(0,2)>equalsS>constant (TN)>then-->map constant(' ') to tgt.
3) else path map src to tgt as such
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check with this UDF
public String CHECK(String a,Container container)
{
String b = a.substring(0,2);
String c;
if(b.equals("TN"))
c = "' '";
else
c = a;
return c;
}
Edited by: malini balasubramaniam on Aug 4, 2008 1:53 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can do it with standard functions.
If_1 source -> length -> greater -> constant 2
then_1 if_2 substring source 0, 2 -> equals TN
then_2 -> constant ""
else_2 -> source
else_1 source
Regards
Patrick
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 | |
24 | |
11 | |
9 | |
7 | |
6 | |
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.