cancel
Showing results for 
Search instead for 
Did you mean: 

VK34, problem of warning issued upon new condition:Reason codes inconsist

Former Member
0 Kudos

Hello,

The Scenario is :

for a given material/sales organisation

1- I create a ZP00 condition value =100$ valid from 01.09.2009 to 31.12.2009

2- I create new ZP00 condition value= 160$ valid from 01.01.2010 to 31.12.2999

To day, I decide to change the ZP00 condition value,

3- I created a new ZP00 condition with value=160$ valid from 11.09.2009 to 31.12.2009

The system doesn't issue any warning message to tel me that there is a gap in value between the new condition and the old condition valid for the same period

In fact the system compare the new condition value with the last created condition, hence it doesn't find any difference, and as consequence no warning is issued.

I expect that system compares the new condition value to the condition value valid for the same period and not the last condition

==> Shall I post an OSS for this problem ??

For more details, hereafter the sap code, include MV13AF0K

* Get the Original value (from database) of ZP00 or ZPI1 condition
  CLEAR: lv_old_zp00, lv_knumh.
  CLEAR: lv_new_zp00, lv_sum_z0xx.

  SELECT MAX( knumh ) INTO lv_knumh===> *system looks for the last condition created, it doesn't take care*    
    FROM konh                                                      *whether the condition is valide or not*
    WHERE kappl = 'V'
      AND kschl = xkonh-kschl
      AND vakey = xkonh-vakey.
  IF sy-subrc EQ 0.
*   Item data
    SELECT kbetr INTO lv_old_zp00
           UP TO 1 ROWS
      FROM konp
      WHERE knumh = lv_knumh
        AND kschl = xkonh-kschl.
    ENDSELECT.
  ENDIF.

* If no old value --> continue the processing without checking the gap
  IF NOT lv_old_zp00 IS INITIAL.
*   Calculation of Z0xx conditions sum
    LOOP AT xkonp where knumh = xkonh-knumh AND loevm_ko = space.
      CASE xkonp-kschl.
        WHEN 'ZP00' OR 'ZPI1'.
          MOVE xkonp-kbetr TO lv_new_zp00.
        WHEN 'Z006' OR 'Z008'.
*********Exclusion mode to be defined***********
        WHEN OTHERS.
          IF xkonp-kschl(2) = 'Z0'.
            ADD xkonp-kbetr TO lv_sum_z0xx.
          ENDIF.
      ENDCASE.
    ENDLOOP.

*   Calculation of the gap between the old and the new price
    lv_gap = lv_new_zp00 - lv_old_zp00.
*   If the gap do not correspond to the sum of condition z0xx
*   -> warning popup
    IF lv_gap NE lv_sum_z0xx.
      lv_diff_flag = 'X'.  "Set Difference flag
      lv_diff = lv_gap - lv_sum_z0xx.

For more deta

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

It is a standard process, so no modification could be done

Former Member
0 Kudos

very bad layout, I try to enhance it

The Scenario is :

for a given material/sales organisation

1- I create a ZP00 condition value =100$ valid from 01.09.2009 to 31.12.2009

2- I create new ZP00 condition value= 160$ valid from 01.01.2010 to 31.12.2999

To day, I decide to change the ZP00 condition value,

3- I created a new ZP00 condition with value=160$ valid from 11.09.2009 to 31.12.2009

The system doesn't issue any warning message to tel me that there is a gap in value between the new condition and the old condition valid for the same period.

In fact the system compare the new condition value with the last created condition, hence it doesn't find any difference, and as consequence no warning is issued. I expect that system compares the new condition value to the condition value valid for the same period and not the last condition

==> Shall I post an OSS for this problem ??

For more details, hereafter the sap code, include MV13AF0K

CLEAR: lv_old_zp00, lv_knumh.
  CLEAR: lv_new_zp00, lv_sum_z0xx.

  SELECT MAX( knumh ) INTO lv_knumh
    FROM konh
    WHERE kappl = 'V'
      AND kschl = xkonh-kschl
      AND vakey = xkonh-vakey
  lv_gap = lv_new_zp00 - lv_old_zp00.
  If the gap do not correspond to the sum of condition z0xx
  -> warning popup