Skip to Content
author's profile photo Former Member
Former Member

How to remove leading zeros in ALV grid report.

Hi Friends,

My ztable has customer and material fields with leading zeros even though I maintainted the test data in my ztable thru SM30.

I have written a select statement in my report to select the records from ztable into itab and then I am displaying the same itab using FM reuse_alv_grid.

I tried with FM CONVERSION_EXIT_ALPHA_OUTPUT. It is not working for me because I am using the Data Element MATNR, the domain provides for a conversion routine MATN1 and regardless of what I do it will still process this routine when displaying it. Is there any other FM which removes leading zeros?

I need to remove the leading zeros for customer and material fields.

Please Suggest good ideas.

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 28, 2011 at 06:15 AM

    Dear nani,

    use only single line while displaying alv in bole letter.

    for i.e.

    FIELDCATALOG-FIELDNAME = 'MATNR'.

    FIELDCATALOG-SELTEXT_M = 'Material Number'.

    FIELDCATALOG-COL_POS = 0.

    FIELDCATALOG-OUTPUTLEN = 10.

    FIELDCATALOG-EMPHASIZE = 'X'.

    FIELDCATALOG-DATATYPE = 'NUMC'.

    FIELDCATALOG-KEY = 'X'.

    • fieldcatalog-do_sum = 'X'.

    • fieldcatalog-no_zero = 'X'.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2011 at 07:42 PM

    The Conversion CONVERSION_EXIT_ALPHA_OUTPUT will not show leading Zeros. If you are getting leading zeros, it means the fieldcatalog is not properly populated. Pass the ref_tabname = 'MARA' and ref_fieldname = 'MATNR' for the Material field in the fieldcatalog.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.