on 05-17-2010 9:47 AM
Hello Experts,
My requirement is,
Source:
MT_Elemica_Orders_Out
Orders_Create
OrderString length 140
Target:
MT_B2B_DB
Orders_Update 1to Unbounded
TEXTLine length 70
TextFormat
If the length of the source fields is more then 70 characters then I want below output in target structure
Expected:Traget:
MT_B2B_DB
Orders_Update
TEXTLine (first 70 charcters)
TextFormat(* (Constant))
TEXTLine(Remaing characters after 70)
TextFormat(= (constan)).
How can I achieve this????
many thanks,
Jam
There is a Text Function "length" in graphical mapping.
Use it in combination with if....else....
Cheers,
André
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi jam
This is do able very easily using standard functions; below is some outline
1) Use length function & Substring function
so lets say you input que is xyz
xyz -> length -> if -> greater than 70
substring (1, 70) and map that into your first segment
then
substring (70, length) inot second segment
I hope this is helpful
regards,
Hi,
It is very simple, if you are going to get min 70 characters then check the condition mentioned by miamac and use substing.
for second argumnet use substing(70,0),the second argument will hold the remaing string.
checking condition also not required if you are going to get more that 70 characters.
Regards,
Raj
Hi Jam,
Write an UDF
public String subStr(order String, Container container) throws StreamTransformationException
{
String output="";
if (!"".equals(orderString))
{
if (!orderString.lenght()<= 70)
{
output=orderString.subString(0,OrderString.lenght()-70);
}
else
{
output=orderString;
}
}
else
{
output=orderString;
}
return output;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
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.