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: 

Problem in ALV HEADER

Former Member
0 Kudos

Hi Experts,

I have a problem in Alv Header. In front of material No zeros (Material No :000000000000006151 ) have come. i don't need zeros. i want only single vale 6151.

i am using this logic in Alv Header

IF MATNR-HIGH EQ SPACE.

CONCATENATE 'Material No : ' MATNR-LOW INTO TEXT1.

ELSE.

CONCATENATE 'FROM MATERIAL : ' MATNR-LOW 'TO MATERIAL : ' MATNR-HIGH INTO TEXT1 SEPARATED BY SPACE.

ENDIF.

Plz send me ASAP.

Thanks & Regards.

Sreedhar.

3 REPLIES 3

Former Member
0 Kudos

You can use the keyword "SHIFT". But you should probably use a holder variable so you don't mess up your select-option variables.

For example:

data: gv_matnr type matnr.

move: matnr-low to gv_matnr.

SHIFT gv_matnr LEFT DELETING LEADING '0'.

You'll need a second variable for MATNR-HIGH, and repeat for that as well. Then go on with your header output using the shortened matnr's.

Hope this helps,

Mark Schwendinger

Former Member
0 Kudos

Best thing to do is use the FM

CONVERSION_EXIT_ALPHA_OUTPUT

give the the material number to Parameter INPUT, it'll give you 6151. Hope this helps!

~Priya

Former Member
0 Kudos

If the problem is in ALV header area

data: l_matnr(18) type c.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

importing

input = mara-matnr

exporting

output = l_matnr.

condense l_matnr.

and then use l_matnr variable in your ALV header

If the problem is in ALV GRID data area itself, use following

For the field MATNR while creating field catalogue set one variable....NO_ZERO = 'X'.

e.g.