Thursday 29 August 2013

AUGUST 29

 Screen painter is a tool in ABAP  workbench used to create the screens using the T-code SE51. In the screen painter, we 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


Steps to create a screen in a ABAP program:

1. Create a Z program in SE38.


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

2. Go to transaction SE51.


3. Enter the created program name and screen number.


4.  Enter the short description and click on save.

5. Click on flow logic tab.


6. Un-comment the statement “ MODULE STATUS_0100 “ and Double click the “ status_0100.”  A dialog box will appear "PBO Module STATUS_0100 does not exist. Create object?"

7. Click on yes.

A pop-up screen appears. Select the “zdemo_screen_painter”  “main program” and click on continue.
A dialog box appears " Screen Zdemo_screen_painter 0100 has been changed. Do you want to save?"

8. Click on yes.

Screen would be displayed as follows: 


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

9. 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:


10. Enter the table name in the table field name and Click on get from dictionary. 
Select the required fields from MARA table from dictionary. Click on OK or continue. 


11. Now place them appropriately on the screen created.


After placing the required fields on screen we can see the screen as follows:


12. Create the push button from the toolbox. Select the push button, drag and drop the button onto the screen. 

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

14. After creating the screen click on save check and activate. 


15.  press flow logic button on the screen.


16. Click on tab Element List enter OK_CODE. 

The below Code is written in ZPROGRAM 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: