*&---------------------------------------------------------------------*
*& Report ZRQEVAC50 可用庫存轉待檢庫存
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
*{ REPLACE DEVK977808
*REPORT RQEVAC50.
report ZRQEVAC50 message-id QA.
types:
T_MKPF_TAB like MKPF occurs 0,
T_MSEG_TAB like MSEG occurs 0.
parameters:
PRUEFLOS like QALS-PRUEFLOS obligatory memory id QLS,
P_BUDAT like MKPF-BUDAT default SY-DATUM.
data:
G_MSGV1 like SY-MSGV1,
G_QALS like QALS,
G_QALS_LEISTE like QALS,
G_QAMB_TAB type QAMBTAB,
G_QAMB_VB_TAB type QAMBTAB,
G_MKPF_TAB type T_MKPF_TAB,
G_MSEG_TAB type T_MSEG_TAB,
G_SUBRC like SY-SUBRC.
start-of-selection.
perform ENQUEUE_QALS using PRUEFLOS
G_SUBRC.
if not G_SUBRC is initial.
message id SY-MSGID type 'S' number SY-MSGNO
with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
submit (SY-REPID) via selection-screen.
endif.
perform READ_QALS using PRUEFLOS
G_QALS
G_QALS_LEISTE
G_SUBRC.
if not G_SUBRC is initial.
message id 'QA' type 'S' number '102'
with PRUEFLOS.
submit (SY-REPID) via selection-screen.
endif.
perform CHECK_LOT using G_QALS
G_SUBRC.
if not G_SUBRC is initial.
case G_SUBRC.
when 256.
G_MSGV1 = 'Lot & does not refer to a material doc'.
when 128.
G_MSGV1 = 'Material & is serialized'.
replace '&' with G_QALS-MATNR into G_MSGV1.
when 64.
G_MSGV1 = 'Lot & is not stock relevant'.
when 32.
G_MSGV1 = 'Lot &: No stock transferred'.
when 16.
G_MSGV1 = 'Lot & is cancelled'.
when 8.
G_MSGV1 = 'Lot & is archived'.
when 4.
G_MSGV1 = 'Lot & is blocked'.
when 2.
G_MSGV1 = 'Lot & is HU managed'.
endcase.
replace '&' with PRUEFLOS into G_MSGV1.
message id '00' type 'S' number '208'
with G_MSGV1.
submit (SY-REPID) via selection-screen.
endif.
perform READ_QAMB using G_QALS
G_QAMB_TAB
G_SUBRC.
if not G_SUBRC is initial.
message id 'QA' type 'S' number '068'
with PRUEFLOS.
submit (SY-REPID) via selection-screen.
endif.
perform READ_MKPF using G_QAMB_TAB
G_MKPF_TAB
G_SUBRC.
if not G_SUBRC is initial.
message id SY-MSGID type 'S' number SY-MSGNO
with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
submit (SY-REPID