on 11-08-2007 3:09 PM
Hi Experts,
How to padding the zeroes and space befoer sending any data from XI to R3 during mapping, how to write a java code to implement this logic, please help me with the coding or any other alternative.
thanks
dhanush
Dhanush,
Your question is not very clear....you want to know how to pad the fields...during mapping...and then how to write java code..?
1) are you doing java mapping ..if so do you have a custom function...if you do then it should be pretty straight...
formatnum actually only does whats in the properties and works like java.text.decimalFormat..
what you can do is use the subString..and replace the last value with a new value that is actually the value + space....to pad..
Let me know if it doesent help..
Regards
Ravi.Raman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use FORMATNUM standard function
Thanx
Aamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
to pad spaces you need to write a simple UDF
for right padding use the following
while( inputField.length() < Integer.parseInt(totalLength))
{
inputField = inputField + " ";
}
return inputField;
for left padding use the following
while( inputField.length() < Integer.parseInt(totalLength))
{
inputField = " " + inputField ;
}
return inputField;
Note:in the above examples <i>inputField</i> will be the input to UDF i.e. the sender field which you need to pad and send to receiver , and <i>totalLength</i> will be a constant i.e length of the field you want on receiver side after padding.
also i m not a Java expert so please check for syntax and semantics for code:) to me it looks correct
Thanx
Aamir
Message was edited by:
Aamir Suhail
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
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.