Application Development 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: 

xkomv-kbetr value is getting cleared after changing the value using routine

Former Member
0 Kudos
2,877

Hi Experts

I have a requirement to change the pricing condition value:For this i created a new routine and assigned this routine to Pricing Procedure in v/08.My newly created routine is getting triggered and new pricing value is getting in routine,but it is getting cleared in the standard program and the new value is not getting in my pricing condition.

I'm i missing any step in this process or using routines is not the right approach.Could any one can help me in getting out from this issue?

Regards,

Krishna

6 REPLIES 6

madhu_vadlamani
Active Contributor
0 Kudos
708

Hi Krishna,

Can you post the code.

Regards,

Madhu.

former_member215781
Active Participant
0 Kudos
708

Looks like the field is getting cleared in the standard program. Try to debug after the new value is assigned in your routine. Look for refresh statements clearing the internal table or clear statements.

Also, check where is the new value assigned in your standard program

Former Member
0 Kudos
708

I'm trying to change xkomv-kbetr in my routine( calls from below perform statement).When my routine ends and when it comes back to standard program xkomv values are replacing by rettkomv,where my new value is overriding by old value.Here iam placing the code in standard program,from this perform statement my newly created routine is calling where it gets changed to new value and the old values are overriding using the statement xkomv = rettkomv

PERFORM (frm_kondi_wert) IN PROGRAM saplv61a IF FOUND.

xkomv = rettkomv.

Regards

Krishna

Edited by: meetkrishna on Mar 27, 2011 3:18 PM

0 Kudos
708

Hi Krishna,

I had the very same problem, I have just solved it today, it was driving me nuts. Here is my solution:

I wanted to change the "Amount" column in the Pricing elements of the Condtitions TAB in Sales Order Header (KOMV-KBETR).

Eveytime I tried to change XKOMV-KBETR in my routine , it was overwritten by RETTKOMV.

There are two parts to the solution:

First of all, your VOFM routine is called in two places - from KOMV_BEWERTEN( in program LV61AA55 ) where it is overwritten as soon as it leaves your routine, but also from XKOMV_KWERT_ERMITTELN (in program LV61AA43) where it is not overwritten by RETTKOMV.

Put a break point in program LV61AA43 at this point in the code, and make sure your VOFM routine is called:


* 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.

Still, when I changed XKOMV-KBETR the change was not reflected on screen.

I needed to MODIFY the structure TKOMV where KSCHL was equal to my Condition Type.

Use a line of code something like:

 modify tkomv transporting kbetr where KSCHL = 'ZXXX' AND (other conditions here) 

In my case, the change was then reflected onscreen.

Hope this helps you,

David.

0 Kudos
708

Hi Krishna and David,

I tried updating TKOMV. But i could see some random behaviour in condition values on sale order. kbetr values initially for item 10 are seen blank. Navigated to item 20 and could see item 10 values getting populdated in item 20 and so on.

Can you please help?

Thanks

Srinivas

0 Kudos
708

Hi Srinivas,

yeah, logic can be a bit vague to isolate the correct line, but have tested in DV and QA and seems to be working okay.

I used, in the code:

check xkomv-ksteu = 'C'.

if this was true:

modify tkomv transporting kbetr where

kschl = 'ZFR1' and

KSTEU = 'C'.

ZFR1 being my condition type.

depending on your config, you might be able to use something similar.

Hopefully this might help you.

David.