**&-------------------------------------------------------------------*
*& Report Zprogram
*&
*&-------------------------------------------------------------------*
*& Demo for Screen Painter.
*&
*&-------------------------------------------------------------------*
REPORT ZPROGRAM.
******************************************************************
* TABLE DECLARATIONS.
******************************************************************
TABLES : zstudents.
******************************************************************
* DATA DECLARATIONS.
*****************************************************************
DATA : rollnum TYPE zstudents-rollnum,
name TYPE zstudents-name,
phone TYPE zstudents-phone,
address TYPE zstudents-address,
DISPLAY TYPE C,
CLEAR TYPE C,
EXIT TYPE C,
OK_CODE LIKE SY-UCOMM.
*****************************************************************
* CALLING SCREEN.
*****************************************************************
CALL SCREEN 100.
*&--------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&--------------------------------------------------------------*
* text
*--------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
* SET PF-STATUS 'ZMENU'.
* SET TITLEBAR 'ZMENU_PAINTER'.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'DISPLAY'.
SELECT SINGLE rollnum name phone address FROM zstudents
INTO (zstudents-rollnum , zstudents-name , zstudents-phone, zstudents-address)
WHERE rollnum = zstudents-rollnum.
WHEN 'CLEAR'.
CLEAR zstudents.
ENDCASE.
ENDMODULE. " STATUS_0100 OUTPUT&---------------------------------------------------------------------*
*& Report Zprogram
*&
*&-------------------------------------------------------------------*
*& Demo for Screen Painter.
*&
*&-------------------------------------------------------------------*
REPORT ZPROGRAM.
******************************************************************
* TABLE DECLARATIONS.
******************************************************************
TABLES : zstudents.
******************************************************************
* DATA DECLARATIONS.
*****************************************************************
DATA : rollnum TYPE zstudents-rollnum,
name TYPE zstudents-name,
phone TYPE zstudents-phone,
address TYPE zstudents-address,
DISPLAY TYPE C,
CLEAR TYPE C,
EXIT TYPE C,
OK_CODE LIKE SY-UCOMM.
*****************************************************************
* CALLING SCREEN.
*****************************************************************
CALL SCREEN 100.
*&--------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&--------------------------------------------------------------*
* text
*--------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
* SET PF-STATUS 'ZMENU'.
* SET TITLEBAR 'ZMENU_PAINTER'.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'DISPLAY'.
SELECT SINGLE rollnum name phone address FROM zstudents
INTO (zstudents-rollnum , zstudents-name , zstudents-phone, zstudents-address)
WHERE rollnum = zstudents-rollnum.
WHEN 'CLEAR'.
CLEAR zstudents.
ENDCASE.
ENDMODULE. " STATUS_0100 OUTPUT&---------------------------------------------------------------------*
EXAMPLE-2:
*&---------------------------------------------------------------------*
*& REPORT ZDEMO_MULTIPLE_SUBSCREEN
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZDEMO_MULTIPLE_SUBSCREEN.
DATA :
NAME(20), "NAME
PHYSICS TYPE I,
CHEMISTRY TYPE I ,
MATHS TYPE I,
TOTAL TYPE I , "TOTAL MARKS
PERCENTAGE TYPE I, "PERCENTAGE
RESULT(5). "RESULT
data : SCREEN TYPE N LENGTH 4 VALUE 9100,
OK_CODE LIKE SY-UCOMM.
CALL SCREEN 9000.
CALL SCREEN 9100.
CALL SCREEN 9200.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9000 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
"When first subscreen called
WHEN 'EDIT'.
CLEAR : NAME , PHYSICS , CHEMISTRY , MATHS.
WHEN 'BACK'.
SCREEN = 9100.
WHEN 'DISPLAY'.
SCREEN = 9200.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
*& Module STATUS_9200 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_9200 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
TOTAL = PHYSICS + CHEMISTRY + MATHS.
PERCENTAGE = ( TOTAL / 3 ).
IF PHYSICS LT 40 OR CHEMISTRY LT 40
OR MATHS LT 40.
RESULT = 'FAIL'.
ELSE.
RESULT = 'PASS'.
ENDIF.
CASE OK_CODE.
"When first subscreen called
WHEN 'EDIT'.
CLEAR : NAME , TOTAL , PERCENTAGE , RESULT.
ENDCASE.
ENDMODULE. " STATUS_9200 OUTPUT
" STATUS_9100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9100 INPUT.
CASE OK_CODE.
"When first subscreen called
WHEN 'EDIT'.
CLEAR : NAME , PHYSICS , CHEMISTRY , MATHS.
ENDCASE.
ENDMODULE. " USER_COMMAND_9100 INPUT
*& REPORT ZDEMO_MULTIPLE_SUBSCREEN
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZDEMO_MULTIPLE_SUBSCREEN.
DATA :
NAME(20), "NAME
PHYSICS TYPE I,
CHEMISTRY TYPE I ,
MATHS TYPE I,
TOTAL TYPE I , "TOTAL MARKS
PERCENTAGE TYPE I, "PERCENTAGE
RESULT(5). "RESULT
data : SCREEN TYPE N LENGTH 4 VALUE 9100,
OK_CODE LIKE SY-UCOMM.
CALL SCREEN 9000.
CALL SCREEN 9100.
CALL SCREEN 9200.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9000 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
"When first subscreen called
WHEN 'EDIT'.
CLEAR : NAME , PHYSICS , CHEMISTRY , MATHS.
WHEN 'BACK'.
SCREEN = 9100.
WHEN 'DISPLAY'.
SCREEN = 9200.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
*& Module STATUS_9200 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_9200 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
TOTAL = PHYSICS + CHEMISTRY + MATHS.
PERCENTAGE = ( TOTAL / 3 ).
IF PHYSICS LT 40 OR CHEMISTRY LT 40
OR MATHS LT 40.
RESULT = 'FAIL'.
ELSE.
RESULT = 'PASS'.
ENDIF.
CASE OK_CODE.
"When first subscreen called
WHEN 'EDIT'.
CLEAR : NAME , TOTAL , PERCENTAGE , RESULT.
ENDCASE.
ENDMODULE. " STATUS_9200 OUTPUT
" STATUS_9100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9100 INPUT.
CASE OK_CODE.
"When first subscreen called
WHEN 'EDIT'.
CLEAR : NAME , PHYSICS , CHEMISTRY , MATHS.
ENDCASE.
ENDMODULE. " USER_COMMAND_9100 INPUT