Skip to Content
avatar image
Former Member

Supression leading zeros

Hi guys,

I have to delete leading zeros from a set of fields.

please help with an example.

thanx in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Aug 17, 2007 at 03:45 PM

    use fm CONVERSION_EXIT_ALPHA_OUTPUT

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2007 at 03:45 PM

    U can either use this function module also

    CONVERSION_EXIT_ALPHA_OUTPUT

    or

    SHIFT <yourField> LEFT DELETING LEADING '0'

    or

    try NO-ZERO option of WRITE statement

    or

    Another way is to create another variable of type I and assign the value into it

    example:

    DATA: L_NUMC(08) TYPE N.

    DATA: L_INT TYPE I.

    L_NUMC = '00000018'.

    L_INT = L_NUMC.

    Result will be = 18.

    Regards,

    Santosh

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 17, 2007 at 03:54 PM

    Hi,

    Use

    pack mara-matnr to v_matnr.
    

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 18, 2007 at 03:16 AM

    hi if an field has leading zeros like 0000000001.

    wk_equno = 0000000001.

    remove this using the following method.

    data: wk_var like qmel-equnr.

    write wk_equno to wk_var using edit mask '==ALPHA'.

    Reward points if usefull.

    Add comment
    10|10000 characters needed characters exceeded