cancel
Showing results for 
Search instead for 
Did you mean: 

Delete leading zeroes

Former Member
0 Kudos

Hello,

Does anyone know how to delete leading zeroes in a mapping ?

I don't think there is a standard function for this, or am I wrong ?

Regards,

Marco

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi Marco,

create a simple function that will use the code below:

String stringWithZeros = "0000123490";

String stringWithoutZeros = stringWithZeros.replaceFirst("^0+", "");

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

Former Member
0 Kudos

Hi Marco,

If it is a numeric filed then try converting it to integer to avoid leading zeors.

int Seq = Integer.parseInt(sourcevalue)

Regards

Anand

Former Member
0 Kudos

Thanks,

this solved my problem

Marco

Former Member
0 Kudos

Hi anand,

I am doing lsmw conversion for mm01. The problem is when i am converting 18 char matnr, it is carry 6 more characters for matnr. I tried to use conversion function module. Again it is showing 24 matnr. How can we restrict leading zeros right side of the matnr? I tried to use SHIFT right deleting trailing spaces..but again showing same error... how can i restrict the zeros?

Thanks and Regards,

Partha SArathi

Answers (0)