Application Development and Automation 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: 
Read only

Leading zero problem!

Former Member
0 Likes
818

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
Read only

Former Member
0 Likes
783

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.

Read only

Former Member
0 Likes
783

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

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
783

Hi,

Use translate.

data c1(6) value '000567'.

data i1 type i.

translate c1 using ' 567'.

i1 = strlen( c1 ).

write c1.

write i1.

Read only

Former Member
0 Likes
783

hi mirza,

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

Regards,

Kunjal

Read only

VikasB
Active Participant
0 Likes
783

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

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
783

var = '00028'.

write var using edit mask '==ALPHA'.