12-16-2015 9:28 AM
Hello Everyone .
The total amount value that gets printed on the smartform is GS_HD_KOMK-FKWRT. This is related to invoice smartform.
This value has decimal values . <i want to round off this value and truncate the decimals . How do I do this in a smartform .
Thanks
Pooja
12-16-2015 9:58 AM
Pooja,
You can use Ciel,ROUND,Floor etc to round the value to its nearest value ( + or - ) by adding CODELINES in your Smartform at the corresponding window.Btw, truncate is not same as ROUNDING.
Do search in SCN before posting your queries.
K.Kiran.
12-16-2015 10:00 AM
Hi Pooja,
In smartform there is program lines tab. in that add code for rounding off the total amount.
v_variable = CEIL( v_variable)
else.
v_variable = FLOOR(v_variable).
Try following code to truncate.
data: lv_var type p decimals 5 value '12345.12345'.
data: lv_str type string.
data: lv_len type i.
data: lv_offset type i.
lv_str = lv_var.
lv_len = strlen( lv_str ).
lv_offset = lv_len - 3.
lv_var = lv_str(lv_offset).
Thanks,
Reshma Patil.
12-17-2015 2:23 AM
Hi pooja,
You can firsy round the value using ceil floor or any custom logic of yours. Then take a Char variable and then use
Write num to char decimals 0.
This will truncate your decimal values. Then map this char variable to your form
Regards,
Veera