Online Tutorials & Training Materials | STechies.com
Register Login

Deleting and Adding Leading Zeros

|| || 2

Deleting and Adding Leading Zeros
Stechies

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

    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
    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.

Related Articles

0.0137 seconds.