Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Invoice smartform

Former Member
0 Likes
683

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

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

3 REPLIES 3
Read only

kiran_k8
Active Contributor
0 Likes
638

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.

Read only

Former Member
0 Likes
638

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.

Read only

Former Member
0 Likes
638

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