cancel
Showing results for 
Search instead for 
Did you mean: 

Leading Zeros Supression

Former Member
0 Kudos
417

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?

View Entire Topic
Former Member
0 Kudos

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

Former Member
0 Kudos

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