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

add leading zero

Former Member
0 Likes
1,512

hi im trying to add leading zeros in vendor number

im using the fm 'CONVERSION_EXIT_ALPHA_INPUT', its not working

anybody knows how else i can do that

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,446

Well, I made this example, adapt it to suit your needs.

DATA: vendor(10) TYPE c VALUE '452'.

START-OF-SELECTION.

  SHIFT vendor CIRCULAR RIGHT.
  WHILE vendor(1) = space.
    SHIFT vendor CIRCULAR RIGHT.
  ENDWHILE.
  SHIFT vendor CIRCULAR LEFT.
  OVERLAY vendor WITH '0000000000'.
  WRITE vendor.

Well, I made this example, adapt it to suit your needs.

DATA: vendor(10) TYPE c VALUE '452'.

START-OF-SELECTION.

  SHIFT vendor CIRCULAR RIGHT.
  WHILE vendor(1) = space.
    SHIFT vendor CIRCULAR RIGHT.
  ENDWHILE.
  SHIFT vendor CIRCULAR LEFT.
  OVERLAY vendor WITH '0000000000'.
  WRITE vendor.

9 REPLIES 9
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,446

showthe code part...itmust work....

Read only

Former Member
0 Likes
1,446

CONVERSION_EXIT_ALPHA_INPUT will only add leading zeroes for character fields with numerics only.

Rob

Read only

Former Member
0 Likes
1,447

Well, I made this example, adapt it to suit your needs.

DATA: vendor(10) TYPE c VALUE '452'.

START-OF-SELECTION.

  SHIFT vendor CIRCULAR RIGHT.
  WHILE vendor(1) = space.
    SHIFT vendor CIRCULAR RIGHT.
  ENDWHILE.
  SHIFT vendor CIRCULAR LEFT.
  OVERLAY vendor WITH '0000000000'.
  WRITE vendor.

Read only

0 Likes
1,446

Hi Gustavo

imusing yor technique,in debugmode ,its ok but when displayed on screen,it is without the 0

plzhelp

Read only

0 Likes
1,446

Gustavo's code works perfectly. You have probably changed the declaration of vendor from CHAR910) to something like lfa1-lifnr.

Rob

Read only

0 Likes
1,446

thanks a lot gustavo,it was ok

Read only

BH2408
Active Contributor
0 Likes
1,446

Hi ,

Give the vendor number and target vendor number for import and export parameters...

Regards,

Bharani

Read only

Former Member
0 Likes
1,446

Could it be that you are using it on an internal table field and forgot to modify it?

Read only

Former Member
0 Likes
1,446

Try to used the comand UNPACK.

Regards,

Carlos