*&---------------------------------------------------------------------*
*& TABLE CONTROL 1300 : ASSIGN RESULT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TBC_1300'
TYPES: BEGIN OF T_TBC_1300,
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_1300.
*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TBC_1300'
DATA: G_TBC_1300_ITAB TYPE T_TBC_1300 OCCURS 0,
G_TBC_1300_WA TYPE T_TBC_1300. "WORK AREA
DATA: G_TBC_1300_COPIED. "COPY FLAG
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TBC_1300' ITSELF
CONTROLS: TBC_1300 TYPE TABLEVIEW USING SCREEN 1300.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_1300'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE TBC_1300_INIT OUTPUT.
IF G_TBC_1300_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'ZPROJECT_EMP'
*&SPWIZARD: INTO INTERNAL TABLE 'G_TBC_1300_ITAB'
SELECT * FROM ZPROJECT_EMP
INTO CORRESPONDING FIELDS
OF TABLE G_TBC_1300_ITAB.
G_TBC_1300_COPIED = 'X'.
REFRESH CONTROL 'TBC_1300' FROM SCREEN '1300'.
SORT G_TBC_1300_ITAB BY EMP_ID ASCENDING.
ENDIF.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_1300'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE TBC_1300_MOVE OUTPUT.
MOVE-CORRESPONDING G_TBC_1300_WA TO ZPROJECT_EMP.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TBC_1300'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TBC_1300_MODIFY INPUT.
MOVE-CORRESPONDING ZPROJECT_EMP TO G_TBC_1300_WA.
MODIFY G_TBC_1300_ITAB
FROM G_TBC_1300_WA
INDEX TBC_1300-CURRENT_LINE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& MODULE STATUS_1300 OUTPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE STATUS_1300 OUTPUT.
SET PF-STATUS '1300'.
SET TITLEBAR '1300'.
ENDMODULE. " STATUS_1300 OUTPUT
*&---------------------------------------------------------------------*
*& MODULE USER_COMMAND_1300 INPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE USER_COMMAND_1300 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
CALL SCREEN 135.
WHEN 'CANCEL'.
CLEAR : USER_ID , PASSWORD.
CALL SCREEN 1000.
WHEN 'SUBMIT'.
READ TABLE G_TBC_1300_ITAB INTO ZPROJECT_EMP WITH KEY MARK = 'X'.
CALL SCREEN 124.
ENDCASE.
ENDMODULE. " USER_COMMAND_1300 INPUT
Output:
*& TABLE CONTROL 1300 : ASSIGN RESULT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TBC_1300'
TYPES: BEGIN OF T_TBC_1300,
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_1300.
*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TBC_1300'
DATA: G_TBC_1300_ITAB TYPE T_TBC_1300 OCCURS 0,
G_TBC_1300_WA TYPE T_TBC_1300. "WORK AREA
DATA: G_TBC_1300_COPIED. "COPY FLAG
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TBC_1300' ITSELF
CONTROLS: TBC_1300 TYPE TABLEVIEW USING SCREEN 1300.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_1300'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE TBC_1300_INIT OUTPUT.
IF G_TBC_1300_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'ZPROJECT_EMP'
*&SPWIZARD: INTO INTERNAL TABLE 'G_TBC_1300_ITAB'
SELECT * FROM ZPROJECT_EMP
INTO CORRESPONDING FIELDS
OF TABLE G_TBC_1300_ITAB.
G_TBC_1300_COPIED = 'X'.
REFRESH CONTROL 'TBC_1300' FROM SCREEN '1300'.
SORT G_TBC_1300_ITAB BY EMP_ID ASCENDING.
ENDIF.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TBC_1300'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE TBC_1300_MOVE OUTPUT.
MOVE-CORRESPONDING G_TBC_1300_WA TO ZPROJECT_EMP.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TBC_1300'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TBC_1300_MODIFY INPUT.
MOVE-CORRESPONDING ZPROJECT_EMP TO G_TBC_1300_WA.
MODIFY G_TBC_1300_ITAB
FROM G_TBC_1300_WA
INDEX TBC_1300-CURRENT_LINE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& MODULE STATUS_1300 OUTPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE STATUS_1300 OUTPUT.
SET PF-STATUS '1300'.
SET TITLEBAR '1300'.
ENDMODULE. " STATUS_1300 OUTPUT
*&---------------------------------------------------------------------*
*& MODULE USER_COMMAND_1300 INPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE USER_COMMAND_1300 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
CALL SCREEN 135.
WHEN 'CANCEL'.
CLEAR : USER_ID , PASSWORD.
CALL SCREEN 1000.
WHEN 'SUBMIT'.
READ TABLE G_TBC_1300_ITAB INTO ZPROJECT_EMP WITH KEY MARK = 'X'.
CALL SCREEN 124.
ENDCASE.
ENDMODULE. " USER_COMMAND_1300 INPUT
Output:
list of employees to assign result