2009 Apr 06 5:30 AM
Dear Experts,
I have created a customized routine 9XX that would calculate the Condition Value, if the value is not 0 for the Exch.rate-acct. field on the Financial Accounting tab on the Sales Order header.
My routine code is as follows:
if komk-kurrf ne '0.00000'.
if sy-subrc = 0.
temp_val = ( komp-mglme * xkomv-kbetr ) / 1000.
xkwert = ( temp_val * komk-kurrf ) / 100000.
xkomv-kwert = xkwert.
modify xkomv.
endif.
endif.
However, the calculated value is not reflected in the Condition Value column during Sales Order creation, change or view. I have included my routine to the condition type in tcode V/O8.
Per my checking, the routine appears in the include list for the main program SAPLV61A.
When I debug, I found that the value in structure xkomv is overridden by value in structure rettkomv, because wertformel = space.
I have gone through the messages below but I am still stuck:
2. How to set condition rate using VOFM pricing formula
I'd appreciate your assistance.
Thank you.
HJMY
2009 Apr 06 6:48 AM
Hi,
If you have correctly assigned the routine to your condition type in V/08, the field wertformel should be set.
please verify whether in V/08, the routine was assigned to "Condition formula for alternative calculation type" column.
Put a break point in the following include to verify this.As, you can see below, the XKWERT value will automatically be assigned to XKOMV-KWERT. This is the only place where the field is set.
in include LV61AA43.
calculation formula
IF xkomv-kofrm NE 0.
wertformel = 'X'.
xkwert = xkomv-kwert.
frm_kondi_wert-nr = xkomv-kofrm.
PERFORM (frm_kondi_wert) IN PROGRAM saplv61a IF FOUND.
xkomv-kwert = xkwert.
ENDIF.
Regards.
2009 May 21 10:43 PM
Hi Dev Parbutteea,
Thank you for your reply. I have checked & found that my setting is as per your recommendation.
However, the include program is LV61AA55 instead of LV61AA43.
In LV61AA55 program the xkomv value is overridden by value in rettkomv.
How can this be changed?
I'd apprciate advice from all.
Thank you.
HJMY.
2009 May 25 5:06 AM
2009 Jun 17 6:16 PM
Hi HJMY,
Could you please tell me how did you solve the problem? I have the same one, I give a value to XKWERT on my routine but then it doesn't take it to the xkomv-kwert.
Thanks from now,
John
2009 Dec 24 3:28 PM
Hi HJMY,
Could you please share your resolution with us? I will be grateful!
Regards,
Fabio
Edited by: Fabio Toledo de Lima on Dec 28, 2009 7:19 PM
2010 Mar 25 10:46 AM
Hi HJMY,
I'm alsofacing the same problem. I would be grateful if you could share the solution.
Thank you.
2010 Apr 14 11:01 AM
Would be really great if you could tell us how you solved this, as we are facing the same problem.
2010 May 01 8:53 AM
Hi,
Please help i m facing same problem that xkwert is not updating on sales order save
2010 May 19 2:50 PM
Hi HJMY,
I have same problem. I want to populate KBETR field of XKOMV structure. but every time i modify XKOMV in the routine it is overridded bt RETTKOMV. Please help.
Regards
2011 Aug 01 12:29 PM
Hi,
We have the same problem . The values from XKOMV and TKOMV are being overwritten by RETTKOMV.
Please help. Its urgent. Thanks
Srinivas
2016 Aug 25 1:03 PM
Dear All,
Issue resolved myself. I have applied the code in the include LV61AA43.
I have created an enhancement point after this code.
* price per unit if sum line
IF xkomv-kschl = space.
PERFORM xkomv_kbetr_from_kwert USING xkomv-kwert.
ENDIF.
Following is my code
move '101' to waxkomv-kwert.
"----------
Thanks
Aneel