Skip to Content
avatar image
Former Member

VOFM (Pricing Condition) FREIGHT - unable to edit Amount value (KOMV-KBETR)

Hi there,

I have a requirement to edit the calculated FREIGHT value in a sales order (under "conditions" TAB in header). If it goes below

a certain value (after partial order has been shipped) I need to set it back to a higher value.

I have looked around the forum and see that this issue seems to be happening to a few people, but I can't see a solution!

In VOFM, I created a new rountine (618) and have assigned this to the correct condition type.

When I insert a break point, it is hitting my code, and I can change values (XKOMV structure). (so all is okay there)

But after hitting my rountine, the XKOMV structure is overwritten by RETTKOMV (in SAP standard code)

so my changes are not held - can anyone suggest a way to get around this?

(* I changed the CONDITION TYPE to C, as suggested elsewhere, but to no effect)

Another approach I was thinking was to use Userexit "userexit_pricing_check" in include LV69AFZZ.

Would this be a better approach, or can anyone suggest a better solution?

Any suggestions appreciated.

thanks.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Jul 06, 2011 at 03:37 PM

    For benefit of anyone with same issue:

    here is a useful post:

    Link:To Round off my condition value and amount in va02

    and here is my answer to how I solved issue:

    I had a similar problem, I have just solved it today. 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 on screen.

    Hope this helps you,

    David.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      We have updated TKOMV as per your advise on the post. The values are not getting updated for the first item of sale order but when we navigate to other items and come back, the values are there and it is looking like the value of item 10 is passed on 20 and the value of 20 is passed on to 30 ..so on..Any help is highly appreciated.

      Thanks

      Srinivas