‎2010 Aug 13 6:38 AM
hello masters,
is there any option to remove decimals from alv report output. (in my report i am using collect ,but there are some fields that no need decimals thats what i want to remove it.)
Thanks & Regards
Atul
‎2010 Aug 13 7:18 AM
‎2010 Aug 13 6:47 AM
Hi,
While building your fieldcat, put option of decimals_out = 0.
hope it helps,
regards,
‎2010 Aug 13 7:03 AM
dear Thien,
i tried this LS_CAT-DECIMALS_OUT = 0. earlier but it was not working
‎2010 Aug 13 7:11 AM
‎2010 Aug 13 7:17 AM
i'm using dinamic internal table with currency field. if any possibility then pls revert me.
thnx
Atul
‎2010 Aug 13 7:20 AM
Dear Dzed,
i tried with this also LS_CAT-DECIMALS_OUT = '0'. " <- with single quotes
‎2010 Aug 13 7:18 AM
‎2010 Aug 13 7:23 AM
dear Raymond,
I'm using currency field. so in curr field there is no option to remove decimals.
‎2010 Aug 13 7:30 AM
‎2010 Aug 13 7:55 AM
Hi Atul,
Normally, we will refer the currency to get the correct decimal places. For eg: INR - 2 decimal, JPY - 0 decimal...
So it is not possible to hide the decimal places by referring the currency.
Also, if we are not referrering the currency, wrong value may come. For instance, in the SAP table the value will be stored as 12.00 but the actual value should be 1200 JPY.
So do as below,
Get the decimal place from the table 'TCURX' for your currency.
Create a P type variable with 2 decimals, let g_x.
Then g_x = value * 10^(2 - n), where n is the decimal place.
then write the value TO A CHAR FIELD as,
write g_x to g_c no decimals.
the assign the same to the alv internal table. Please remove the currency reference.
It shall work. Please try.
Regards,
Selva K.
‎2010 Aug 13 7:28 AM
Hi,
Define one varibale type as CHAR and pass the currency field to thet variable.
pass theis varibale to ALV report.
Decimals will not appaer in teh output report.
Regards,
Pravin
‎2010 Aug 13 7:31 AM
Hi,
Declare one more field TYPE I and move that value to the new field or use FM ROUND
Regards,
Selva
‎2010 Nov 24 5:01 AM
Self answered, by taking datatype fieldcatlog
is DEC.
e.g.: ls_cat-datatype = 'DEC'.