How to set delete indicator for condition type in PO with user exit?

2k views Asked by At

There is a condition type let's say ZXXX that includes ZFX1 and ZFX2 conditions.

The scenario wanted is, ZFX1 and ZFX2 conditions must set as deleted when ZXXX exists to prevent duplicate calculation.

It can be handled manually but how it can be possible with user exit? With which user exit?

Thanks, E.

1

There are 1 answers

4
Suncatcher On

No way.

Maybe colleagues correct me but as far as I know there is no way to do it on-the-fly.

LOEVM_KO indicator is set:

  1. Manually in VK12
  2. Via Batch Input

Another probable (at your own risk!) way of setting deletion is FM RV_KONDITION_SICHERN_V13A called that way

DATA: lt_xkonp TYPE TABLE OF konpdb WITH EMPTY KEY.

APPEND VALUE #( mandt = sy-mandt kopos = '01' kappl = 'V' kschl = 'ZXXX' knumh = '01234567' stfkz = 'A' kpein = '1' loevm_ko = abap_true updkz = 'U') TO lt_xkonp.

CALL FUNCTION 'RV_KONDITION_SICHERN_V13A'
  TABLES db_xkonp = lt_xkonp.

However I don't recommend it.

Your general approach is wrong, the deletion indicator is not a setting that can be switched on and off, and under no circumstances it should be done in any user-exit.

This FM contains COMMIT under the hood, so it can break the LUW and corrupt your pricing settings.