on 06-27-2011 10:10 PM
I have a incoming field account number which is 10 integers into PI . I need to add leading zeros to it if the length is less than 10 integers.
Can you please let me know which function to use? I tried format fucntion but obviously that does not work.
Thanks,
Hari
FormatNumber should work.
Can you explain what have you done?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You just need to add the text function trim so that the leading and trailing spaces are eliminated. The adjusted mapping will look like this:
HKONT ---> trim ---> FORMATNUM 0000000000 -------> HKONT
Hope this helps,
Mark
Hi Hari
you can use a simple UDF.
String output;
if(input.length()<10)
{
output="0";
for(int i=1;i<10-input.length();i++)
{
output=output+"0";
}
output=output+input;
}
return output;
Or you can use FormatNum standard function.
here in format pattern you need to put ten zeros.
Edited by: SAP_PI_D on Jun 27, 2011 11:22 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
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.