*&---------------------------------------------------------------------* *& REPORT ZMM_PO_QUERY *& *& REPORTNAME :生产订单查询系统 *&---------------------------------------------------------------------* *& CREATED BY : LIUXINYUAN *& CREATED DATE : 2015-07-15 *&---------------------------------------------------------------------*
REPORT ZPP_CO_QUERY.
INCLUDE ZPP_CO_QUERY_TOP.
**选择屏幕
SELECTION-SCREENBEGINOFBLOCK MAIN WITHFRAMETITLETEXT-001. SELECT-OPTIONS:S_AUFNR FOR CAUFV-AUFNR.
SELECT-OPTIONS:S_WERKS FOR CAUFV-WERKS.
SELECT-OPTIONS:S_GSTRI FOR CAUFV-GSTRI.
SELECT-OPTIONS:S_GLTRI FOR CAUFV-GLTRI.
SELECTION-SCREENENDOFBLOCK MAIN.
AT SELECTION-SCREEN.
* LOOP AT S_WERKS. * AUTHORITY-CHECK OBJECT ‘Z_MM_003‘ * ID ‘WERKS‘ FIELD S_WERKS-LOW. * IF SY-SUBRC <> 0. * MESSAGE E019(ZMM001) WITH S_WERKS-LOW. * ENDIF. * ENDLOOP.
AT SELECTION-SCREENOUTPUT.
**主程序
START-OF-SELECTION.
PERFORM FRM_SELECT_DATA. PERFORM FRM_DISPLAY.
*&---------------------------------------------------------------------* *& FORM FRM_SELECT_DATA *&---------------------------------------------------------------------* * TEXT *----------------------------------------------------------------------* * --> P1 TEXT * <-- P2 TEXT *----------------------------------------------------------------------* FORM FRM_SELECT_DATA .
CALLFUNCTION‘SAPGUI_PROGRESS_INDICATOR‘ EXPORTING TEXT = ‘数据读取中.................‘.
REFRESH ITAB. CLEAR ITAB.
"机器 作业类型 1001 "工资 作业类型 1000 "其他 作业类型 1003 SELECT AUFNR
WERKS
AUART
KDAUF "销售订单编号
KDPOS "销售订单行项目
PLNBEZ
GAMNG
AUFPL
OBJNR
FTRMI INTO CORRESPONDING FIELDSOFTABLE ITAB FROM CAUFV WHERE AUFNR IN S_AUFNR AND WERKS IN S_WERKS AND GSTRI IN S_GSTRI AND GLTRI IN S_GLTRI.
IF ITAB[] ISNOTINITIAL. REFRESH IT_AFVV. CLEAR IT_AFVV. SELECT AUFPL
APLZL
VGW01
VGW02
VGW03 INTOTABLE IT_AFVV FROM AFVV FORALL ENTRIES IN ITAB WHERE AUFPL = ITAB-AUFPL.
REFRESH IT_AFVC. CLEAR IT_AFVC. SELECT AUFPL
APLZL
RUECK
ARBID INTOTABLE IT_AFVC FROM AFVC FORALL ENTRIES IN ITAB WHERE AUFPL = ITAB-AUFPL.
IF IT_AFVC[] ISNOTINITIAL. REFRESH IT_AFRU. CLEAR IT_AFRU. SELECT RUECK
RMZHL
ISM01
ISM02
ISM03
STOKZ INTOTABLE IT_AFRU FROM AFRU FORALL ENTRIES IN IT_AFVC WHERE RUECK = IT_AFVC-RUECK.
*&---------------------------------------------------------------------* *& FORM DISPLAY_DATA *&---------------------------------------------------------------------* * TEXT *----------------------------------------------------------------------* * --> P1 TEXT * <-- P2 TEXT *----------------------------------------------------------------------* FORM FRM_DISPLAY .
*&---------------------------------------------------------------------* *& FORM STANDARD_FULLSCREEN *&---------------------------------------------------------------------* * TEXT *----------------------------------------------------------------------* FORM SET_PF USING RT_EXTAB TYPE SLIS_T_EXTAB.