Adding Leading Zeroes

by Kenny

We generally have situations wherein we need to add the leading zeroes to a particular field. Following are the two methods to achieve the same:

First Method:

Using the function module CONVERSION_EXIT_ALPHA_INPUT.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT  = WA_MATNR
  IMPORTING
    OUTPUT = WA_MATNR.

Second Method:

The field could simple be moved to a numeric and then back to the character field. The N field should be the same length as the C field.

data: c(10) type c value '12345'.
data: n(10) type n.
 
n = c.
c = n.

 


 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image