‎2007 Mar 27 3:44 PM
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
‎2007 Mar 27 3:56 PM
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
‎2007 Mar 27 4:02 PM
‎2007 Mar 27 5:07 PM
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