‎2010 Jan 19 2:19 PM
hi all,
i am using OOPS ALV to display the report. requirment is that i need to dispaly * when the value of the amount coloumn is 0.
i changed that coloumn to character and displayed as "*", but now i am not able to used the summing option given by ALV.
so is there a way to put "*" insted of 0 without changing the data type of the coloumn ?
‎2010 Jan 19 4:04 PM
‎2010 Jan 19 4:09 PM
It is not possible. Only thing you could do is maybe change the 0 back to a numeric value and use the ALV filter on the column to exclude any items from the report with a 0 qty and save the layout.
Regards
L Maryniuk
‎2010 Jan 19 5:05 PM
Hi Jayakumar,
If you will change 0 to * , sum operation will stop working in ALV.
is character and hence sum not allowed.
Edited by: Harsh Bhalla on Jan 19, 2010 10:36 PM
‎2010 Jan 19 7:31 PM
What you can do is create a custom conversion exit for the quantity field...they ALV sum will work....I have used this technique with FM based ALV, it will definitely work OOALV.
1) Create 2 FM :CONVERSION_EXIT_ZZERO_INPUT & CONVERSION_EXIT_ZZERO_OUTPUT.
2) The input should have a code like this..
FUNCTION CONVERSION_EXIT_ZQUAN_OUTPUT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"----------------------------------------------------------------------
if input = '*'.
output = '0.00'.
else.
output = input.
endif.
ENDFUNCTION.
and the output FM
FUNCTION CONVERSION_EXIT_ZQUAN_OUTPUT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"----------------------------------------------------------------------
if input = '0.00' or input is initial.
output = '*'.
else.
output = input.
endif.
ENDFUNCTION.
3) Copy the Data Element/Domain for the quantity field data type to a custom one and attach the Conversion Exit ZQUAN to the domain and use the custom Data Element for the Quantity field in the ALV output table. The sub-total/summation and "*" output will both work