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

VOFM condition value calculation issue

Former Member
0 Likes
561

Hi Friends,

I am having a strange kind of issue. I have a requirement of calculating a condition type value based upon one more available condition type.

In my case the condition value to find out is 'ZWTH' and the condition value from find out is 'ZWHC'.

Now the routine is assigned to pricing procedure with condition type 'ZWTH' and it calculates fine on screen. But as soon as I save document it calculates the values wrong.

Does anybody have any idea, what is the exact problem and what goes wrong?

DATA : L_KOMV LIKE XKOMV,

LV_ZWHC_VALUE TYPE KWERT,

LV_ZWTH_KBETR TYPE KBETR.

CLEAR : L_KOMV,

LV_ZWHC_VALUE,

LV_ZWTH_KBETR.

READ TABLE XKOMV INTO L_KOMV WITH KEY KPOSN = XKOMV-KPOSN

KSCHL = 'ZWHC'.

IF SY-SUBRC EQ 0.

LV_ZWHC_VALUE = L_KOMV-KWERT.

LV_ZWTH_KBETR = XKOMV-KBETR.

IF LV_ZWHC_VALUE NE 0.

PERFORM CALCULATE_XKWERT IN PROGRAM ZRV64A903_ROUTINES

USING LV_ZWHC_VALUE

LV_ZWTH_KBETR

CHANGING XKWERT.

ENDIF.

ENDIF.

&----


*& Form CALCULATE_XKWERT

&----


FORM calculate_xkwert USING p_zwhc_value TYPE kwert

p_zwth_kbetr TYPE kbetr

CHANGING p_xkwert TYPE kwert.

p_xkwert = p_zwhc_value * ( p_zwth_kbetr / 1000 ).

ENDFORM. " CALCULATE_XKWERT

3 REPLIES 3
Read only

Former Member
0 Likes
500

hi,

Please check inside properties if there is floating calculation inside these procedure. I've seen a few procedure without floating point calculation.

\

Regards,

Wojciech

Read only

0 Likes
500

Hi Wojciech,

Can you explain me in detail???

Thanks,

Sagar V.

Read only

Former Member
0 Likes
500

Hi Sagar,

I think to find out the exact issue, you need to debug the routine after saving the document.

As per my experience, the conditions and values are different before the document is saved and after the save button is clicked. Upon saving, the whole pricing is carried out again. So I would suggest to debug and analyze after saving the document.

Hope this helps.

Regards,

Shahu