Code: Alles auswählen.
FUNCTION z_get_eq_pm_order.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(I_EQUIPMENT) TYPE EQUNR
*" EXPORTING
*" VALUE(GS_CAUFVD) LIKE CAUFVD STRUCTURE CAUFVD
*" VALUE(GS_WILOA) LIKE ILOA STRUCTURE ILOA
*" VALUE(GS_WRIWO1) LIKE RIWO1 STRUCTURE RIWO1
*" TABLES
*" GT_CAUFVD STRUCTURE CAUFVD
*" GT_WILOA STRUCTURE ILOA
*" GT_WRIWO1 STRUCTURE RIWO1
*" IAFVGD STRUCTURE ZGS_GET_EQ_PM_ORDER
*"----------------------------------------------------------------------
DATA gt_aufnr TYPE TABLE OF afih-aufnr.
DATA gv_aufnr TYPE afih-aufnr.
DATA: lt_iafvgd_temp TYPE TABLE OF afvgd,
ls_iafvgd_temp TYPE afvgd,
ls_iafvgd TYPE zgs_get_eq_pm_order.
SELECT a~aufnr
INTO TABLE gt_aufnr
FROM afih AS a
INNER JOIN aufk AS b
ON a~aufnr = b~aufnr
WHERE a~equnr = i_equipment
AND b~phas1 = 'X'
AND b~phas2 = ''
AND b~phas3 = ''.
IF sy-subrc = 0.
LOOP AT gt_aufnr INTO gv_aufnr.
CLEAR gs_caufvd.
CLEAR gs_wiloa.
CLEAR gs_wriwo1.
FREE lt_iafvgd_temp.
CALL FUNCTION 'PM_ORDER_DATA_READ'
EXPORTING
order_number = gv_aufnr
IMPORTING
wcaufvd = gs_caufvd
wiloa = gs_wiloa
wriwo1 = gs_wriwo1
TABLES
iafvgd = lt_iafvgd_temp.
LOOP AT lt_iafvgd_temp INTO ls_iafvgd_temp.
CLEAR ls_iafvgd.
ls_iafvgd-aufnr = gv_aufnr.
ls_iafvgd-vornr = ls_iafvgd_temp-vornr.
ls_iafvgd-steus = ls_iafvgd_temp-steus.
ls_iafvgd-werks = ls_iafvgd_temp-werks.
ls_iafvgd-ktsch = ls_iafvgd_temp-ktsch.
ls_iafvgd-ltxa1 = ls_iafvgd_temp-ltxa1.
ls_iafvgd-ltxa2 = ls_iafvgd_temp-ltxa2.
ls_iafvgd-larnt = ls_iafvgd_temp-larnt.
ls_iafvgd-rueck = ls_iafvgd_temp-rueck.
ls_iafvgd-rmzhl = ls_iafvgd_temp-rmzhl.
ls_iafvgd-objnr = ls_iafvgd_temp-objnr.
APPEND ls_iafvgd TO iafvgd.
ENDLOOP.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDFUNCTION.
Code: Alles auswählen.
CALL FUNCTION 'CO_EXT_ORDER_RESET'.
Folgende Benutzer bedankten sich beim Autor Julia.hrtm für den Beitrag (Insgesamt 4):
Thomas R. • Murdock • ewx • ST22