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

Former Member
0 Likes
1,006

hi

i want leading zero in my kunnr field

for exp. if user enter 324 it should be like 0000000324.

pls help me on this

is there any function module...

points will be rewarded..

regards

rajan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
980

Hi,

Try this FM

CONVERSION_EXIT_ALPHA_INPUT

converts any number into a string fill with zeroes, with the number at the extreme right

Regards

Sandipan

7 REPLIES 7
Read only

Former Member
0 Likes
980

Use FM :

CONVERSION_EXIT_ALPHA_INPUT

Read only

former_member187255
Active Contributor
0 Likes
980

Rajan,

Use the FM CONVERSION_EXIT_ALPHA_INPUT

Chandra.

Read only

Former Member
0 Likes
981

Hi,

Try this FM

CONVERSION_EXIT_ALPHA_INPUT

converts any number into a string fill with zeroes, with the number at the extreme right

Regards

Sandipan

Read only

Former Member
0 Likes
980

data : gv_kunnr type kunnr.

gv_kunnr = '1000'.

call this FM CONVERSION_EXIT_ALPHA_INPUT and pass the parameter gv_kunnr as IMPORT as well as EXPORT.

In the export parameter u will get the result in the format which u want. i.e. 0000001000. The number of leading zeros depends upn the length of variable GV_KUNNR.

Regards,

Sagar

Read only

Former Member
0 Likes
980

Hi,

You can use as following.

data: cno(10) value '324'.

DATA: LEAD(10) VALUE '0000000000'.

SHIFT CNO RIGHT DELETING TRAILING SPACE.

OVERLAY CNO WITH LEAD.

WRITE:/ CNO.

Regards,

Chandu

Read only

Former Member
0 Likes
980

Create the variable with the data type N instead of C.

or

make use of below FM

CONVERSION_EXIT_ALPHA_INPUT

reward if useful..................

Read only

Former Member
0 Likes
980

hi rajan,

u can use function module CONVERSION_EXIT_ALPHA_INPUT

but the size of the kunnr field should be 10 as this function module fills the zero for the total points

reward points if use ful

thanks,

swaroop