2019 Sep 05 8:48 AM
hello
how to show 2 decimals of quantity value without rounding
data C_CARGO type char15.
data CARGO type VOLUM.
CARGO = '43.077' .
write CARGO to C_CARGO LEFT-JUSTIFIED DECIMALS 2 .
write C_CARGO . "--show 43.08
2019 Sep 05 11:51 AM
Or:
DATA c_cargo TYPE char15.
DATA cargo TYPE volum.
cargo = '43.077' .
cargo = round( val = cargo dec = 2 mode = cl_abap_math=>round_down ).
WRITE cargo TO c_cargo LEFT-JUSTIFIED DECIMALS 2.
WRITE: / c_cargo .
2019 Sep 05 11:48 AM
DATA c_cargo TYPE char15.
DATA cargo TYPE volum.
DATA lv_len TYPE i.
cargo = '43.077' .
WRITE cargo TO c_cargo LEFT-JUSTIFIED.
lv_len = strlen( c_cargo ) - 1.
c_cargo = substring( val = c_cargo len = lv_len ).
WRITE: / c_cargo
2019 Sep 05 11:51 AM
Or:
DATA c_cargo TYPE char15.
DATA cargo TYPE volum.
cargo = '43.077' .
cargo = round( val = cargo dec = 2 mode = cl_abap_math=>round_down ).
WRITE cargo TO c_cargo LEFT-JUSTIFIED DECIMALS 2.
WRITE: / c_cargo .
2019 Sep 05 12:02 PM