34
SCREEN PAINTER:- Screen painter is a tool in ABAP dev workbench used to create the screens using the T-code SE51. In the screen painter, you can define the following interface elements with their associated attributes. 1. Input/Output Fields 2. Field Names 3. Checkboxes 4. Radio Buttons 5. Group Boxes 6. Sub screens. 7. Pushbuttons with No Fixed Position and others STEP-BY-STEP DEMO FOR SCREEN PAINTER. Create a Z program in SE38 .

Screen Painter

Embed Size (px)

DESCRIPTION

Introduction to screen painter with screenshots

Citation preview

Page 1: Screen Painter

SCREEN PAINTER:-

 Screen painter is a tool in ABAP dev workbench used to create the screens using the

T-code SE51. In the screen painter, you can define the following interface elements with their associated attributes.1. Input/Output Fields2. Field Names3. Checkboxes4. Radio Buttons5. Group Boxes6. Sub screens.7. Pushbuttons with No Fixed Position

and others 

STEP-BY-STEP DEMO FOR SCREEN PAINTER. 

Create a Z program in SE38. 

Page 2: Screen Painter

 

Click on Save. We will write the code later in this. 

Go to transaction SE51. 

 

Enter the created program name and screen number. 

Page 3: Screen Painter

 Enter the short description and click on save. 

 

Click on flowlogic tab. 

Page 4: Screen Painter

 

Uncomment the statement “ MODULE STATUS_0100 “. 

 

Double click the “ status_0100.”

The below screen will be displayed,

Page 5: Screen Painter

Click on yes.

 

Following pop-up screen appears. Select the “zdemo_screen_painter”  “main program” and click on continue.

Click on yes.

Page 6: Screen Painter

 

Screen would be displayed as follows: 

 

Now come back to the transaction SE51. Select flow logic. Click in layout. 

Page 7: Screen Painter

 

Screen painter window will be displayed like this. Here we will design the required screen fields.

Click on the middle icon  dictionary / program fields window. Or F6. 

 

Following screen appears: 

Page 8: Screen Painter

 Enter the table name in the table field name.

Click on get from dictionary. 

 

Select the required fields from MARA table from dictionary. Click on OK or continue. 

Page 9: Screen Painter

 

 

After placing the required fields, you can view the below screen. 

Page 10: Screen Painter

 

Create the push button from the toolbox. 

 

Select the pushbutton, drag and drop the button onto the screen. 

Page 11: Screen Painter

Create the other required buttons in the same procedure mentioned above and assign the name, text, and function code for each one. 

 

After creating the screen click on save check and activate. 

Page 12: Screen Painter

 press flow logic button. . 

 

Click on tab Element List enter OK_CODE. 

 

Paste the below Code in created z program created earlier: 

Page 13: Screen Painter

*&-------------------------------------------------------------------**& Report ZDEMO_SCREEN_PAINTER*&*&-------------------------------------------------------------------**& Demo for Screen Painter.*& By Vikramchellappa.*&-------------------------------------------------------------------*REPORT ZDEMO_SCREEN_PAINTER.******************************************************************* TABLE DECLARATIONS.****************************************************************** TABLES: MARA.******************************************************************* DATA DECLARATIONS.*****************************************************************DATA: MATNR TYPE MARA-MATNR, ERSDA TYPE MARA-ERSDA, ERNAM TYPE MARA-ERNAM, MTART TYPE MARA-MTART, MATKL TYPE MARA-MATKL, DISPLAY TYPE C, SAVE TYPE C, DELETE 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.

Page 14: Screen Painter

WHEN 'EXIT'. LEAVE PROGRAM. WHEN 'BACK'. LEAVE PROGRAM. WHEN 'DISPLAY'. SELECT SINGLE ERSDA ERNAM MTART MATKL FROM MARA INTO (MARA-ERSDA, MARA-ERNAM, MARA-MTART, MARA-MATKL) WHERE MATNR = MARA-MATNR. WHEN 'CLEAR'. CLEAR MARA. ENDCASE.ENDMODULE. " STATUS_0100 OUTPUT

Output:-

 Enter Material number On Material Field. Click on Display. 

 

Material Information is displayed as shown below: 

Page 15: Screen Painter

Demo on Tabstrips

In this document, we would work on creating a simple screen with a tabstrip on it. 

Go to SE38 T-code.

Create a Z program.

Page 16: Screen Painter

 

Paste the below code in the source code. 

REPORT ZTABSTRIP.************************************************************************* DATA DECLARATIONS *************************************************************************DATA : NUMBER1 TYPE I,NUMBER2 TYPE I,RESULT TYPE I,N1 TYPE I,N2 TYPE I,OK_CODE LIKE SY-UCOMM.CONTROLS TABSTRIP TYPE TABSTRIP.CALL SCREEN 100.CALL SCREEN 110.CALL SCREEN 130.*&---------------------------------------------------------------------**& Module STATUS_0100 OUTPUT*&---------------------------------------------------------------------*

Page 17: Screen Painter

text*----------------------------------------------------------------------*MODULE STATUS_0100 OUTPUT.SET PF-STATUS 'BACK'.ENDMODULE. " STATUS_0100 OUTPUT*&---------------------------------------------------------------------**& Module USER_COMMAND_0100 INPUT*&---------------------------------------------------------------------*text*----------------------------------------------------------------------*MODULE USER_COMMAND_0100 INPUT.CASE OK_CODE.WHEN 'TAB1'.TABSTRIP-ACTIVETAB = 'TAB1'.WHEN 'TAB2'.TABSTRIP-ACTIVETAB = 'TAB2'.RESULT = NUMBER1 + NUMBER2.WHEN 'BACK'.LEAVE PROGRAM.ENDCASE.ENDMODULE. " USER_COMMAND_0100 INPUT*&---------------------------------------------------------------------**& Module USER_COMMAND_0130 INPUT*&---------------------------------------------------------------------*text*----------------------------------------------------------------------*MODULE USER_COMMAND_0130 INPUT.RESULT = NUMBER1 + NUMBER2.ENDMODULE. " USER_COMMAND_0130 INPUT*&---------------------------------------------------------------------**& Module USER_COMMAND_0110 INPUT*&---------------------------------------------------------------------*text*----------------------------------------------------------------------*MODULE USER_COMMAND_0110 INPUT.N1 = NUMBER1.N2 = NUMBER2.ENDMODULE. " USER_COMMAND_0110 INPUT*&---------------------------------------------------------------------*

Page 18: Screen Painter

*& Module STATUS_0110 OUTPUT*&---------------------------------------------------------------------*text*----------------------------------------------------------------------*MODULE STATUS_0110 OUTPUT.SET PF-STATUS 'xxxxxxxx'.SET TITLEBAR 'xxx'.ENDMODULE. " STATUS_0110 OUTPUT*&---------------------------------------------------------------------**& Module STATUS_0130 OUTPUT*&---------------------------------------------------------------------*text*----------------------------------------------------------------------*MODULE STATUS_0130 OUTPUT.SET PF-STATUS 'xxxxxxxx'.SET TITLEBAR 'xxx'.RESULT = NUMBER1 + NUMBER2.ENDMODULE. " STATUS_0130 OUTPUT

Double Click on "call screen 100". 

Page 19: Screen Painter

Enter Short descriptions.

Come to Flow logic.

 

Click on Layout Button.   or Press Ctrl+F7. 

Page 20: Screen Painter

 

Create A Tab Strip and Sub screens and place Sub screen in the appropriate tab strip. 

 

Enter the name of the created TABSTRIP and sub SCREEN. 

Page 21: Screen Painter

 

Enter the required Name, Text, Function code.

 

Page 22: Screen Painter

 

Enter the OK_CODE. 

 

Double click on CALL SCREEN 110.

Give the short description.

Click on SAVE , CHECK, ACTIVATE .  

Page 23: Screen Painter

 

Click on Flow logic and come to layout.

Create 2 Input fields. Enter the name description and Format. 

 

Page 24: Screen Painter

Click on SAVE , CHECK, ACTIVATE . 

Double click on CALL SCREEN 130.

Give the SHORT DESCRIPTION. Click on LAYOUT . 

Page 25: Screen Painter

 

Create a text for Result. 

 

Page 26: Screen Painter

Click on SAVE , CHECK, ACTIVATE . 

Come Back To Source Code. 

Click on SAVE , CHECK, ACTIVATE . 

And EXECUTE.  

Result:- 

 

Enter the Value on A = 50 and B = 50. 

Page 27: Screen Painter

 

View the Result on Tab2. 

Page 28: Screen Painter

Demo on using Table Control

By Raghav Vakada, MouriTech Solutions

*&---------------------------------------------------------------------**& Report Z_DB_TABLECONTROL **& **&---------------------------------------------------------------------**& **& **&---------------------------------------------------------------------*REPORT Z_DB_TABLECONTROL.TABLES: MARA.CONTROLS MATERIAL TYPE TABLEVIEW USING SCREEN 130.TYPES: BEGIN OF ST_MARA, MATNR TYPE MARA-MATNR, ERSDA TYPE MARA-ERSDA, ERNAM TYPE MARA-ERNAM, LAEDA TYPE MARA-LAEDA, END OF ST_MARA.DATA: IT_ST TYPE TABLE OF ST_MARA, WA_ST TYPE ST_MARA, IT_MARA TYPE MARA, WA_MARA TYPE MARA, OK_CODE LIKE SY-UCOMM.CALL SCREEN 130.*&---------------------------------------------------------------------**& Module V1 INPUT*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*MODULE V1 INPUT.CASE OK_CODE.WHEN 'SAVE'.WA_ST-MATNR = MARA-MATNR.WA_ST-ERSDA = MARA-ERSDA.WA_ST-ERNAM = MARA-ERNAM.WA_ST-LAEDA = MARA-LAEDA.

Page 29: Screen Painter

MOVE-CORRESPONDING WA_ST TO WA_MARA.INSERT INTO MARA VALUES WA_MARA.WHEN 'DELETE'.WA_ST-MATNR = MARA-MATNR.WA_ST-ERSDA = MARA-ERSDA.WA_ST-ERNAM = MARA-ERNAM.WA_ST-LAEDA = MARA-LAEDA.MOVE-CORRESPONDING WA_ST TO WA_MARA.DELETE MARA FROM WA_MARA.WHEN 'MODIFY'.WA_ST-MATNR = MARA-MATNR.WA_ST-ERSDA = MARA-ERSDA.WA_ST-ERNAM = MARA-ERNAM.WA_ST-LAEDA = MARA-LAEDA.MOVE-CORRESPONDING WA_ST TO WA_MARA.MODIFY MARA FROM WA_MARA.ENDCASE.ENDMODULE. " V1 INPUT*&---------------------------------------------------------------------**& Module EXIT INPUT*&---------------------------------------------------------------------** text*----------------------------------------------------------------------*MODULE EXIT INPUT.IF OK_CODE = 'EXIT'.LEAVE PROGRAM.ENDIF.ENDMODULE. " EXIT INPUTCreate a screen by number 130 and provide the following attributes:

Page 30: Screen Painter

 

LAYOUT:

 

ELEMENT LIST:

Page 31: Screen Painter

 

FLOW LOGIC.

 

EXECUTE: 

Page 32: Screen Painter