on 2006 Oct 12 4:44 PM
How Can I supress Leding zeroes into target Structure?. Iam getting 10 digits filled zeros left justified and my target systems doesn't need zeros. Is there Standard function in Mapping I can use?
Ram,
Create a user defined funciton <i><b>zerosuppress</b></i> and take the <i><b>cache</b></i> as value and take one argument <i><b>input</b></i>. Then put the code below:
//write your code here
String output = input.replaceFirst("^0+","");
return output;
It will remove all your leading zeros. Let me know whether your issue is resolved or not?
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Satish - Your code is not working . It gives following errors:
E:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map1af8bf955eb611dba72f0014220cd5e0/source/com/sap/xi/tf/_testmapping_.java:83: cannot resolve symbol symbol : variable input location: class com.sap.xi.tf._testmapping_ String output = input.replaceFirst("^0+",""); ^ 1 error
Just use standard FormatNum function.
- If you want to use a fixed length of n digits, use 0000..00 (n 0's) as input parameter of the function;
- If you wantg to remove left zeros of a field, use ####...# (n #'s) where n is the maximum length of the field.
Regards,
Henrique.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
With th ehelp of Substring standard function you can achieve that, if you know the exact number or length.
Elese it is prefer to write a Java User Defined function to achieve the same.
Just check with <i>FormatNum</i> inbuilt functions.
This thread discusses about padding zeros, instead of this, you need to substring it..
Regards,
Moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There is a user defined function in Mikall guide that does this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.