*&---------------------------------------------------------------------*
*& TABLE CONTROL 147 - VIEW SUBMITTED FORM
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TBC_147'
TYPES: BEGIN OF T_TBC_147,
EMP_ID LIKE ZPROJECT_EMP-EMP_ID,
EMP_NAME LIKE ZPROJECT_EMP-EMP_NAME,
DEPT_NO LIKE ZPROJECT_EMP-DEPT_NO,
DEPT_NAME LIKE ZPROJECT_EMP-DEPT_NAME,
MARK LIKE ZPROJECT_EMP-MARK,
END OF T_TBC_147.
*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TBC_147'
DATA: G_TBC_147_ITAB TYPE T_TBC_147 OCCURS 0,
G_TBC_147_WA TYPE T_TBC_147. "WORK AREA
DATA: G_TBC_147_COPIED. "COPY FLAG
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TBC_147' ITSELF
CONTROLS: TBC_147 TYPE TABLEVIEW USING SCREEN 0141.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_147'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE TBC_147_INIT OUTPUT.
IF G_TBC_147_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'ZPROJECT_EMP'
*&SPWIZARD: INTO INTERNAL TABLE 'G_TBC_147_ITAB'
SELECT * FROM ZPROJECT_EMP
INTO CORRESPONDING FIELDS
OF TABLE G_TBC_147_ITAB.
G_TBC_147_COPIED = 'X'.
REFRESH CONTROL 'TBC_147' FROM SCREEN '0141'.
SORT G_TBC_147_ITAB BY EMP_ID ASCENDING.
ENDIF.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_147'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE TBC_147_MOVE OUTPUT.
MOVE-CORRESPONDING G_TBC_147_WA TO ZPROJECT_EMP.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TBC_147'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TBC_147_MODIFY INPUT.
MOVE-CORRESPONDING ZPROJECT_EMP TO G_TBC_147_WA.
MODIFY G_TBC_147_ITAB
FROM G_TBC_147_WA
INDEX TBC_147-CURRENT_LINE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& MODULE USER_COMMAND_0141 INPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0141 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
CLEAR : USER_ID , PASSWORD.
CALL SCREEN 1000.
WHEN 'BACK'.
CALL SCREEN 145.
WHEN 'SUBMIT'.
READ TABLE G_TBC_147_ITAB INTO ZPROJECT_EMP WITH KEY MARK = 'X'.
CALL SCREEN 142.
ENDCASE.
ENDMODULE. " USER_COMMAND_0141 INPUT
*&---------------------------------------------------------------------*
*& MODULE STATUS_0141 OUTPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE STATUS_0141 OUTPUT.
SET PF-STATUS '141'.
SET TITLEBAR '141'.
SELECT SINGLE DEPT_NAME FROM ZPROJECT_AO INTO ZPROJECT_AO-DEPT_NAME WHERE AO_ID = USER_ID.
ENDMODULE. " STATUS_0141 OUTPUT
Output:
*& TABLE CONTROL 147 - VIEW SUBMITTED FORM
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TBC_147'
TYPES: BEGIN OF T_TBC_147,
EMP_ID LIKE ZPROJECT_EMP-EMP_ID,
EMP_NAME LIKE ZPROJECT_EMP-EMP_NAME,
DEPT_NO LIKE ZPROJECT_EMP-DEPT_NO,
DEPT_NAME LIKE ZPROJECT_EMP-DEPT_NAME,
MARK LIKE ZPROJECT_EMP-MARK,
END OF T_TBC_147.
*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TBC_147'
DATA: G_TBC_147_ITAB TYPE T_TBC_147 OCCURS 0,
G_TBC_147_WA TYPE T_TBC_147. "WORK AREA
DATA: G_TBC_147_COPIED. "COPY FLAG
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TBC_147' ITSELF
CONTROLS: TBC_147 TYPE TABLEVIEW USING SCREEN 0141.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_147'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE TBC_147_INIT OUTPUT.
IF G_TBC_147_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'ZPROJECT_EMP'
*&SPWIZARD: INTO INTERNAL TABLE 'G_TBC_147_ITAB'
SELECT * FROM ZPROJECT_EMP
INTO CORRESPONDING FIELDS
OF TABLE G_TBC_147_ITAB.
G_TBC_147_COPIED = 'X'.
REFRESH CONTROL 'TBC_147' FROM SCREEN '0141'.
SORT G_TBC_147_ITAB BY EMP_ID ASCENDING.
ENDIF.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_147'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE TBC_147_MOVE OUTPUT.
MOVE-CORRESPONDING G_TBC_147_WA TO ZPROJECT_EMP.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TBC_147'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TBC_147_MODIFY INPUT.
MOVE-CORRESPONDING ZPROJECT_EMP TO G_TBC_147_WA.
MODIFY G_TBC_147_ITAB
FROM G_TBC_147_WA
INDEX TBC_147-CURRENT_LINE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& MODULE USER_COMMAND_0141 INPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0141 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
CLEAR : USER_ID , PASSWORD.
CALL SCREEN 1000.
WHEN 'BACK'.
CALL SCREEN 145.
WHEN 'SUBMIT'.
READ TABLE G_TBC_147_ITAB INTO ZPROJECT_EMP WITH KEY MARK = 'X'.
CALL SCREEN 142.
ENDCASE.
ENDMODULE. " USER_COMMAND_0141 INPUT
*&---------------------------------------------------------------------*
*& MODULE STATUS_0141 OUTPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE STATUS_0141 OUTPUT.
SET PF-STATUS '141'.
SET TITLEBAR '141'.
SELECT SINGLE DEPT_NAME FROM ZPROJECT_AO INTO ZPROJECT_AO-DEPT_NAME WHERE AO_ID = USER_ID.
ENDMODULE. " STATUS_0141 OUTPUT
Output:
list of employees to view submitted forms