cancel
Showing results for 
Search instead for 
Did you mean: 

deleting zeros

Former Member
0 Kudos

Hi,

I need to remove both leading and zeros after the actual digit. 00100 should be 1.

I don't want to use UDF. is there any standard functions for this?

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

use replaceString function (if u want to delete both leading and trailing zeros)

Former Member
0 Kudos

Hi, Thanks for answers!

I solved it by using ReplaceString. in the first parameter I used the incoming data, 2nd parameter I put Constant '0' (the value I want to remove), and 3rd parameter I put in Constant 'blank' (the value I want to replace the '0' with.)

Thanks!

Answers (1)

Answers (1)

Former Member
0 Kudos

You can use replaceValue function, and replace 0 with ''.

Here you can find the complete function list:

http://help.sap.com/saphelp_erp2004/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.ht

Former Member
0 Kudos

Hello,

But replaceValue("0","") would transform "10001" into "11" ? You could use the replaceFirst(String regex,String replacement) method from the String class ...

Rgds

Chris

Former Member
0 Kudos

The ReplaceValue function only has one input parameter. So you can only replace the input parameter with a constant value. whereas the replace string you can define which value in the input parameter you want to replace.

Regards