SAP QM 取消UD 决策。
SAP提供了相关Notes用于取消UD决策。
C24010PA 这个批次已经做了UD 决策
C24010PA目前库存已经是非限制库存
执行操作
成功后检查,自动产生了322,检验批状态也变回来了。
取消原来的生产入库也是Ok的。
测试成功。
需要用到以下两个Notes。
Notes(SAP Notes 74638).通过检验批取消UD转到为Rerel(zqevac40)。
再通过检验批把非限定性库存转为质检库存(zrqevac50)。
为了方便用户来讲,只需输入事务码:ZQMXXX (可以把权限直接给仓库主管即可),然后输入检验批,执行即可以。
可以定一个事务码:ZQMXXX,程序ZQMR_CANCEL。
*&---------------------------------------------------------------------*
*& Report ZQMR_CANCEL
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZQMR_CANCEL.
PARAMETERS:
prueflos LIKE qals-prueflos OBLIGATORY MEMORY ID qls.
START-OF-SELECTION.
SUBMIT zqevac40 WITH prueflos = prueflos AND RETURN.
WAIT UP TO 1 SECONDS.
SUBMIT zrqevac50 WITH prueflos = prueflos AND RETURN.
ZQEVAC40
*&---------------------------------------------------------------------*
*& Report ZQEVAC40
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zqevac40.
*----------------------------------------------------------------------*
* Datendefinitionen
*----------------------------------------------------------------------*
* Tabellen
*----------------------------------------------------------------------*
TABLES sscrfields.
TABLES qals.
TABLES qave.
*----------------------------------------------------------------------*
* Konstanten
CONSTANTS:
c_rc_0 LIKE sy-subrc VALUE 0,
c_rc_4 LIKE sy-subrc VALUE 4,
c_rc_20 LIKE sy-subrc VALUE 20,
*
c_kreuz LIKE qm00-qkz VALUE 'X'.
*
*----------------------------------------------------------------------*
* Eingabebildschirm
SELECTION-SCREEN SKIP 2.
PARAMETERS prueflos LIKE qals-prueflos MATCHCODE OBJECT qals
MEMORY ID qls .
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK search WITH FRAME.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 3(20) TEXT-s01 USER-COMMAND sear.
SELECTION-SCREEN PUSHBUTTON 40(20) TEXT-s02 USER-COMMAND show.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK search.
*----------------------------------------------------------------------*
AT SELECTION-SCREEN.
IF sscrfields-ucomm EQ 'SEAR'
OR prueflos IS INITIAL.
CALL FUNCTION 'QELA_START_SELECTION_OF_LOTS'
EXPORTING
i_selid = ' '
i_stat_aenderung = 'X'
i_stat_ero = 'X'
i_stat_frei = 'X'
i_stat_ve = ' '
IMPORTING
e_prueflos = prueflos
EXCEPTIONS
no_entry = 1
no_selected = 2
OTHERS = 3.
ENDIF.
IF sscrfields-ucomm EQ 'SHOW'.
CALL FUNCTION 'QSS1_LOT_SHOW'
EXPORTING
i_prueflos = prueflos.
ENDIF.
CHECK sscrfields-ucomm EQ 'ONLI'.
* ab hier mu Pr黤losnummer gef黮lt sein.
IF prueflos IS INITIAL.
MESSAGE e164(qa).
ENDIF.
* Lesen Los
CALL FUNCTION 'ENQUEUE_EQQALS1'
EXPORTING
prueflos = prueflos.
CALL FUNCTION 'QPSE_LOT_READ'
EXPORTING
i_prueflos = prueflos
IMPORTING
e_qals = qals
EXCEPTIONS
no_lot = 1.
IF NOT sy-subrc IS INITIAL.
MESSAGE e102(qa).
ENDIF.
*-----------------
* Pr黤en Status
CALL FUNCTION 'QAST_STATUS_CHECK'
EXPORTING
i_objnr = qals-objnr
i_status = 'I0218' "Status VE getroffen
EXCEPTIONS
status_not_activ = 1.
IF NOT sy-subrc IS INITIAL.
MESSAGE e102(qv) WITH qals-prueflos.
ENDIF.
*
CALL FUNCTION 'QEVA_UD_READ'
EXPORTING
i_prueflos = qals-prueflos
IMPORTING
e_qave = qave.
*---------------------------------------------------------------------*
START-OF-SELECTION.
* Vorgaben sind ok. 1. Material Umlagern und Los 鋘dern
PERFORM qals_aendern.
************************************************************************
*----------------------------------------------------------------------*
* FORM QALS_aendern
*----------------------------------------------------------------------*
FORM qals_aendern.
*
PERFORM status_fix_setzen USING 'I0002' c_kreuz.
PERFORM status_fix_setzen USING 'I0216' space.
PERFORM status_fix_setzen USING 'I0217' space.
PERFORM status_fix_setzen USING 'I0218' space.
CLEAR: qals-stat14.
CLEAR: qals-stat35.
CLEAR: qave-vauswahlmg,
qave-vwerks,
qave-versionam,
qave-vcodegrp,
qave-vcode,
qave-vbewertung,
qave-versioncd,
qave-vfolgeakti,
qave-qkennzahl.
*--... verbuchen
CALL FUNCTION 'QEVA_UD_UPDATE'