Vous êtes sur la page 1sur 25

IBM Global Business Services

Welcome

Utility Topics

IBM Corporation 2013

Course Title
IBM Global Business Services

Module 5: Utility Topics

(Optional client
logo can
be placed here)

IBM Corporation 2013

IBM Global Business Services

Housekeeping

Breaks
Washrooms
Transportation / parking
No pagers or cell phones
Participation
Parking lot issues
Questions

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Module objectives
At the completion of the module, the participants should be able to:
Understand Subscreen
Understand Graphical User Interface
Understand Message Types

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Module agenda
The topics dealt in this module are:
Subscreen Area in Main Screen
CALL SUBSCREEN in PBO
CALL SUBSCREEN in PAI
Creating a Subscreen
Subscreen restrictions
Menu Painter
Set GUI status / Title in PBO module
Checking Function Code Triggered
Using the OKCODE
Function types
MESSAGE statement
User Messages Table
Message types

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Subscreen Area in Main Screen

This subscreen area


must be given a name
up to 10 characters
long (for example, SUB1)

Utility Topics

IBM Corporation 2013

IBM Global Business Services

CALL SUBSCREEN in PBO


PROCESS BEFORE OUTPUT. for main screen 9010
* CALL SUBSCREEN <area> INCLUDING <program> <subscreen #>.
CALL SUBSCREEN SUB1 INCLUDING SAPMZSUB SCREEN_NUM.
This SCREEN_NUM variable
Customer
Name

11

contains the number of the

Tools International

subscreen to display in the specified


subscreen area.
Bank Information
(Subscreen)

Subscreen Area
SUB1

Address Information
(Subscreen)
7

Utility Topics

IBM Corporation 2013

IBM Global Business Services

CALL SUBSCREEN in PAI

11

Customer
Name

Tools International
To invoke the PAI event of the
actual subscreen, the
CALL SUBSCREEN statement
Address Information

must be used in

(Subscreen 9020)

the PAI event of the main screen.

PROCESS AFTER INPUT.

for main screen 9010

* CALL SUBSCREEN <area>.


CALL SUBSCREEN SUB1.
8

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Creating a Subscreen

Address Information

Bank Information

(Subscreen 9020)

(Subscreen 9030)
Screen
Screen Painter
Painter

Screen Attributes
Screen Type = Subscreen

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Subscreen restrictions

10

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Graphical User Interface (GUI)-an overview


Exit

Edit

Academy Awards
Year

1994

Category

Menu Painter

Loop

Using the Menu Painter, we can add


pushbuttons to the application toolbar
on both screens.

PIC

***Important Questions***
Exit

Update

Where do you set the GUI status / title?

Academy Awards

11

What type of GUI status is used?


How do you check the function code triggered?
What are the different function types?

Year

1994

Category

PIC

Winner

Forrest Gump

Notes

The Shawshank Redemption should have won.


Utility Topics

IBM Corporation 2013

IBM Global Business Services

Menu Painter

Menu Painter

Create function codes with a 20-character


(maximum) identifier

12

Function Key

Standard

Application

Assignments

Toolbar

Toolbar

Utility Topics

Menu bar

IBM Corporation 2013

IBM Global Business Services

Set GUI status / Title in PBO module


** MZA05O01 - PBO Modules **
Screen 9000

MODULE INITIALIZE OUTPUT.

PROCESS BEFORE OUTPUT.


MODULE INITIALIZE.

IF SY-DYNNR = 9000.
SET PF-STATUS FIRST.
SET TITLEBAR ONE.
ELSE.
SET PF-STATUS

Screen 9001

SECOND.

PROCESS BEFORE OUTPUT.


MODULE INITIALIZE.

SET TITLEBAR TWO.


ENDIF.
ENDMODULE.

Notice that the call to module


INITIALIZE in the PBO of each
screen refers to the same ABAP
module.
13

Utility Topics

SY-DYNNR =

Current
screen
number
IBM Corporation 2013

IBM Global Business Services

Checking Function Code Triggered

** MZA05TOP - Top Include **


PROGRAM SAPMZA05 MESSAGE-ID
ZA.
TABLES YMOVIE.
DATA OKCODE(4).
14

Utility Topics

To check the OK Code of an Online


program, you must define this field in
both the screen (Field List) and the
program work area (Top Include).
Remember that these fields must be
given the same name.
IBM Corporation 2013

IBM Global Business Services

Using the OKCODE


** MZA05O01 - PBO Modules **
Exit

Edit

Loop

MODULE INITIALIZE OUTPUT.


* code to set GUI status/title
CLEAR OKCODE.
ENDMODULE.

Academy Awards
Year
Category

1994

You should clear out the

PIC

OKCODE before a screen is


so an old value does not remain
if the user presses Enter.
** MZA05I01 - PAI Modules **

We only want to select a record

MODULE SELECT_LISTING INPUT.

from YMOVIE if the user has


invoked the EDIT function code
(for example, clicked on the Edit
pushbutton).
15

IF OKCODE = EDIT.
*

code to select record from YMOVIE


ENDIF.

ENDMODULE.
Utility Topics

IBM Corporation 2013

IBM Global Business Services

Function types

Function Code: Function codes of different types


can be created

Type :
Program
Function

16

Type E:
Exit
Command

Utility Topics

Type S:
System
Function

Type P:
Local GUI
Function

Type T:
Start
Transaction

IBM Corporation 2013

IBM Global Business Services

Messages-an overview
Academy Awards

Academy Awards
Year

1910

Enter

Category

PIC

Year

1910

Category

PIC

E: No record exists

Academy Awards
Year

1910

Category

PIC

Winner

No record exists

Instead of informing the


user on the second
screen that a record
does not exist, we want
to issue a message on
the first screen.

Notes
17

Utility Topics

IBM Corporation 2013

IBM Global Business Services

MESSAGE statement
The MESSAGE statement is used to issue user messages.
MESSAGE <tnnn> [WITH <var1> <var2> <var3> <var4>].
** MZA02TOP - Top Include **
PROGRAM SAPMZA02 MESSAGE-ID ZA.

nnn = message number

TABLES YMOVIE.

--------------------------------------

** MZA02I01 - PAI Modules **


MODULE SELECT_LISTING INPUT.
* code to select record from YMOVIE
IF SY-SUBRC <> 0.
YMOVIE-WINNER = No record exists.
MESSAGE E001.
ENDIF.
ENDMODULE.
18

t = message type

var1 = message variable 1


var2 = message variable 2
var3 = message variable 3
var4 = message variable 4
Message class (ID) must be
specified on PROGRAM
statement in Top Include.
MESSAGE statement in PAI module of
first screen.

Utility Topics

IBM Corporation 2013

IBM Global Business Services

User Messages Table


The MESSAGE statement accesses user messages stored in the ABAP
Dictionary table T100.
Logon language

T100
User Messages

Message ID specified on
PROGRAM statement
Language (key)
Message # (nnn) specified in
MESSAGE statement

Message ID (key)
Message # (key)
Message Text

Actual message displayed to the


user with the MESSAGE statement
19

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Message types
S:

success

I:

information

A:

abend

X:

exit

W:

warning

E:

error

A particular message text can be any


one of six message types.
i

20

Utility Topics

The message type


determines where the
message is displayed and
what action the user can or
must take on the current
screen.

IBM Corporation 2013

IBM Global Business Services

Summary of the lesson learnt so far


Let us summarize the lesson learnt so far:
A subscreen is a screen that is displayed in a specified area of another screen
(the main screen). A subscreen cannot be displayed by itself.
To include a subscreen in a predefined area on the main screen, use the
CALL SUBSCREEN statement in the main screens PBO event.
If the subscreen contains any PAI code, use the CALL SUBSCREEN
statement in the PAI event of the main screen.
A subscreen is created just like any other screen of an Online program. The
only difference is the screen type specified in the Screen Attributes section of
the Screen Painter. The screen type for a subscreen is appropriately called
Subscreen.
A programs GUI is created in the Menu Painter.
Each program has a single GUI that contains the defined function codes.

21

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Summary of the lesson learnt so far (continued)


The MESSAGE statement is used to issue user messages. The syntax of
this statement is: MESSAGE <tnnn> [WITH <var1> <var2> <var3> <var4>].
A particular message text can be any one of six message types: S-success, Iinformation, A-abend, X-exit, W-warning, and E-error.
The SUCCESS message is displayed at the bottom of the next screen;
therefore, the user cannot make any changes to the values on the current
screen.
The INFORMATION message is displayed on the current screen in a dialog
box.
The ABEND message is displayed on the current screen in a dialog box. After
clicking the Enter key on the dialog box, the transaction will be terminated.

22

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Answer a few questions


1.
2.
3.
4.
5.
6.

23

What is a sub-screen in the context of Online programming?


Can the CALL SUBSCREEN statement be used in the PBO event?
What is the use of the Menu Painter?
What is a Function Code?
What are the different types of screen messages?
What is the difference between the SUCCESS and the INFORMATION
message?

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Module summary
Now that we have completed the module, we should be able to:
Understand Subscreen
Understand Graphical User Interface
Understand Message Types

24

Utility Topics

IBM Corporation 2013

IBM Global Business Services

Thank You

25

Utility Topics

IBM Corporation 2013