2013 Jul 25 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.
2013 Jul 25 4:28 PM
The simplest solution is to move the value to a column of type i and display that column.
Neal
2013 Jul 25 4:28 PM
The simplest solution is to move the value to a column of type i and display that column.
Neal
2013 Jul 25 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
2013 Jul 25 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.
2020 Apr 29 12:06 PM
2022 Mar 22 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
2023 Jan 18 8:39 PM
2024 Apr 17 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.