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

padding with 0

Former Member
0 Likes
1,389

hi ,

I am usnig a field LIFNR (vendor) in my ITAB.

ITs length is 10. But my data values are of 6 or 7 digi.

when i pass these values to a FM , ouput comes only when 0 are padded.

Please tell appropriate code.

i am using concatenate '000' itab-lifnr into itab-lifnr.

but as length of lifnr may be 6 , 7 or may be anything then this wont work.

i m sure some better method is there.

plz help/

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,280

use UNPACK comand

BR , JAcek

9 REPLIES 9
Read only

Former Member
0 Likes
1,280

Use the conversion exit:

CONVERSION_EXIT_ALPHA_INPUT

U can find this in the domain....

-Aarthi.

Read only

Former Member
0 Likes
1,281

use UNPACK comand

BR , JAcek

Read only

Former Member
0 Likes
1,280

you should use function module : CONVERSION_EXIT_ALPHA_INPUT and pass this vendor number as import and export parameter.

Read only

Former Member
0 Likes
1,280

data: gv_lifnr(10) type n.

loop at itab.

gv_lifnr = itab-lifnr.

pass this (gv_lifnr.)...

endloop

Read only

Former Member
0 Likes
1,280

Hi sharadha,

1. we can use the FM

CONVERSION_EXIT_ALPHA_INPUT

2. It will pad zeroes to the left,

automatically,

based upon the field length, and data in it.

regards,

amit m.

Read only

Former Member
0 Likes
1,280

Hi,

Use conversion exit...CONVERSION_EXIT_ALPHA_INPUT

Sreedhar

Read only

Former Member
0 Likes
1,280

You will have to use a conversion exit. Look at the data element level if there is a separated CONVERSION EXIT for LIFNR field. If not you can use CONVERSION_EXIT_ALPHA_INPUT. Pass the vendor no. you have and the output will have the padded zeroes.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

Former Member
0 Likes
1,280

Hi

Use These FM

CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal

CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external

Rgds,

Prakash

Read only

dani_mn
Active Contributor
0 Likes
1,280

HI,

data: len type i.

len = strlen(itab-lifnr).

len = 10 - len.

OD len times.

concatenate '0' itab-lifnr into itab-lifnr.

ENDDO.

Regards,

Wasim Ahmed