cancel
Showing results for 
Search instead for 
Did you mean: 

How to padding the zeroes and space befoer sending from XI to R3 system.

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

ravi_raman2
Active Contributor
0 Kudos

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

Former Member
0 Kudos

use FORMATNUM standard function

Thanx

Aamir

Former Member
0 Kudos

Aamir ,

How can i pad the spaces in case of sting. plz let me know.

thanks

dhanush

Former Member
0 Kudos

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