Example programs using screen painter.
Example-1:
Report Z92PROGRAM2
TABLES : zstudents, zpractice.
******************************************************************
* DATA DECLARATIONS.
*****************************************************************
DATA : rollnum TYPE zstudents-rollnum,
name TYPE zstudents-name,
phone TYPE zstudents-phone,
address TYPE zstudents-address,
total type zpractice-total,
branch TYPE zpractice-branch,
SUBMIT TYPE C,
RESET TYPE C,
EXIT TYPE C,
OK_CODE LIKE SY-UCOMM.
*&---------------------------------------------------------------------*
*& Report Z92PROGRAM3
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z92PROGRAM3 NO STANDARD PAGE HEADING .
TABLES: ZSTUDENTS, ZPRACTICE.
DATA :
ROLLNUM TYPE ZSTUDENTS-ROLLNUM,
BRANCH TYPE ZPRACTICE-BRANCH,
TOTAL TYPE ZPRACTICE-TOTAL,
MARKS_1 TYPE ZPRACTICE-MARKS_1,
MARKS_2 TYPE ZPRACTICE-MARKS_2,
MARKS_3 TYPE ZPRACTICE-MARKS_3,
MARKS_4 TYPE ZPRACTICE-MARKS_4,
NAME TYPE ZSTUDENTS-NAME,
PHONE TYPE ZSTUDENTS-PHONE,
ADDRESS TYPE ZSTUDENTS-ADDRESS.
DATA:
screen TYPE n LENGTH 4 VALUE 0110,
ok_code LIKE sy-ucomm.
CALL SCREEN 100.
CALL SCREEN 110.
CALL SCREEN 120.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'ZMENU'.
ENDMODULE. " STATUS_0100 OUTPUT
*&----------------------------------------*
*&MODULE USER_COMMAND_100_INPUT
*&-----------------------------------------*
* TEXT
*&------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'DISPLAY'.
SCREEN = 0110.
WHEN 'EXIT' OR 'BACK' OR 'CANCEL'.
LEAVE PROGRAM.
WHEN 'NEXT'.
SCREEN = 0120.
ENDCASE.
ENDMODULE. "USER_COMMAND_0110 INPUT
*&--------------------------------------------------------------------*
*& Module STATUS_0110 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0110 OUTPUT.
SELECT SINGLE MARKS_1 MARKS_2 MARKS_3 MARKS_4
BRANCH TOTAL
FROM ZPRACTICE
INTO (ZPRACTICE-MARKS_1 , ZPRACTICE-MARKS_2 , ZPRACTICE-MARKS_3 ,
ZPRACTICE-MARKS_4 , ZPRACTICE-BRANCH , ZPRACTICE-TOTAL)
WHERE ROLLNUM = ZSTUDENTS-ROLLNUM.
CASE SY-UCOMM.
WHEN 'RESET'.
CLEAR ZSTUDENTS.
CLEAR ZPRACTICE.
ENDCASE.
ENDMODULE. " STATUS_0110 OUTPUT
*----------------------------------------------------------------------*
*---------------------------------------------------------------------*
*& Module STATUS_0120 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0120 OUTPUT.
SELECT SINGLE PHONE NAME ADDRESS
FROM ZSTUDENTS
INTO (ZSTUDENTS-PHONE , ZSTUDENTS-NAME , ZSTUDENTS-ADDRESS)
WHERE ROLLNUM = ZSTUDENTS-ROLLNUM.
CASE SY-UCOMM.
WHEN 'RESET'.
CLEAR ZSTUDENTS.
CLEAR ZPRACTICE.
ENDCASE.
ENDMODULE. " STATUS_0110 OUTPUT
Example-1:
&---------------------------------------------------------------------*
*& Report Z92PROGRAM2
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
*& Report Z92PROGRAM2
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
Report Z92PROGRAM2
TABLES : zstudents, zpractice.
******************************************************************
* DATA DECLARATIONS.
*****************************************************************
DATA : rollnum TYPE zstudents-rollnum,
name TYPE zstudents-name,
phone TYPE zstudents-phone,
address TYPE zstudents-address,
total type zpractice-total,
branch TYPE zpractice-branch,
SUBMIT TYPE C,
RESET TYPE C,
EXIT TYPE C,
OK_CODE LIKE SY-UCOMM.
*&---------------------------------------------------------------------*
*& CALLING SCREEN
*&---------------------------------------------------------------------*
CALL SCREEN 0101.
*& CALLING SCREEN
*&---------------------------------------------------------------------*
CALL SCREEN 0101.
*&---------------------------------------------------------------------*
*& Module STATUS_0101 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0101 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'SUBMIT'.
SELECT SINGLE rollnum name phone address FROM zstudents
INTO (zstudents-rollnum , zstudents-name , zstudents-phone, zstudents-address)
where rollnum = zstudents-rollnum.
SELECT SINGLE branch total from zpractice
INTO (zpractice-branch , zpractice-total)
WHERE rollnum = zstudents-rollnum.
WHEN 'RESET'.
CLEAR zstudents.
CLEAR zpractice.
ENDCASE.
ENDMODULE. " STATUS_0101 OUTPUT
*& Module STATUS_0101 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0101 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'SUBMIT'.
SELECT SINGLE rollnum name phone address FROM zstudents
INTO (zstudents-rollnum , zstudents-name , zstudents-phone, zstudents-address)
where rollnum = zstudents-rollnum.
SELECT SINGLE branch total from zpractice
INTO (zpractice-branch , zpractice-total)
WHERE rollnum = zstudents-rollnum.
WHEN 'RESET'.
CLEAR zstudents.
CLEAR zpractice.
ENDCASE.
ENDMODULE. " STATUS_0101 OUTPUT
Example-2:
*&---------------------------------------------------------------------*
*& Report Z92PROGRAM3
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z92PROGRAM3 NO STANDARD PAGE HEADING .
TABLES: ZSTUDENTS, ZPRACTICE.
DATA :
ROLLNUM TYPE ZSTUDENTS-ROLLNUM,
BRANCH TYPE ZPRACTICE-BRANCH,
TOTAL TYPE ZPRACTICE-TOTAL,
MARKS_1 TYPE ZPRACTICE-MARKS_1,
MARKS_2 TYPE ZPRACTICE-MARKS_2,
MARKS_3 TYPE ZPRACTICE-MARKS_3,
MARKS_4 TYPE ZPRACTICE-MARKS_4,
NAME TYPE ZSTUDENTS-NAME,
PHONE TYPE ZSTUDENTS-PHONE,
ADDRESS TYPE ZSTUDENTS-ADDRESS.
DATA:
screen TYPE n LENGTH 4 VALUE 0110,
ok_code LIKE sy-ucomm.
CALL SCREEN 100.
CALL SCREEN 110.
CALL SCREEN 120.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'ZMENU'.
ENDMODULE. " STATUS_0100 OUTPUT
*&----------------------------------------*
*&MODULE USER_COMMAND_100_INPUT
*&-----------------------------------------*
* TEXT
*&------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'DISPLAY'.
SCREEN = 0110.
WHEN 'EXIT' OR 'BACK' OR 'CANCEL'.
LEAVE PROGRAM.
WHEN 'NEXT'.
SCREEN = 0120.
ENDCASE.
ENDMODULE. "USER_COMMAND_0110 INPUT
*&--------------------------------------------------------------------*
*& Module STATUS_0110 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0110 OUTPUT.
SELECT SINGLE MARKS_1 MARKS_2 MARKS_3 MARKS_4
BRANCH TOTAL
FROM ZPRACTICE
INTO (ZPRACTICE-MARKS_1 , ZPRACTICE-MARKS_2 , ZPRACTICE-MARKS_3 ,
ZPRACTICE-MARKS_4 , ZPRACTICE-BRANCH , ZPRACTICE-TOTAL)
WHERE ROLLNUM = ZSTUDENTS-ROLLNUM.
CASE SY-UCOMM.
WHEN 'RESET'.
CLEAR ZSTUDENTS.
CLEAR ZPRACTICE.
ENDCASE.
ENDMODULE. " STATUS_0110 OUTPUT
*----------------------------------------------------------------------*
*---------------------------------------------------------------------*
*& Module STATUS_0120 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0120 OUTPUT.
SELECT SINGLE PHONE NAME ADDRESS
FROM ZSTUDENTS
INTO (ZSTUDENTS-PHONE , ZSTUDENTS-NAME , ZSTUDENTS-ADDRESS)
WHERE ROLLNUM = ZSTUDENTS-ROLLNUM.
CASE SY-UCOMM.
WHEN 'RESET'.
CLEAR ZSTUDENTS.
CLEAR ZPRACTICE.
ENDCASE.
ENDMODULE. " STATUS_0110 OUTPUT