You are on page 1of 13

IBM Global Services

Dynamic Screen Sequence

Dynamic Screen Sequence |

Dec-2008

2005 IBM Corporation

IBM Global Services

Objectives
The participants will be able to:
Know about the next screen attribute for a screen.
Understand the functioning of the following screen navigation commands:
LEAVE SCREEN
SET SCREEN
LEAVE TO SCREEN
CALL SCREEN

Dynamic Screen Sequence |

Dec-2008

2005 IBM Corporation

IBM Global Services

Overview
Exit

Edit

Loop

Academy Awards
Year

1994

Category

PIC

Exit

Update

Academy Awards
1994
Year
Category

PIC

Winner

Forrest Gump

Notes
Critic

Currently, the screen


sequence of our online
program is determined by
static Next Screen
attributes on each screen.
We will learn how to
dynamically set the screen
sequence and add a pop-up
dialog box to enter a critics
name.

The Shawshank Redemption should have won.


Dean

Dynamic Screen Sequence |

Enter Name

Dec-2008

2005 IBM Corporation

IBM Global Services

LEAVE SCREEN Statement


Next Screen
attribute is 9001.

** PAI Modules **
MODULE ONE INPUT.
...
LEAVE SCREEN.

Screen 9000

...
ENDMODULE.

PROCESS BEFORE OUTPUT.

MODULE TWO INPUT.

MODULE INITIALIZE.

...
ENDMODULE.

PROCESS AFTER INPUT.


MODULE ONE.
MODULE TWO.

When LEAVE SCREEN is encountered,


the system immediately terminates the
current screens PAI event and goes to the PBO event
of the screen specified in the Next Screen attribute.

Dynamic Screen Sequence |

Dec-2008

2005 IBM Corporation

IBM Global Services

SET SCREEN Statement


Next Screen
attribute is 9000.

** MZA06I01 - PAI Modules **


MODULE SELECT_LISTING INPUT.
IF OKCODE = EDIT.
SET SCREEN 9001.

Screen 9000
PROCESS AFTER INPUT.

* code to select record from


YMOVIE
ENDIF.

FIELD YMOVIE-AAYEAR

ENDMODULE.
VALUES (BETWEEN 1927 AND 1996).

CHAIN.
FIELD: YMOVIE-AAYEAR,
YMOVIE-CATEGORY.
MODULE SELECT_LISTING.
ENDCHAIN.

Dynamic Screen Sequence |

When SET SCREEN is encountered,


the system temporarily ignores the
value in the Next Screen attribute
and uses the value specified instead.
The current screens PAI processing
is not terminated.

Dec-2008

2005 IBM Corporation

IBM Global Services

LEAVE TO SCREEN Statement


** MZA06I01 - PAI Modules **
Next Screen
attribute is 9000.
Screen 9000
PROCESS AFTER INPUT.
FIELD YMOVIE-AAYEAR

MODULE SELECT_LISTING INPUT.


IF OKCODE = EDIT.
* code to select record from
YMOVIE
LEAVE TO SCREEN 9001.
ENDIF.
ENDMODULE.

VALUES (BETWEEN 1927 AND 1996).


CHAIN.
FIELD: YMOVIE-AAYEAR,
YMOVIE-CATEGORY.
MODULE SELECT_LISTING.
ENDCHAIN.

Dynamic Screen Sequence |

When LEAVE TO SCREEN is encountered,


the system terminates the current
screens PAI event and immediately
goes to the PBO event of the screen
specified in the statement.

Dec-2008

2005 IBM Corporation

IBM Global Services

CALL SCREEN Statement

Exit

Update

Titlebar

Academy Awards
Year

1994

Category

PIC

Winner

Forrest Gump

Notes
Critic

Screen 9002 is a Modal


dialog box type screen
with a dialog box type
GUI status.

Enter critics name


Dean
Exit

The Shawshank Redemption should have won.


Dean

Enter Name

CALL SCREEN 9002 STARTING AT 30 5 ENDING AT 60 10.


This ABAP code would be in a PAI module
for screen 9001.

Dynamic Screen Sequence |

Dec-2008

2005 IBM Corporation

IBM Global Services

Leaving a Called Screen


Next Screen
attribute is 9002.
Screen 9002
PROCESS BEFORE OUTPUT.
MODULE INITIALIZE.
PROCESS AFTER INPUT.
MODULE END.

** MZA06O01 - PBO Modules **


MODULE INITIALIZE OUTPUT.
* set GUI status and titlebar
* depending on screen number
* and clear okcode
ENDMODULE.
** MZA06I01 - PAI Modules **
MODULE END INPUT.
LEAVE TO SCREEN 0.

Because screen 9002 was called,

ENDMODULE.

SCREEN 0 refers to the calling


screen (9001).

Dynamic Screen Sequence |

Dec-2008

2005 IBM Corporation

IBM Global Services

Demonstration
Demonstration of screen navigation commands in a sample online program.

Dynamic Screen Sequence |

Dec-2008

2005 IBM Corporation

IBM Global Services

Practice
Demonstration of screen navigation commands in a sample online program.

10

Dynamic Screen Sequence |

Dec-2008

2005 IBM Corporation

IBM Global Services

Summary
The screen sequence of an online program is determined by Next Screen
pointers.
When the system encounters the LEAVE SCREEN ABAP statement, it
immediately terminates the screens PAI event and goes to the PBO event of the
screen specified in the Next Screen attribute.
When the system encounters the SET SCREEN <screen #> ABAP statement, it
temporarily overrides the Next Screen attribute with this <screen #> and the PAI
processing continues. After all PAI modules are executed, the system goes to the
PBO event of <screen #>.
When the system encounters the LEAVE TO SCREEN <screen #> ABAP
statement, it terminates the screens PAI event and immediately goes to the PBO
of <screen #>.
The LEAVE TO SCREEN <screen #> statement performs the functionality of two
statements: SET SCREEN <screen #> and LEAVE SCREEN.

11

Dynamic Screen Sequence |

Dec-2008

2005 IBM Corporation

IBM Global Services

Summary (Contd.)
When the system encounters the CALL SCREEN <screen #> ABAP statement,
it temporarily suspends the current screens PAI processing and immediately goes
to the PBO event of <screen #>. When control returns back to the calling
screen, its PAI processing will resume.
After you have called another screen, you need to code a way back to the
calling screen. Using screen number zero will accomplish this task.

12

Dynamic Screen Sequence |

Dec-2008

2005 IBM Corporation

IBM Global Services

Questions

Screen 9100

Screen 9100

Screen Attributes

Screen Attributes

Short Description

Short Description

Screen Type

Screen Type

Next screen

13

9100

Next screen

What happens after all PAI

What happens after all PAI

modules are processed and

modules are processed and

the next screen is itself?

the next screen is blank?

Dynamic Screen Sequence |

Dec-2008

2005 IBM Corporation

You might also like