Skip to Content
0
Former Member
Mar 05, 2009 at 03:11 AM

Condition

100 Views

Hi!

I need to add in a condtion where if the contion type (kschl) is either 'za1' or when its is 'za2' the code should check if the field kwert is initial or 0. If it is zero , it should jump up to the next condition type to check if it is of what price type.I ahve a code which is running all well except that I need to add this condition when its chacking the condition types to select it as price list or offlist.Kind help please.

DATA:
  tp_kotabnr     TYPE kotabnr,        " Condition table.
  tp_kozgf       TYPE kozgf,
  tp_zprice_type TYPE zprice_type,
  ta_konv        TYPE
  TABLE OF konv WITH HEADER LINE.
CLEAR: pricetype,conditiontype.
SELECT kschl kolnr FROM konv INTO CORRESPONDING FIELDS OF TABLE ta_konv WHERE
  kinak = ' '         AND " Active
  knumv EQ vbrk-knumv AND " Condition record number.
  kposn EQ vbrp-posnr.    " Item number.
LOOP AT ta_konv.
* Retreive the access sequence
  SELECT SINGLE kozgf FROM t685 INTO tp_kozgf WHERE
    kvewe = 'A' AND        " Pricing.
    kappl = 'V' AND        " Sales application.
    kschl = ta_konv-kschl. " Condition type.
* Retreive the pricing table.
  SELECT SINGLE kotabnr FROM t682i INTO tp_kotabnr WHERE
    kvewe = 'A' AND        " Pricing.
    kappl = 'V' AND        " Sales application.
    kozgf = tp_kozgf AND   " Access sequence.
    kolnr = ta_konv-kolnr. " Access sequence - Access number.
* Retreive the price type.
  SELECT SINGLE zprice_type FROM zsd_price_type INTO tp_zprice_type WHERE
    kappl   = 'V'          AND " Sales application.
    kschl   = ta_konv-kschl AND " Condition type.
    kotabnr = tp_kotabnr.      " Condition table.
    
  IF tp_zprice_type = '01'.
    conditiontype = ta_konv-kschl.
    pricetype = 'List'.
*    EXIT.
  ELSEIF tp_zprice_type = '02'.
    conditiontype = ta_konv-kschl.
    pricetype = 'Offlist'.
    EXIT.
  ENDIF.
ENDLOOP.

Thanks