Home >Documents >Screen Painter

Screen Painter

Date post:18-Nov-2014
Category:
View:119 times
Download:0 times
Share this document with a friend
Description:
Introduction to screen painter with screenshots
Transcript:

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.

Click on Save. We will write the code later in this. Go to transaction SE51.

Enter the created program name and screen number.

Enter the short description and click on save.

Click on flowlogic tab.

Uncomment the statement MODULE STATUS_0100 .

Double click the status_0100. The below screen will be displayed,

Click on yes.

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

Click on yes.

Screen would be displayed as follows:

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

Screen painter window will be displayed like this. Here we will design the required screen fields.Click on the middle icon Or F6. dictionary / program fields window.

Following screen appears:

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.

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

Create the push button from the toolbox.

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

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.

press flow logic button.

.

Click on tab Element List enter OK_CODE.

Paste the below Code in created z program created earlier:

*&-------------------------------------------------------------------* *& 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. 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:

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.

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

*&---------------------------------------------------------------------* 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 *&---------------------------------------------------------------------* *& 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".

Enter Short descriptions.

Come to Flow logic.

Click on Layout Button.

or Press Ctrl+F7.

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.

Enter the required Name, Text, Function code.

Enter the OK_CODE.

Double click on CALL SCREEN 110. Give the short description. Click on SAVE , CHECK, ACTIVATE .

Click on Flow logic and come to layout. Create 2 Input fields. Enter the name description and Format.

Click on SAVE

, CHECK, ACTIVATE

.

Double click on CALL SCREEN 130.

Give the SHORT DESCRIPTION. Click on LAYOUT

.

Create a text for Result.

Click on SAVE

, CHECK, ACTIVATE

.

Come Back To Source Code. Click on SAVE And EXECUTE. Result:, CHECK, ACTIVATE .

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

View the Result on Tab2.

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. 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 INPUT Create a screen by number 130 and provide the following attributes:

LAYOUT:

ELEMENT LIST:

FLOW LOGIC.

EXECUTE:

Popular Tags:

Click here to load reader

Embed Size (px)
Recommended