Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove leading zeros in ALV grid report.

Former Member

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.

1 ACCEPTED SOLUTION

Former Member

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

3 REPLIES 3

Former Member
0 Kudos

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.

0 Kudos

Thanks Suman. It worked.

Former Member

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