Register Login

Deleting and Adding Leading Zeros

Updated May 18, 2018

Deleting Leading Zeros

If you have a field that containg leading zeros and want to eliminate all leading zeros for a fax and e-mail report. Then you have to opt for the following code:

Either shift left deleting leading '0'

or

Opt for the following functional module code:

FM CONVERSION_EXIT_ALPHA_OUTPUT

This will get rid of the zeroes before you send it to a file or whatever.

Placing Leading Zeros

One can place leading zeroes in front of a number. Like have a field that is 14 characters long but you're only reading in 10, then you can add 4 zeroes to the front of that by using the following function module:

'CONVERSION_EXIT_ALPHA_INPUT' and pass the field or even part of the field to be padded with zeroes.

Or else, you can use WRITE field using EDIT MASK '==ALPHA'.


Comments

  • 20 May 2014 12:12 pm Guest Helpful Answer

    In pgm part... in write section ..

    for eg:

    write: empno no NO-ZERO.

    then u execute and see....no-zero use and see 

     

  • 18 Dec 2012 4:44 pm Guest
    In the user selection screen ,when i enter input as '4000' then the number should automatically convert to '0000004000' to retrive data? plz suggest me.

×