*&---------------------------------------------------------------------*
*& TABLE CONTROL 144: FINALIZE RESULT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TBC_144'
TYPES: BEGIN OF T_TBC_144,
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_144.
*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TBC_144'
DATA: G_TBC_144_ITAB TYPE T_TBC_144 OCCURS 0,
G_TBC_144_WA TYPE T_TBC_144. "WORK AREA
DATA: G_TBC_144_COPIED. "COPY FLAG
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TBC_144' ITSELF
CONTROLS: TBC_144 TYPE TABLEVIEW USING SCREEN 0144.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_144'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE TBC_144_INIT OUTPUT.
IF G_TBC_144_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'ZPROJECT_EMP'
*&SPWIZARD: INTO INTERNAL TABLE 'G_TBC_144_ITAB'
SELECT * FROM ZPROJECT_EMP
INTO CORRESPONDING FIELDS
OF TABLE G_TBC_144_ITAB.
G_TBC_144_COPIED = 'X'.
REFRESH CONTROL 'TBC_144' FROM SCREEN '0144'.
SORT G_TBC_144_ITAB BY EMP_ID ASCENDING.
ENDIF.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_144'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE TBC_144_MOVE OUTPUT.
MOVE-CORRESPONDING G_TBC_144_WA TO ZPROJECT_EMP.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TBC_144'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TBC_144_MODIFY INPUT.
MOVE-CORRESPONDING ZPROJECT_EMP TO G_TBC_144_WA.
MODIFY G_TBC_144_ITAB
FROM G_TBC_144_WA
INDEX TBC_144-CURRENT_LINE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& MODULE STATUS_0144 OUTPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE STATUS_0144 OUTPUT.
SET PF-STATUS '144'.
SET TITLEBAR '144'.
ENDMODULE. " STATUS_0144 OUTPUT
*&---------------------------------------------------------------------*
*& MODULE USER_COMMAND_0144 INPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0144 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_144_ITAB INTO ZPROJECT_EMP WITH KEY MARK = 'X'.
CALL SCREEN 146.
ENDCASE.
ENDMODULE. " USER_COMMAND_0144 INPUT
Output:
*& TABLE CONTROL 144: FINALIZE RESULT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TBC_144'
TYPES: BEGIN OF T_TBC_144,
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_144.
*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TBC_144'
DATA: G_TBC_144_ITAB TYPE T_TBC_144 OCCURS 0,
G_TBC_144_WA TYPE T_TBC_144. "WORK AREA
DATA: G_TBC_144_COPIED. "COPY FLAG
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TBC_144' ITSELF
CONTROLS: TBC_144 TYPE TABLEVIEW USING SCREEN 0144.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_144'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE TBC_144_INIT OUTPUT.
IF G_TBC_144_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'ZPROJECT_EMP'
*&SPWIZARD: INTO INTERNAL TABLE 'G_TBC_144_ITAB'
SELECT * FROM ZPROJECT_EMP
INTO CORRESPONDING FIELDS
OF TABLE G_TBC_144_ITAB.
G_TBC_144_COPIED = 'X'.
REFRESH CONTROL 'TBC_144' FROM SCREEN '0144'.
SORT G_TBC_144_ITAB BY EMP_ID ASCENDING.
ENDIF.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_144'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE TBC_144_MOVE OUTPUT.
MOVE-CORRESPONDING G_TBC_144_WA TO ZPROJECT_EMP.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TBC_144'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TBC_144_MODIFY INPUT.
MOVE-CORRESPONDING ZPROJECT_EMP TO G_TBC_144_WA.
MODIFY G_TBC_144_ITAB
FROM G_TBC_144_WA
INDEX TBC_144-CURRENT_LINE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& MODULE STATUS_0144 OUTPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE STATUS_0144 OUTPUT.
SET PF-STATUS '144'.
SET TITLEBAR '144'.
ENDMODULE. " STATUS_0144 OUTPUT
*&---------------------------------------------------------------------*
*& MODULE USER_COMMAND_0144 INPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0144 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_144_ITAB INTO ZPROJECT_EMP WITH KEY MARK = 'X'.
CALL SCREEN 146.
ENDCASE.
ENDMODULE. " USER_COMMAND_0144 INPUT
Output:
employee list to view result