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

Value getting rounded off in custom Pricing routine code

Former Member
0 Likes
539

Hi All,

I have a unique problem. The below code worked perfectly correct when i ran it through custom program. The output value was 2.84. But when the same code was copy pasted in custom pricing routine, the output value is getting rounded to 0.03.

I tried changing the types for the data variables from Char type to P -Decimals 2, but the output is still getting rounded off.

The rountine is written in VOFM-FORMULAS-CONDITION VALUE.

Kindly let me know the problem and the solution for the same.

thanks and regards

Abishek

REPORT z_test1.

DATA: z_v_unitprice LIKE KOMV-KWERT,

z_v_kawrt like komv-kawrt,

z_v_mgame like komp-mgame.

z_v_mgame = '1092.10' / '384.000'.

z_v_kawrt = '1092.10' .

z_v_mgame = '384.000'.

z_v_unitprice = z_v_kawrt / z_v_mgame.

write: z_v_unitprice.

2 REPLIES 2
Read only

Former Member
0 Likes
395

Hi can you try

data: g_amount type p.

DATA: z_v_unitprice LIKE KOMV-KWERT,

z_v_kawrt like komv-kawrt,

z_v_mgame like komp-mgame.

z_v_mgame = '1092.10' / '384.000'.

z_v_kawrt = '1092.10' .

z_v_mgame = '384.000'.

z_v_unitprice = z_v_kawrt / z_v_mgame.

write: z_v_unitprice.

MOVE z_v_unitprice TO G_AMOUNT.

WRITE G_AMOUNT NO-GROUPING DECIMALS 2.

thanks & regards,

Venkatesh

Read only

0 Likes
395

Venkatesh

Thanks for your response. But actaully in report its working fine, but my problem is in pricing routine and in pricing routine i cannot use wRITE statement. The value of z_v_unitprice is what matters to me and that value is getting rounded off.

Please let me know if you have any clue abt this problem

regards

abhishek