chapter 05_step-by-step instructions for making a gui.ppt

36
IBM Global Business Services © IBM Corporation 2013 Step-by-Step Instructions for Making a GUI | Dec-2008 Step-by-Step Instructions for Making a GUI

Upload: bakkalibilal

Post on 25-Dec-2015

11 views

Category:

Documents


2 download

DESCRIPTION

Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

TRANSCRIPT

Page 1: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 2013Step-by-Step Instructions for Making a GUI |

Dec-2008

Step-by-Step Instructions for Making a GUI

Page 2: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 20132 Dec-2008Step-by-Step Instructions for Making a GUI |

Objectives

The participants will be able to: Use SET PF-STATUS syntax and be able to create a GUI Status.

Assign Function Codes to Function Keys.

Add an Icon to a Function Code.

Create Pushbuttons on the Application Toolbar.

Use The SY-PFKEY System Field.

Page 3: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 20133 Dec-2008Step-by-Step Instructions for Making a GUI |

DATA:WA_LFA1 TYPE LFA1.

START-OF-SELECTION.SELECT * FROM LFA1 INTO WA_LFA1.

WRITE: / WA_LFA1-LIFNR, 30 WA_LFA1-NAME1.ENDSELECT.

SET PF-STATUS ‘TEST1’.

A New ABAP

Reserved Word

SELECT * SY-SUBRCCHECK

Using SET PF-STATUS and Creating a GUI Status

SYNTAX: SET PF-STATUS <status name>.SYNTAX: SET PF-STATUS <status name>.

Coding Example

Page 4: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 20134 Dec-2008Step-by-Step Instructions for Making a GUI |

REPORT YGUI1-XX.

DATA: WA_LFA1 TYPE LFA1.

START-OF-SELECTION.SELECT * FROM LFA1 INTO WA_LFA1.

WRITE: / WA_LFA1-LIFNR, 30 WA_LFA1-NAME1.ENDSELECT.

SET PF-STATUS ‘TEST1’.

Double-click on the word ‘TEST1’.

Double Clicking GUI Status Name

SELECT * SY-SUBRCCHECK

Page 5: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 20135 Dec-2008Step-by-Step Instructions for Making a GUI |

Letting the System Create the GUI Status for You

Choose YES

Page 6: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 20136 Dec-2008Step-by-Step Instructions for Making a GUI |

Entering Administrative Information

Enter Some Descriptive text

Choose “Normal Screen” as Status

Type

Page 7: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 20137 Dec-2008Step-by-Step Instructions for Making a GUI |

Menu Painter Initial Display

You will create that will appear on the Menu Bar of your

GUI status by using these white text

boxes

You create the buttons that will appear on the

Application Toolbar of your GUI status by

using these white text boxes

Function Key assignments for all buttons

are shown here

Use the Drop-down button to get the Function Code

Page 8: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 20138 Dec-2008Step-by-Step Instructions for Making a GUI |

Expanding Menu Painter Display

Application Toolbar in the Menu Painter

Standard Toolbar in the Menu Painter

Standard Toolbar of your program

Application Toolbar of your program

Page 9: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 20139 Dec-2008Step-by-Step Instructions for Making a GUI |

Assigning Function Codes to Function Keys

To create a function code with an To create a function code with an icon associated to it, double-click icon associated to it, double-click on the function code, then choose on the function code, then choose

an icon.an icon.

Click once here. This is where we Click once here. This is where we will define our first function code.will define our first function code.

1st. 1st.

2nd. 2nd.

Page 10: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201310 Dec-2008Step-by-Step Instructions for Making a GUI |

Choose any icon.

Adding an Icon to a Function Code

Page 11: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201311 Dec-2008Step-by-Step Instructions for Making a GUI |

Function Code Attributes

Page 12: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201312 Dec-2008Step-by-Step Instructions for Making a GUI |

Creating Pushbuttons on the Application Toolbar

Type the function codes (RUNX and RUNY) of your buttons into

the next available white text boxes on the application toolbar.

Click SAVE to see the icons appear below the white boxes.

Page 13: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201313 Dec-2008Step-by-Step Instructions for Making a GUI |

Adding a Menu

Select the first available white text box for the menu bar, now populated with <List> and type “Test Menu”. Double-click on

this menu title to open it up (see next slide).

Page 14: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201314 Dec-2008Step-by-Step Instructions for Making a GUI |

Adding a Menu Path

TIP: If you wish to create a menu item with a breakout (submenu), leave the entry in the Func. column blank, and type a menu item name in the Name column. Then type a function code in the

breakout menu which appears.

Type RUNX and RUNY here.

Page 15: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201315 Dec-2008Step-by-Step Instructions for Making a GUI |

Automatic Recognition of Function Codes

The GUI must be activated

Page 16: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201316 Dec-2008Step-by-Step Instructions for Making a GUI |

Demonstration

Creation of a GUI status with pushbuttons on application toolbar and customized menu.

Page 17: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201317 Dec-2008Step-by-Step Instructions for Making a GUI |

Practice

Creation of a GUI status with pushbuttons on application toolbar and customized menu.

Page 18: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201318 Dec-2008Step-by-Step Instructions for Making a GUI |

Using AT USER-COMMAND to Detect Function Codes

AT USER-COMMAND.CASE SY-UCOMM.

WHEN ‘RUNX’.WINDOW STARTING AT 10 4

ENDING AT 77 12.WRITE: / ‘The user chose X’.

WHEN ‘RUNY’.WINDOW STARTING AT 10 4

ENDING AT 77 12.WRITE: / ‘The user chose Y’.

ENDCASE.

Enter this code for the “AT USER-COMMAND” event.

Page 19: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201319 Dec-2008Step-by-Step Instructions for Making a GUI |

GUI Status for Detail Lists

Do you notice the problem with this GUI Do you notice the problem with this GUI Status?Status?

Page 20: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201320 Dec-2008Step-by-Step Instructions for Making a GUI |

For now just use the control menu box to close this window.

Problem:How does the user exit this window? There should be a button on the bottom of this window that allows the user to go back.

Problem with Detail List GUI Status

Page 21: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201321 Dec-2008Step-by-Step Instructions for Making a GUI |

Using a Different GUI Status Type for Dialog Boxes

NEW AND IMPROVED: TEST2Dialog box GUI Statuses automatically contain a

red cancel button.

Page 22: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201322 Dec-2008Step-by-Step Instructions for Making a GUI |

Demonstration

Creation of Dialog boxes with Exit button.

Page 23: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201323 Dec-2008Step-by-Step Instructions for Making a GUI |

Practice

Creation of Dialog boxes with Exit button.

Page 24: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201324 Dec-2008Step-by-Step Instructions for Making a GUI |

A Report that Uses more than One GUI Status - Code

Add this line of code. Then double-click on the word ‘TEST2’.

AT USER-COMMAND.CASE SY-UCOMM.

WHEN ‘RUNX’.SET PF-STATUS ‘TEST2’.WINDOW STARTING AT 10 4

ENDING AT 77 12.WRITE: / ‘The user chose X’.

WHEN ‘RUNY’.WINDOW STARTING AT 10 4

ENDING AT 77 12.WRITE: / ‘The user chose Y’.

ENDCASE.

Page 25: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201325 Dec-2008Step-by-Step Instructions for Making a GUI |

A Report that Uses More than One GUI Status - Administrative

Add some descriptive text, then choose “Dialog box” as the Status Type.

Page 26: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201326 Dec-2008Step-by-Step Instructions for Making a GUI |

Notice that “Dialog Box” statuses do not have menus or standard toolbars.

A Report that Uses More than One GUI Status - Menu Painter

Page 27: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201327 Dec-2008Step-by-Step Instructions for Making a GUI |

Function Codes Automatically Recognized by ABAP

Function Code Functionality Associated function key

Button on Toolbar

BACK Back F3

RW Cancel F12

%EX End F15

P-- Scroll to beginning F21

P- Scroll back one page F22

P+ Scroll forward one page

F23

P++ Scroll to end F24

Page 28: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201328 Dec-2008Step-by-Step Instructions for Making a GUI |

AT USER-COMMAND.CASE SY-UCOMM.

WHEN ‘RUNX’.SET PF-STATUS ‘TEST2’.WINDOW STARTING AT 10 4

ENDING AT 77 12.WRITE: / ‘The user chose X’.

WHEN ‘RUNY’.SET PF-STATUS ‘TEST3’.WINDOW STARTING AT 10 4

ENDING AT 77 12.WRITE: / ‘The user chose Y’.

ENDCASE.

Add this line of code.

Coding Example : A Report that Uses More Than One GUI Status

Page 29: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201329 Dec-2008Step-by-Step Instructions for Making a GUI |

SY-PFKEY = ‘TEST1’

SY-PFKEY = ‘TEST3’

A New ABAP

System Field

Which status is currently being used?

SYSTEM FIELD: SY-PFKEY

The SY-PFKEY System Field

Page 30: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201330 Dec-2008Step-by-Step Instructions for Making a GUI |

Demonstration

Use of more than one GUI Status in a program.

Page 31: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201331 Dec-2008Step-by-Step Instructions for Making a GUI |

Practice

Use of more than one GUI Status in a program.

Page 32: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201332 Dec-2008Step-by-Step Instructions for Making a GUI |

SYNTAX: SET TITLEBAR <titlebar name>.SYNTAX: SET TITLEBAR <titlebar name>.

AT USER-COMMAND.CASE SY-UCOMM.

WHEN ‘RUNX’.SET PF-STATUS ‘TEST2’.SET TITLEBAR ‘TB2’.WINDOW STARTING AT 10 4

ENDING AT 77 12.WRITE: / ‘The user chose X’.

WHEN ‘RUNY’.SET PF-STATUS ‘TEST3’.WINDOW STARTING AT 10 4

ENDING AT 77 12.WRITE: / ‘The user chose Y’.

ENDCASE.

A New ABAP

Reserved Word

Coding Example: Adding a GUI Title

Page 33: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201333 Dec-2008Step-by-Step Instructions for Making a GUI |

First

Choose Yes.

Second

Type in the text that youwant to appear on the titlebar

of your GUI Status. Use ampersands (&) if you want to use

variables. Then choose Save.

Adding A GUI Title - Administration

Page 34: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201334 Dec-2008Step-by-Step Instructions for Making a GUI |

Program’s GUI

Status 1

RUNXRUNYRUNZ

Status 2

RUNX

RUNA

Status 3

RUNC

RUNY

Status 4

RUNB

Function Codesfor Entire GUI

RUNARUNBRUNCRUNXRUNYRUNZ

Graphical User Interface

Page 35: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201335 Dec-2008Step-by-Step Instructions for Making a GUI |

Summary

GUI status name can be up to 20 characters and must be in Capital letters.

SY-PFKEY contains the name of current GUI status.

‘Dialog Box’ status does not have Menu or a Standard Toolbar.

GUI Title names can be up to 20 characters and must be in Capital letters.

Whenever we create a new window or dialog box, the exit button from the controlmenu must be used. Options to exit must be provided to the user.

A program can have any number of GUI statuses defined.

Function Codes can be defined with a maximum four characters long.

Page 36: Chapter 05_Step-By-Step Instructions for Making a GUI.ppt

IBM Global Business Services

© IBM Corporation 201336 Dec-2008Step-by-Step Instructions for Making a GUI |

Questions

What are the naming restrictions for a PF status ?

What are the naming restrictions for a GUI title ?

What is the difference between a ‘Normal Screen’ and a ‘Dialog Box’ status ?

What is the problem if the no buttons or Function codes are not included from thecontrol menu in a dialog box ?

How many GUI status can be defined for a program ?

Can we pass parameters to GUI title ?