09-20-2007 5:30 AM
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.
09-20-2007 9:21 PM
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
09-20-2007 10:44 PM
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
09-20-2007 11:29 PM
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.