*&---------------------------------------------------------------------*
*& 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
*&---------------------------------------------------------------------*
*& TAB 131 - ASSIGN RESULT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
*&SPWIZARD: FUNCTION CODES FOR TABSTRIP 'TAB_131'
CONSTANTS: BEGIN OF C_TAB_131,
TAB1 LIKE SY-UCOMM VALUE 'TAB_131_FC1',
TAB2 LIKE SY-UCOMM VALUE 'TAB_131_FC2',
TAB3 LIKE SY-UCOMM VALUE 'TAB_131_FC3',
END OF C_TAB_131.
*&SPWIZARD: DATA FOR TABSTRIP 'TAB_131'
CONTROLS: TAB_131 TYPE TABSTRIP.
DATA: BEGIN OF G_TAB_131,
SUBSCREEN LIKE SY-DYNNR,
PROG LIKE SY-REPID VALUE 'ZPROJECT_EAS',
PRESSED_TAB LIKE SY-UCOMM VALUE C_TAB_131-TAB1,
END OF G_TAB_131.
*&SPWIZARD: OUTPUT MODULE FOR TS 'TAB_131'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: SETS ACTIVE TAB
MODULE TAB_131_ACTIVE_TAB_SET OUTPUT.
TAB_131-ACTIVETAB = G_TAB_131-PRESSED_TAB.
CASE G_TAB_131-PRESSED_TAB.
WHEN C_TAB_131-TAB1.
G_TAB_131-SUBSCREEN = '0132'.
WHEN C_TAB_131-TAB2.
G_TAB_131-SUBSCREEN = '0133'.
WHEN C_TAB_131-TAB3.
G_TAB_131-SUBSCREEN = '0134'.
WHEN OTHERS.
*&SPWIZARD: DO NOTHING
ENDCASE.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TS 'TAB_131'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: GETS ACTIVE TAB
MODULE TAB_131_ACTIVE_TAB_GET INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN C_TAB_131-TAB1.
G_TAB_131-PRESSED_TAB = C_TAB_131-TAB1.
WHEN C_TAB_131-TAB2.
G_TAB_131-PRESSED_TAB = C_TAB_131-TAB2.
WHEN C_TAB_131-TAB3.
G_TAB_131-PRESSED_TAB = C_TAB_131-TAB3.
WHEN OTHERS.
*&SPWIZARD: DO NOTHING
ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& MODULE STATUS_0131 OUTPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE STATUS_0131 OUTPUT.
SET PF-STATUS '131'.
SET TITLEBAR '131'.
TYPE-POOLS : VRM.
SELECT *
FROM ZPROJECT_YEAR
INTO TABLE YEAR_DETAILS WHERE EMP_ID = ZPROJECT_EMP-EMP_ID.
LOOP AT YEAR_DETAILS INTO TEMP_YEAR.
WA_LISTBOX-KEY = TEMP_YEAR-START_DATE.
WA_LISTBOX-TEXT = TEMP_YEAR-START_DATE.
APPEND WA_LISTBOX TO IT_LISTBOX.
ENDLOOP.
LD_FIELD = 'START_DATE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = LD_FIELD
VALUES = IT_LISTBOX.
REFRESH IT_LISTBOX.
SELECT *
FROM ZPROJECT_YEAR
INTO TABLE YEAR_DETAILS WHERE EMP_ID = ZPROJECT_EMP-EMP_ID.
LOOP AT YEAR_DETAILS INTO TEMP_YEAR.
WA_LISTBOX-KEY = TEMP_YEAR-END_DATE.
WA_LISTBOX-TEXT = TEMP_YEAR-END_DATE.
APPEND WA_LISTBOX TO IT_LISTBOX.
ENDLOOP.
LD_FIELD = 'END_DATE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = LD_FIELD
VALUES = IT_LISTBOX.
REFRESH IT_LISTBOX.
ENDMODULE. " STATUS_0131 OUTPUT
No comments:
Post a Comment