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 zeros to alphanumeric string

Former Member
0 Likes
1,376

Hello all ,

Does anybody know any function module to put leading zeros to an alphanumeric sequence (18 characters)?

Example : 12wer should be '000000000000012wer'

CONVERSION_EXIT_ALPHA_INPUT only works with numbers.

Thanks in advance ,

Snehal

Hello all ,

Does anybody know any function module to put leading zeros to an alphanumeric sequence (18 characters)?

Example : 12wer should be '000000000000012wer'

CONVERSION_EXIT_ALPHA_INPUT only works with numbers.

Thanks in advance ,

Snehal

4 REPLIES 4
Read only

Former Member
0 Likes
1,033

HI,

Check the fm:

CONVERSION_EXIT_MATN1_INPUT

Regards,

ravi

Read only

Former Member
0 Likes
1,033

U can use the below code.

data : lcons(18) type c value '000000000000000000',

lstring(36) type c.

==>lval is your value.

concatenate lcons lval to lstring.

write lstring(18) to lval.

Read only

Clemenss
Active Contributor
0 Likes
1,033

Hi Snehal,

<pre>

shift [field] right deleting trailing ' '.

replace ' ' in [field] with '0'.

</pre>

OK?

Regards,

Clemens

Read only

Former Member
0 Likes
1,033

thanks it worked beautifully !