Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

taking leading zeros off

Former Member
0 Kudos
100

hi folks,

I need help in the abap code here.

data char type c.

char = '0000000550'.

I need to take the leading zeros away (remember it is in the character format)

how can I do that?

thanks

Santhosh

1 ACCEPTED SOLUTION

Former Member
0 Kudos
75

Hi santhosh

>data char type c.

>char = '0000000550'.

write char to char USING EDIT MASK '==ALPHA' .

this will remove leading zeros.

Regds

Jeevi

4 REPLIES 4

Former Member
0 Kudos
75

Hi Santhosh;

Try:

shift char left deleting leading '0'.

Cheers,

John

Former Member
0 Kudos
76

Hi santhosh

>data char type c.

>char = '0000000550'.

write char to char USING EDIT MASK '==ALPHA' .

this will remove leading zeros.

Regds

Jeevi

hari_padivetu
Discoverer
0 Kudos
75

Hi Santhosh,

Try this.

data char(20) type c.

char = '0000000550'.

write:/ char no-zero.

Former Member
0 Kudos
75

silly question.

There are n ways to do this.

anyway oneway is like this

report zemm2466a.

data: char(20) type c,

in_num type i.

char = '0000000550'.

move char to in_num.

Regards,

Ismail