METHOD end_routine.
*=== Segments ===
FIELD-SYMBOLS:
<RESULT_FIELDS> TYPE _ty_s_TG_1.
DATA:
MONITOR_REC TYPE rstmonitor.
*$*$ begin of routine - insert your code only below this line *-*
TYPES: BEGIN OF ls_wctr,
PLANT TYPE /BI0/OIPLANT,
WORKCENTER TYPE /BI0/OIWORKCENTER,
WRKCT_RESP TYPE /BI0/OIWRKCT_RESP,
END OF ls_wctr,
BEGIN OF ls_wct,
PLANT TYPE /BI0/OIPLANT,
WORKCENTER TYPE /BI0/OIWORKCENTER,
PRODORDER TYPE /BI0/OIPRODORDER,
END OF ls_wct.
DATA: lt_wctr TYPE STANDARD TABLE OF ls_wctr,
wa_wctr TYPE ls_wctr,
lt_wct TYPE STANDARD TABLE OF ls_wct,
wa_wct TYPE ls_wct,
**** Populate workcenter from /BIC/APPAARBPL2 *************************
SELECT PLANT WORKCENTER PRODORDER FROM
/BIC/APPAARBPL2
INTO CORRESPONDING FIELDS OF TABLE lt_wct FOR ALL ENTRIES IN
RESULT_PACKAGE
WHERE PRODORDER = RESULT_PACKAGE-COORDER AND
PLANT = RESULT_PACKAGE-PLANT.
*** Polulate workCenter in DSO*****************************************
CLEAR wa_wct.
LOOP at RESULT_PACKAGE ASSIGNING <result_fields>.
READ TABLE lt_wct INTO wa_wct
WITH KEY PRODORDER = <result_fields>-COORDER
PLANT = <result_fields>-PLANT .
IF sy-subrc = 0.
<result_fields>-WORKCENTER = wa_wct-WORKCENTER.
ENDIF.
ENDLOOP.
***** Populate workcenter fron OBJNR ****************************
SELECT PLANT WORKCENTER WRKCT_RESP FROM
/BI0/PWORKCENTER
INTO CORRESPONDING FIELDS OF TABLE lt_wctr FOR ALL ENTRIES IN
RESULT_PACKAGE
WHERE WORKCENTER = RESULT_PACKAGE-WORKCENTER AND
PLANT = RESULT_PACKAGE-PLANT.
CLEAR wa_wctr.
LOOP at RESULT_PACKAGE ASSIGNING <result_fields>.
READ TABLE lt_wctr INTO wa_wctr
WITH KEY WORKCENTER = <result_fields>-WORKCENTER
PLANT = <result_fields>-PLANT.
IF sy-subrc = 0.
<result_fields>-WRKCT_RESP = wa_wctr-WRKCT_RESP.
ENDIF.
ENDLOOP.
*------------------------------------------------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |