*&---------------------------------------------------------------------*
*& MODULE STATUS_0138 OUTPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE STATUS_0138 OUTPUT.
SET PF-STATUS '138'.
SET TITLEBAR '138'.
TYPE-POOLS : VRM.
SELECT *
FROM ZPROJECT_DETAILS
INTO TABLE PROJECT_DETAILS WHERE EMP_ID = ZPROJECT_EMP-EMP_ID.
LOOP AT PROJECT_DETAILS INTO TEMP_DETAILS.
WA_LISTBOX-KEY = TEMP_DETAILS-PROJECT_START_DATE.
WA_LISTBOX-TEXT = TEMP_DETAILS-PROJECT_START_DATE.
APPEND WA_LISTBOX TO IT_LISTBOX.
ENDLOOP.
LD_FIELD = 'PROJECT_START_DATE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = LD_FIELD
VALUES = IT_LISTBOX.
REFRESH IT_LISTBOX.
SELECT *
FROM ZPROJECT_DETAILS
INTO TABLE PROJECT_DETAILS WHERE EMP_ID = ZPROJECT_EMP-EMP_ID.
LOOP AT PROJECT_DETAILS INTO TEMP_DETAILS.
WA_LISTBOX-KEY = TEMP_DETAILS-PROJECT_END_DATE.
WA_LISTBOX-TEXT = TEMP_DETAILS-PROJECT_END_DATE.
APPEND WA_LISTBOX TO IT_LISTBOX.
ENDLOOP.
LD_FIELD = 'PROJECT_END_DATE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = LD_FIELD
VALUES = IT_LISTBOX.
REFRESH IT_LISTBOX.
SELECT SINGLE EMP_ID EMP_NAME DEPT_NAME FROM ZPROJECT_EMP INTO
(ZPROJECT_EMP-EMP_ID, ZPROJECT_EMP-EMP_NAME , ZPROJECT_EMP-DEPT_NAME)
WHERE EMP_ID = USER_ID.
CASE SY-UCOMM.
WHEN 'OK'.
SELECT SINGLE PROJECT_ID PROJECT_NAME PROJECT_DESCRIPTION PROJECT_STATUS
FROM ZPROJECT_DETAILS
INTO (PROJECT_ID , PROJECT_NAME , PROJECT_DESCRIPTION ,PROJECT_STATUS )
WHERE EMP_ID = USER_ID AND PROJECT_START_DATE EQ PROJECT_START_DATE AND PROJECT_END_DATE EQ
PROJECT_END_DATE.
ENDCASE.
ENDMODULE. " STATUS_0138 OUTPUT
*&---------------------------------------------------------------------*
*& MODULE USER_COMMAND_0138 INPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0138 INPUT.
CASE SY-UCOMM.
WHEN 'SUBMIT'.
TEMP_ID = USER_ID.
TEMP_DETAILS-EMP_ID = USER_ID.
TEMP_DETAILS-EMP_NAME = ZPROJECT_EMP-EMP_NAME.
TEMP_DETAILS-DEPT_NAME = ZPROJECT_EMP-DEPT_NAME.
TEMP_DETAILS-PROJECT_ID = PROJECT_ID.
TEMP_DETAILS-PROJECT_NAME = PROJECT_NAME.
TEMP_DETAILS-PROJECT_DESCRIPTION = PROJECT_DESCRIPTION.
TEMP_DETAILS-PROJECT_START_DATE = PROJECT_START_DATE.
TEMP_DETAILS-PROJECT_END_DATE = PROJECT_END_DATE.
IF COMPLETE = 'X'.
PROJECT_STATUS = 'COMPLETE'.
TEMP_DETAILS-PROJECT_STATUS = PROJECT_STATUS.
ELSEIF UNDER_PROCESS = 'X'.
PROJECT_STATUS = 'UNDER PROCESS'.
TEMP_DETAILS-PROJECT_STATUS = PROJECT_STATUS.
ELSEIF NOT_STARTED = 'X'.
PROJECT_STATUS = 'NOT STARTED'.
TEMP_DETAILS-PROJECT_STATUS = PROJECT_STATUS.
ENDIF.
MODIFY ZPROJECT_DETAILS FROM TEMP_DETAILS.
MESSAGE I005(ZMSG_EAS).
CLEAR : PROJECT_NAME , PROJECT_DESCRIPTION, PROJECT_ID, PROJECT_START_DATE, PROJECT_START_DATE ,
PROJECT_END_DATE , PROJECT_STATUS.
CALL SCREEN 115.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
CLEAR : PROJECT_NAME , PROJECT_DESCRIPTION, PROJECT_ID, PROJECT_START_DATE,
PROJECT_END_DATE , PROJECT_STATUS , USER_ID , PASSWORD.
CALL SCREEN 1000.
WHEN 'BACK'.
CLEAR : PROJECT_NAME , PROJECT_DESCRIPTION, PROJECT_ID, PROJECT_START_DATE,
PROJECT_END_DATE , PROJECT_STATUS .
CALL SCREEN 115.
ENDCASE.
ENDMODULE. " USER_COMMAND_0138 INPUT
Output:
*& MODULE STATUS_0138 OUTPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE STATUS_0138 OUTPUT.
SET PF-STATUS '138'.
SET TITLEBAR '138'.
TYPE-POOLS : VRM.
SELECT *
FROM ZPROJECT_DETAILS
INTO TABLE PROJECT_DETAILS WHERE EMP_ID = ZPROJECT_EMP-EMP_ID.
LOOP AT PROJECT_DETAILS INTO TEMP_DETAILS.
WA_LISTBOX-KEY = TEMP_DETAILS-PROJECT_START_DATE.
WA_LISTBOX-TEXT = TEMP_DETAILS-PROJECT_START_DATE.
APPEND WA_LISTBOX TO IT_LISTBOX.
ENDLOOP.
LD_FIELD = 'PROJECT_START_DATE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = LD_FIELD
VALUES = IT_LISTBOX.
REFRESH IT_LISTBOX.
SELECT *
FROM ZPROJECT_DETAILS
INTO TABLE PROJECT_DETAILS WHERE EMP_ID = ZPROJECT_EMP-EMP_ID.
LOOP AT PROJECT_DETAILS INTO TEMP_DETAILS.
WA_LISTBOX-KEY = TEMP_DETAILS-PROJECT_END_DATE.
WA_LISTBOX-TEXT = TEMP_DETAILS-PROJECT_END_DATE.
APPEND WA_LISTBOX TO IT_LISTBOX.
ENDLOOP.
LD_FIELD = 'PROJECT_END_DATE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = LD_FIELD
VALUES = IT_LISTBOX.
REFRESH IT_LISTBOX.
SELECT SINGLE EMP_ID EMP_NAME DEPT_NAME FROM ZPROJECT_EMP INTO
(ZPROJECT_EMP-EMP_ID, ZPROJECT_EMP-EMP_NAME , ZPROJECT_EMP-DEPT_NAME)
WHERE EMP_ID = USER_ID.
CASE SY-UCOMM.
WHEN 'OK'.
SELECT SINGLE PROJECT_ID PROJECT_NAME PROJECT_DESCRIPTION PROJECT_STATUS
FROM ZPROJECT_DETAILS
INTO (PROJECT_ID , PROJECT_NAME , PROJECT_DESCRIPTION ,PROJECT_STATUS )
WHERE EMP_ID = USER_ID AND PROJECT_START_DATE EQ PROJECT_START_DATE AND PROJECT_END_DATE EQ
PROJECT_END_DATE.
ENDCASE.
ENDMODULE. " STATUS_0138 OUTPUT
*&---------------------------------------------------------------------*
*& MODULE USER_COMMAND_0138 INPUT
*&---------------------------------------------------------------------*
* TEXT
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0138 INPUT.
CASE SY-UCOMM.
WHEN 'SUBMIT'.
TEMP_ID = USER_ID.
TEMP_DETAILS-EMP_ID = USER_ID.
TEMP_DETAILS-EMP_NAME = ZPROJECT_EMP-EMP_NAME.
TEMP_DETAILS-DEPT_NAME = ZPROJECT_EMP-DEPT_NAME.
TEMP_DETAILS-PROJECT_ID = PROJECT_ID.
TEMP_DETAILS-PROJECT_NAME = PROJECT_NAME.
TEMP_DETAILS-PROJECT_DESCRIPTION = PROJECT_DESCRIPTION.
TEMP_DETAILS-PROJECT_START_DATE = PROJECT_START_DATE.
TEMP_DETAILS-PROJECT_END_DATE = PROJECT_END_DATE.
IF COMPLETE = 'X'.
PROJECT_STATUS = 'COMPLETE'.
TEMP_DETAILS-PROJECT_STATUS = PROJECT_STATUS.
ELSEIF UNDER_PROCESS = 'X'.
PROJECT_STATUS = 'UNDER PROCESS'.
TEMP_DETAILS-PROJECT_STATUS = PROJECT_STATUS.
ELSEIF NOT_STARTED = 'X'.
PROJECT_STATUS = 'NOT STARTED'.
TEMP_DETAILS-PROJECT_STATUS = PROJECT_STATUS.
ENDIF.
MODIFY ZPROJECT_DETAILS FROM TEMP_DETAILS.
MESSAGE I005(ZMSG_EAS).
CLEAR : PROJECT_NAME , PROJECT_DESCRIPTION, PROJECT_ID, PROJECT_START_DATE, PROJECT_START_DATE ,
PROJECT_END_DATE , PROJECT_STATUS.
CALL SCREEN 115.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
CLEAR : PROJECT_NAME , PROJECT_DESCRIPTION, PROJECT_ID, PROJECT_START_DATE,
PROJECT_END_DATE , PROJECT_STATUS , USER_ID , PASSWORD.
CALL SCREEN 1000.
WHEN 'BACK'.
CLEAR : PROJECT_NAME , PROJECT_DESCRIPTION, PROJECT_ID, PROJECT_START_DATE,
PROJECT_END_DATE , PROJECT_STATUS .
CALL SCREEN 115.
ENDCASE.
ENDMODULE. " USER_COMMAND_0138 INPUT
Output:
screen to modify project details for selected year
display of details for the year selected
data submitted successfully after modifications
No comments:
Post a Comment