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: 

Leading zero problem!

Former Member
0 Kudos

Hi everybody!

My requirement is that i want a field with fixed length so that if i delete leading zero by using shift or conversion exit the length should not vary(no should not move left).

i.e if the field value is '000567' then i need the output as ' 567', zero's to be replaced by blank characters.

pls help.

Regards,

Parwez.

6 REPLIES 6

Former Member
0 Kudos

HI,

SHIFT var LEFT DELETING LEADING '0'.

<b>example:</b>

data:var(5) value '00123'.

write:/ var.

SHIFT var LEFT DELETING LEADING '0'.

write:/ var.

rgds,

bharat.

Former Member
0 Kudos

SHIFT <variable> LEFT DELETING LEADING '0'.

or

use this function module

<b>CONVERSION_EXIT_ALPHA_OUTPUT</b> converts any number with zeroes right into a simple integer

Example:

input = 00000000000123

output = 123

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Use translate.

data c1(6) value '000567'.

data i1 type i.

translate c1 using ' 567'.

i1 = strlen( c1 ).

write c1.

write i1.

Former Member
0 Kudos

hi mirza,

you can use TRANSLATE, WRITE, SHIFT commands to perform required operation.........

Regards,

Kunjal

VB09104
Active Participant
0 Kudos

Hi Mirza,

Use FM 'CONVERSION_EXIT_ALPHA_OUTPUT'

for eg.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

input = <varb>

IMPORTING

OUTPUT = <varb> .

hope this helps.

regards,

vikas.

plz reward if useful

kesavadas_thekkillath
Active Contributor
0 Kudos

var = '00028'.

write var using edit mask '==ALPHA'.