07-25-2013 2:55 PM
Hello Experts ,
I have a requirement of removing the zeros after decimal point while displaying in ALV.
e.g 4.000 --> '4' .
I have used lo_column->set_decimals( '0' ).But I don't find any difference.
I am using SALV factory method for ALV display.
Kindly advice.
Thanks.
07-25-2013 4:28 PM
The simplest solution is to move the value to a column of type i and display that column.
Neal
07-25-2013 4:28 PM
The simplest solution is to move the value to a column of type i and display that column.
Neal
07-25-2013 5:08 PM
Hi,
Declare that quantity field like P LENGTH 16 DECIMALS 3. Then use lo_column->set_decimals( '0' ).
Thanks & Regards
Bala Krishna
07-25-2013 5:26 PM
Hi Elakkiya.
If you don't want to change the column type , you need to change some fields of the column when the catalog is generated.
I used the next lines to show 2 decimals instead 3( field type = BRGEW 😞
<w_fcat>-decimals_o = 2.
<w_fcat>-decimals = 2.
clear: <w_fcat>-domname,
<w_fcat>-qfieldname,
<w_fcat>-ref_table,
<w_fcat>-datatype.
Regards,
Manuel H.
04-29-2020 12:06 PM
03-22-2022 7:01 PM
I think this is the best solution since we are often dealing with native SAP fields in structures and redefining the fields, creating new data elements, etc. is overkill.
This method worked great for me and is just want I wanted. Much appreciation to leon_van_niekerk
01-18-2023 8:39 PM
04-17-2024 4:40 PM
Thanks, this works well to remove decimals, however is there any way to remove comma using lr_col->set_edit_mask ?
12,123 comma needs to be removed.