Skip to Content
0

Unable to determine condition type in SD pricing.

Feb 25, 2017 at 11:43 AM

64

avatar image

Dear all,

Below is my requirement:

If the Order quantity in Sales Order Item satisfies a criteria, a new condition type YXXX (some discount) must be populated. If the order quantity either exceeds or below the required amount, this condition type must not be populated.

To satisfy this requirement, I have created a new routine in VOFM (Requirements->pricing), and set SY-SUBRC to 0 if condition satisfies and SY-SUBRC = 4 if it doesn't satisfy.

While creating sales order, I gave a material and order quantity as say 63. When I hit enter and select 'Item conditions' button, my new condition type got populated. I come back and change the order quantity which is not equal to 63, then still my new condition type is available. This should not be the case.

I create a new line item with quantity 64, as expected, the new condition type is not populated. When I change the quantity to 63, the condition type isn't populated. Not sure, what might be the issue.

I observed something, Once the pricing is determined, even if I change the quantity, there is no effect. It brings what is available previously and displays on screen no matter what quantity you enter.

Can you please help on how I can meet my requirement. Below is the code snippet which I have written in pricing routine in KOBED_XXX.

Thanks,

Sai

  READ TABLE tkomv TRANSPORTING NO FIELDS WITH KEY knumv = xkomv-knumv
                                                   kposn = xkomv-kposn
                                                   BINARY SEARCH.
  IF sy-subrc = 0.
    SELECT SINGLE * FROM marm INTO lwa_marm WHERE matnr = komp-matnr
       AND meinh = lco_unit_fpl.
    IF lwa_marm IS NOT INITIAL.
      IF lwa_marm-umrez IS NOT INITIAL.
        ltp_restqty = komp-mglme MOD lwa_marm-umrez.
        IF ltp_restqty = 0.
          ltp_subrc = 0.
        ELSE.
          ltp_subrc = 4.
        ENDIF.
      ELSE.
        ltp_subrc = 4.
      ENDIF.
    ELSE.
      ltp_subrc = 4.
    ENDIF.
  ENDIF.
  sy-subrc = ltp_subrc.<br>
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Shanthi Kumar Juluru Mar 21, 2017 at 08:07 AM
0

Can you just check this? once you change the quantity, go to item pricing conditions and redetermine the price and check to see whether you see any change or not.

Share
10 |10000 characters needed characters left characters exceeded