Application Development 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: 

add leading zero

Former Member
0 Kudos

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

Former Member
0 Kudos

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

kesavadas_thekkillath
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Rob

Former Member
0 Kudos

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.

0 Kudos

Hi Gustavo

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

plzhelp

0 Kudos

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

Rob

0 Kudos

thanks a lot gustavo,it was ok

P561888
Active Contributor
0 Kudos

Hi ,

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

Regards,

Bharani

Former Member
0 Kudos

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

Former Member
0 Kudos

Try to used the comand UNPACK.

Regards,

Carlos