100% found this document useful (1 vote)
269 views85 pages

ABAP Training - Module Poolnew

This document provides an overview of online programing in ABAP. It discusses screen components like screen painters and attributes. It describes the different types of ABAP programs and modules used in online programs. It explains how to create an online program, define screen attributes and flow logic. It also covers topics like global data, data transport between screens and programs, and using messages.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
269 views85 pages

ABAP Training - Module Poolnew

This document provides an overview of online programing in ABAP. It discusses screen components like screen painters and attributes. It describes the different types of ABAP programs and modules used in online programs. It explains how to create an online program, define screen attributes and flow logic. It also covers topics like global data, data transport between screens and programs, and using messages.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 85

ABAP Training

Module Pool Programming

Dipayan Datta & Harikumar Sasidharan

ABAP Program Types

Report Programs
Conventional Report

Online Programs

Interactive Report

Screen Components

Screen Painter

Screen Attributes

Screen Layout

Field Attributes Flow Logic


|

Screen Layout

5
7

6
|

ABAP Program Components

ABAP

Top Include

PBO Modules

PAI Modules Subroutines


|

Online Program Processing Control

DYNPRO PROCESSOR
** SCREEN 9000 ** PROCESS BEFORE OUTPUT. MODULE CLEAR. PROCESS AFTER INPUT. MODULE CHECK. MODULE SELECT.

ABAP PROCESSOR
** INCLUDE MZAVGO01 MODULE CLEAR OUTPUT. ... ENDMODULE.

** INCLUDE MZAVGI01 MODULE CHECK INPUT. ... ENDMODULE. MODULE SELECT INPUT. ... ENDMODULE.

** SCREEN 9001 ** PROCESS BEFORE OUTPUT. PROCESS AFTER INPUT. MODULE UPDATE.

MODULE UPDATE INPUT. ... ENDMODULE.

Online Program Work Areas

PBO
Screen Work Area
name
Aaron

Program Work Area


DATA name(10).
Aaron

phone
215-387-3232

Identical Names

DATA num(12).

city
Philadelphia

DATA city(20).
Philadelphia

PAI
|

Creating an Online Program

Online program name must begin with SAPM and then either a Y or Z.

Program Attributes
With TOP INCL. should be checked. Go back to Repository Browser, not source code.

Title Type M

Application

Screen Attributes

Screen Painter

Screen Attributes

Short Description

Screen Type

Next Screen

required
|

required

optional

Flow Logic
Screen Painter

Flow Logic

Screen 9000
PROCESS BEFORE OUTPUT.

Flow Logic Command

MODULE INITIALIZE.

ABAP module to clear all fields before screen is displayed. ABAP module to calculate average after user has entered values and pressed Enter.

PROCESS AFTER INPUT. MODULE CALCULATE.


|

ABAP Modules Main Program


** SAPMY220_PLAYER_AVG ** INCLUDE MY220_PLAYER_AVGTOP. INCLUDE MY220_PLAYER_AVGO01. INCLUDE MY220_PLAYER_AVGI01.

PBO Module
** MY220_PLAYER_AVGO01 - Include Program ** MODULE INITIALIZE OUTPUT.

CLEAR: POINTS, GAMES, AVERAGE.


ENDMODULE.

PAI Module
The fields POINTS, GAMES, and AVERAGE need to be defined as global data.
** MY220_PLAYER_AVGI01 - Include Program ** MODULE CALCULATE INPUT. CHECK GAMES <> 0. AVERAGE = POINTS / GAMES. ENDMODULE.
|

Global Data

Main Program
** SAPMY220_PLAYER_AVG ** INCLUDE MY220_PLAYER_AVGTOP. INCLUDE MY220_PLAYER_AVGO01.
It is important that these program fields are named the same as the screen fields so automatic data transport will occur between the screen work area and program work area.

INCLUDE MY220_PLAYER_AVGI01.

Top Include
** MY220_PLAYER_AVGTOP - Include Program **

PROGRAM SAPMY220_PLAYER_AVG.
DATA: POINTS TYPE I, GAMES TYPE I, AVERAGE TYPE P DECIMALS 2.
|

Screen to Program Data Transport

When the PAI event is triggered, values are transported from the screen work area to the program fields with the same names before any PAI modules are executed.
Player Average Total Points Total Games 165 6

Executing an Online Program

F8
Transaction Code

Transaction Text

Program Name

Initial Screen

required
|

required
SAPMY220_PLAYER_AVG

required
9000

Question???

Screen 9000
PROCESS BEFORE OUTPUT.

Screen 9001
PROCESS BEFORE OUTPUT.

MODULE INITIALISE.

MODULE CALCULATE.

PROCESS AFTER INPUT. MODULE CALCULATE.

PROCESS AFTER INPUT.

We could have calculated the players average in the PBO of screen 9001. Why is it better to do the calculation in the PAI of screen 9000 instead of the PBO of screen 9001?

Graphical Elements

6
|

Scrollable Fields
ABAP Course #3

Description Instructor

This course covers online programming techniques.

Anthon, Dionne

ABAP Course #3 Description Instructor

course covers online prog Anthon, Dionne

scrollable field

These lengths are attributes of a field.


|

Scrollable fields have a visible length that is smaller than the defined length.

Using Search Helps


If you assign a search help to an input/output template, you will see a drop-down arrow to get a list of possible values (F4).

ABAP Course #3 Description Instructor

This course covers online Anthon, Dionne

Search help is an attribute of a field. It can only be used on input/output templates.


|

Anthon, Dionne Bacon, Patricia Banning, Mark Cooper, Angela Shepski, Lee

Use Dictionary Fields


When you paint screen fields from the ABAP Dictionary, you define the program fields with the TABLES statement.

** MZA01TOP - Top Include **

PROGRAM SAPMZA01.
TABLES YMOVIE.

** MZA01O01 - PBO Modules **

Screen 9000
PROCESS BEFORE OUTPUT. MODULE INITIALIZE.

MODULE INITIALISE OUTPUT.

CLEAR YMOVIE.
ENDMODULE. ** MZA01I01 - PAI Modules **

PROCESS AFTER INPUT.


MODULE SELECT_LISTING.
|

MODULE SELECT_LISTING INPUT. * code to select record from YMOVIE ENDMODULE.

Online Help for Dictionary Fields


If a screen field is painted from the ABAP Dictionary, it points to a data element and the data elements online help.

Academy Awards Year Category 1994 PIC

F1

Data element short text Data element documentation system-wide only if maintained system-wide automatic

Data element supplemental documentation screen-specific only if maintained


|

ABAP Dictionary Integration


Academy Awards

Execute transaction

Year Category

If a change is made to an ABAP Dictionary field (e.g., category length is changed from 3 to 6 characters) and the appropriate Dictionary objects are reactivated, the change will take effect throughout the system where this field is used.
Academy Awards

Execute transaction

Year Category

Notice change in Category field length

Automatic Checks

Values in all input/output templates are checked for

Required Field Entered ?

Proper Format ?

Values in input/output templates painted from the ABAP Dictionary are checked for

Foreign Key Value ?

Valid Value ?

Timing of Automatic Checks

SCREEN
Enter

PROCESS BEFORE OUTPUT.

PROCESS AFTER INPUT. MODULE ONE. MODULE TWO.

NO

Automatic Screen Field Checks OK?

YES

Data transport from screen fields to program fields with the same names.

Module ONE executed.


|

Module TWO executed.

Go to PBO of next screen

Required Field Check


Fields can be marked as required two ways: (1) use a question mark ? as the first character of an input/output template or (2) check on the field attribute for required entry.

Academy Awards Year Category ? PIC

Enter
If a required field is not entered, the system will display the error message: Required entry not made.
|

Academy Awards

Year Category

? PIC

E: Required entry not made

Field Format Check


The AAYEAR field in the YMOVIE table has the NUMC (numeric character) data type. The system will automatically check that the user has entered all numbers in this field.

Academy Awards Year Category

19a4 PIC

Enter

Academy Awards Year 19a4 PIC

If a field format is incorrect, the system will display an appropriate error message.
|

Category

E: Enter a numeric value

Foreign Key Check


Address Information Customer # C32 This customer number field painted from the ABAP Dictionary has a foreign key relationship maintained. Because of this relationship, you will see a dropdown arrow to get a list of possible values (F4).

Enter
Address Information Customer # C32

E: Entry C32 does not exist (please check your entry)

If the value entered does not exist in the foreign key (check) table, the system will display the error message: Entry <x> does not exist (please check your entry).
|

Valid Value Check


The CATEGORY field in the YMOVIE table points to a domain with a set of valid values. Because of this set of valid values, you will see a drop-down arrow to get a list of possible values (F4).

Academy Awards Year Category 1994 PI

Enter
If a valid value is not entered, the system will display the error message: Please enter a valid value.
|

Academy Awards Year Category 1994 PI

E: Please enter a valid value

Overview
Academy Awards Year Category 1910 PIC

Academy Awards

Enter

Year Category

1910 PIC

Academy Awards Year Category Winner Notes


|

E: No record exists

1910 PIC 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.

MESSAGE Statement
MESSAGE <tnnn> [WITH <var1> <var2> <var3> <var4>].
** MZA02TOP - Top Include ** PROGRAM SAPMZA02 MESSAGE-ID ZA.

TABLES YMOVIE.
** MZA02I01 - PAI Modules ** MODULE SELECT_LISTING INPUT. * code to select record from YMOVIE IF SY-SUBRC <> 0.

t = message type nnn = message number -------------------------------------var1 = message variable 1 var2 = message variable 2 var3 = message variable 3 var4 = message variable 4

YMOVIE-WINNER = No record exists.


MESSAGE E001. ENDIF. ENDMODULE.
|

Message class (ID) must be specified on PROGRAM statement in Top Include. MESSAGE statement in PAI module of first screen.

Message Types

S: success I: information

A: abend X: exit

W: warning
E: error
|

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

Success Message
PAI Module of 1st Screen

Academy Awards Year Category


1910 PIC

Enter

MESSAGE S001.

Academy Awards

Year Category Winner


Notes

1910
PIC

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.

No record exists
|

Information Message
Academy Awards Year Category 1910 PIC

i
PAI Module of 1st Screen

MESSAGE I001.
Enter
The INFORMATION message is displayed on the current screen in a dialog box. The user cannot make any changes to the values on the current screen. After pressing the Enter key on the dialog box, the user will be taken to the next screen.

Academy Awards
Year Category 1910 PIC

i
|

No record exists

Abend Message
Academy Awards Year Category 1910 PIC The ABEND message is displayed on the current screen in a dialog box. The user cannot make any changes to the values on the current screen. After pressing the Enter key on the dialog box, the transaction will be terminated. PAI Module of 1st Screen

MESSAGE A001. Enter

Academy Awards Year Category 1910 PIC No record exists

Warning Message
PAI Module of 1st Screen

Academy Awards Year Category 1910 PIC

Enter

MESSAGE W001.

Academy Awards Year Category 1910 PIC

W: No record exists

The WARNING message is displayed at the bottom of the current screen. The user can make changes to the values on the current screen, but does not have to make any changes. After pressing the Enter key on the current screen, the user will be taken to the next screen.

Error Message

X
PAI Module of 1st Screen

Academy Awards

Year
Category

1910 PIC

Enter

MESSAGE E001.

Academy Awards Year Category 1910 PIC

E: No record exists
|

The ERROR message is displayed at the bottom of the current screen. The user must make changes to the values on the current screen. After pressing the Enter key on the current screen, the user will be taken to the next screen only if the appropriate corrections were made.

Problem !!!

Academy Awards Year Category 1910 PIC

Academy Awards Year Category 1910 PIC

W: No record exists

E: No record exists

When we issue a WARNING or ERROR message, the system stops on the current screen to allow the user to make corrections; however, these fields are not open for input.

Overview
Academy Awards Year Category 1932 PIC

Enter

User-defined check without flagging fields as open for input

User-defined check with flagging fields as open for input

Academy Awards Year Category

Academy Awards Year Category

1932
PIC

1932
PIC

E: No record exists
|

E: No record exists

User-Defined Checks

Method #1

Issue error or warning message in PAI Module

Method #2

Issue error or warning message with Flow Logic SELECT statement

Method #3
|

Define valid values with Flow Logic VALUES statement

Flow Logic FIELD Statement

Flow Logic FIELD statement keeps a single screen field open for input on an error or warning message.
Issue error or warning message in PAI Module
Issue error or warning message with Flow Logic SELECT statement Define valid values with Flow Logic VALUES statement
|

Flow Logic Command


PROCESS AFTER INPUT. FIELD <screen field> MODULE <module name>. PROCESS AFTER INPUT. FIELD <screen field> SELECT * FROM <table> . . . . PROCESS AFTER INPUT. FIELD <screen field> VALUES (<value1>, <value2>).

PAI Module Check


PROCESS AFTER INPUT. FIELD YMOVIE-AAYEAR MODULE SELECT_LISTING.
This Flow Logic FIELD statement will leave the YMOVIE-AAYEAR screen field open for input if an error or warning message is issued in the SELECT_LISTING module. ** MZA03I01 - PAI Modules ** MODULE SELECT_LISTING INPUT. * code to select record from YMOVIE IF SY-SUBRC <> 0. MESSAGE E001. ENDIF. ENDMODULE.

Academy Awards Year Category 1932 PIC

Academy Awards Year

1932
PIC

Enter

Category

E: No record exists
|

Flow Logic SELECT Check


PROCESS AFTER INPUT. FIELD YMOVIE-AAYEAR SELECT * FROM YMOVIE WHERE AAYEAR = YMOVIE-AAYEAR AND CATEGORY = YMOVIE-CATEGORY INTO YMOVIE WHENEVER NOT FOUND SEND ERRORMESSAGE 001.

Flow Logic Command

This Flow Logic SELECT statement will retrieve one record. If no record matches, an error message is issued. The Flow Logic FIELD statement will leave the YMOVIE-AAYEAR screen field open for input if this error message is issued.

Academy Awards Year Category


|

Academy Awards

1932 PIC

Enter

Year
Category

1932

PIC

E: No record exists

Multiple Fields Open for Input


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

Flow Logic Command

This Flow Logic CHAIN and ENDCHAIN group the FIELD statements and the MODULE statement together. The Flow Logic FIELD statements will leave both the YMOVIE-AAYEAR and YMOVIE-CATEGORY screen fields open for input if an error or warning message is issued in the SELECT_LISTING module.

Academy Awards Year Category 1932 PIC

Academy Awards

Year

1932 PIC

Enter

Category

E: No record exists
|

Data Transport in PAI Event

Enter

Automatic Screen Field Checks OK?

YES

Data transported from screen fields D and E to program fields D and E. Fields A, B, and C are not transported yet because these fields are in a FIELD statement. Module ONE executed. Data transport for field A. Module TWO executed. Data transport for fields B and C. Module THREE executed. Module FOUR executed. Go to PBO of next screen

A B C D E

NO

PROCESS AFTER INPUT. MODULE ONE. FIELD A MODULE TWO. CHAIN: FIELD: B, C. MODULE THREE. ENDCHAIN. FIELD A MODULE FOUR.
|

Questions???

PROCESS AFTER INPUT. FIELD A . FIELD B SELECT * FROM TABLE WHERE FIELD1 = A AND FIELD2 = B INTO TABLE WHENEVER NOT FOUND SEND ERRORMESSAGE 001.

This FIELD statement is not associated with a PAI module, a Flow Logic SELECT statement, or a Flow Logic VALUES statement; however, it is essential for the execution of this PAI event. WHY???

If this error message is issued, will screen field A be open for input?

FIELD A MODULE SELECT_LISTING.


|

Overview
Academy Awards

Execute transaction

Year Category

1994 PIC

Default Values

Academy Awards Year Category Winner Notes


|

1994 PIC Forrest Gump

Cursor Positioning

The Shawshank Redemption should have won.

Using Parameter IDs

SET/GET PARAMETER ID ABAP Statement

OR

SPA/GPA Field Attributes


|

SET/GET PARAMETER ID Statement


** MZA04O01 - PBO Modules ** MODULE INITIALIZE OUTPUT. YMOVIE-AAYEAR = 1994. YMOVIE-CATEGORY = PIC. GET PARAMETER ID YYR FIELD YMOVIE-AAYEAR. GET PARAMETER ID YCT FIELD YMOVIE-CATEGORY. ENDMODULE. ** MZA04I01 - PAI Modules ** MODULE SELECT_LISTING INPUT. * code to select record from YMOVIE SET PARAMETER ID YYR FIELD YMOVIE-AAYEAR.

Academy Awards
Year Category 1994 PIC

GET

YYR = 1994 YCT = PIC


Parameter ID Memory

SET

SET PARAMETER ID YCT FIELD YMOVIE-CATEGORY.


ENDMODULE.
|

SPA/GPA Field Attributes


You can check the GPA field attribute instead of coding the GET PARAMETER ID statement in a PBO module.

You can check the SPA field attribute instead of coding the SET PARAMETER ID statement in a PAI module.
|

Notice the parameter ID name

Cursor Position

Academy Awards Year Category Winner Notes 1994 PIC Forrest Gump The Shawshank Redemption should have won.

Upon entering a screen, the cursor will automatically be positioned in the first input/output template open for input unless you position the cursor in a different field using the screen attributes or a PBO module.
|

Positioning the Cursor

Screen Attributes
Short Description Screen Type Cursor position
YMOVIE-NOTES

** PBO Module **

OR

MODULE INITIALIZE OUTPUT. SET CURSOR FIELD YMOVIE-NOTES. ENDMODULE.

Academy Awards Year Category Winner 1994 PIC Forrest Gump

New Cursor Position

Notes
|

The Shawshank Redemption should have won.

Set GUI Status/Title in PBO Module

Screen 9000
PROCESS BEFORE OUTPUT. MODULE INITIALIZE.

** MZA05O01 - PBO Modules **

MODULE INITIALIZE OUTPUT.


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

Screen 9001
PROCESS BEFORE OUTPUT. MODULE INITIALIZE.

ELSE.
SET PF-STATUS SECOND. SET TITLEBAR TWO. ENDIF.

ENDMODULE.

Notice that the call to module INITIALIZE in the PBO of each screen refers to the same ABAP module.
|

current SY-DYNNR = screen number

GUI Status Type

Screen Type Normal

GUI Status Type Online Status

Screen Type Modal Dialog Box

GUI Status Type Dialog Box

Screen type defined in the Screen Attributes of the Screen Painter.


|

GUI status type defined in the Menu Painter.

Checking Function Code Triggered

** MZA05TOP - Top Include ** PROGRAM SAPMZA05 MESSAGE-ID ZA.

TABLES YMOVIE.
DATA OKCODE(4).

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.

Using the OKCODE


** MZA05O01 - PBO Modules **

Exit

Edit

Loop

MODULE INITIALIZE OUTPUT. * code to set GUI status/title CLEAR OKCODE.

Academy Awards Year Category 1994 PIC

ENDMODULE.

You should clear out the OKCODE before a screen is displayed so an old value does not remain if the user presses Enter.

We only want to select a record from YMOVIE if the user has invoked the EDIT function code (e.g., clicked on the Edit pushbutton).

** MZA05I01 - PAI Modules ** MODULE SELECT_LISTING INPUT. IF OKCODE = EDIT. * code to select record from YMOVIE ENDIF. ENDMODULE.

Function Types

Function Code

Type

Type E

Type S

Type P

Type T

Overview
Exit
Year
Category

Edit

Loop
1994 PIC

Academy Awards

Exit
Year

Update
1994 PIC Forrest Gump

Academy Awards

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.

Category Winner Notes Critic


|

The Shawshank Redemption should have won. Dean

Enter Name

LEAVE SCREEN Statement


Next Screen attribute is 9001.
** PAI Modules **

MODULE ONE INPUT.


...

Screen 9000
PROCESS BEFORE OUTPUT.

LEAVE SCREEN. ...

ENDMODULE.
MODULE TWO INPUT. ...

MODULE INITIALIZE.

PROCESS AFTER INPUT. MODULE ONE. MODULE TWO.

ENDMODULE.

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.

SET SCREEN Statement


** MZA06I01 - PAI Modules **

Next Screen attribute is 9000.

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

Screen 9000
PROCESS AFTER INPUT.

code to select record from YMOVIE ENDIF.

ENDMODULE.

FIELD YMOVIE-AAYEAR VALUES (BETWEEN 1927 AND 1996). CHAIN. When SET SCREEN is encountered, FIELD: YMOVIE-AAYEAR, the system temporarily ignores the YMOVIE-CATEGORY. value in the Next Screen attribute MODULE SELECT_LISTING. and uses the value specified instead. ENDCHAIN. The current screens PAI processing is
not terminated.
|

LEAVE TO SCREEN Statement


** MZA06I01 - PAI Modules **

Next Screen attribute is 9000.

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

Screen 9000
PROCESS AFTER INPUT.

FIELD YMOVIE-AAYEAR VALUES (BETWEEN 1927 AND 1996). CHAIN. When LEAVE TO SCREEN is FIELD: YMOVIE-AAYEAR, encountered, the system terminates YMOVIE-CATEGORY. the current screens PAI event and MODULE SELECT_LISTING. immediately goes to the PBO event ENDCHAIN. of the screen specified in the statement.
|

CALL SCREEN Statement


Exit Update
Titlebar Enter critics name Dean

Academy Awards

Year Category
Winner Notes Critic

Screen 9002 is a Modal dialog box type screen with a dialog box type GUI status.

Exit

should have won.

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

Leaving a Called Screen


Next Screen attribute is 9002.
** MZA06O01 - PBO Modules **

Screen 9002
PROCESS BEFORE OUTPUT. MODULE INITIALIZE.

MODULE INITIALIZE OUTPUT. * set GUI status and titlebar * depending on screen number * and clear okcode ENDMODULE.

PROCESS AFTER INPUT. MODULE END.


** MZA06I01 - PAI Modules **
MODULE END INPUT. LEAVE TO SCREEN 0.

Because screen 9002 was called, SCREEN 0 refers to the calling screen (9001).
|

ENDMODULE.

Question ???

Screen 9100

Screen 9100

Screen Attributes
Short Description Screen Type Next screen
9100

Screen Attributes
Short Description Screen Type Next screen

What happens after all PAI modules are processed and the next screen is itself?

What happens after all PAI modules are processed and the next screen is blank?

Overview

Conditional Execution Flow Logic Additions

ON INPUT

ON REQUEST

AT CURSORSELECTION
|

AT EXITCOMMAND

ON INPUT

PROCESS AFTER INPUT. FIELD A MODULE CHECK_DATA ON INPUT.

Module CHECK will be executed only if the value in field A is not equal to the initial value appropriate to its data type (e.g., blanks for character fields and zeroes for numeric fields).

ON REQUEST

PROCESS AFTER INPUT.


FIELD A MODULE CHECK_DATA ON REQUEST.

Module CHECK will be executed only if a value has been entered in field A since the screen was displayed.

AT EXIT-COMMAND

PROCESS AFTER INPUT.

MODULE END AT EXIT-COMMAND.

Module END will be executed only if the user invoked a function code with the E function type.

Timing of AT EXIT-COMMAND
Type E Function Code

PROCESS AFTER INPUT. MODULE CHECK.

SCREEN

MODULE END AT EXIT-COMMAND.

NO Module END executed.


Automatic Screen Field Checks OK?

YES

Data transport from screen fields to program fields with the same names.
|

Module CHECK executed.

Go to PBO of next screen

AT EXIT-COMMAND Example

Exit

Edit

Loop

Academy Awards Year Category 1910 PI

PROCESS AFTER INPUT. FIELD YMOVIE-AAYEAR VALUES (BETWEEN 1927 AND 1996). CHAIN. FIELD: YMOVIE-AAYEAR, YMOVIE-CATEGORY. MODULE SELECT_LISTING. ENDCHAIN.

MODULE END AT EXIT-COMMAND.

If the user invokes the EXIT function code (e.g., clicking on Exit), we will terminate the transaction. Because this function code is type E, we can use AT EXIT-COMMAND to have the module END executed immediately (even before the automatic field checks).
|

AT CURSOR-SELECTION

Module SEL1 will be executed only if the user invoked the function code CS with the S function type and the cursor was positioned in field A.

PROCESS AFTER INPUT.


FIELD A MODULE SEL1 AT CURSOR-SELECTION.

AT CURSOR-SELECTION Catch All

PROCESS AFTER INPUT. FIELD A MODULE SEL1 AT CURSOR-SELECTION. MODULE SEL2 AT CURSOR-SELECTION.

Module SEL2 will be executed only if the user invoked the function code CS with the S function type and the cursor was not positioned in field A.
|

Subscreens
Customer 11

Address Information Bank Information Customer Name 11 Tools International

Subscreens are displayed on another screen

Address Information (Subscreen 9020)

Subscreen Areab (on Main Screen 9010)

Bank Information (Subscreen 9030)

Main Screen

Main Screen
Subscreen Area #1

Screen Painter

Subscreen Area #2

Subscreen Area #3

Fullscreen Editor (subscreen areas)


-

Flow Logic

Subscreen Area in Main Screen Screen 9010


Customer Name __________

________________

In the Fullscreen Editor, create a subscreen area on the main screen.

................... ................... ................... ................... ..............

This subscreen area must be given a name up to 10 characters long (e.g. SUB1).

CALL SUBSCREEN in PBO


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

Customer Name

11 Tools International

This SCREEN_NUM variable contains the number of the subscreen to display in the specified subscreen area.

Subscreen Area

SUB1

Bank (Sub

Address Information (Subscreen 9020)

CALL SUBSCREEN in PAI

Customer Name

11 Tools International

Address Information (Subscreen 9020)

To invoke the PAI event of the actual subscreen, the CALL SUBSCREEN statement must be used in the PAI event of the main screen.

PROCESS AFTER INPUT. for main screen 9010 * CALL SUBSCREEN <area>. CALL SUBSCREEN SUB1.
|

Creating a Subscreen

Address Information (Subscreen 9020)

Bank Information (Subscreen 9030)

Screen Painter

Screen Attributes
Screen Type = Subscreen
|

Subscreen Restrictions

SET PF-STATUS SET TITLEBAR SET SCREEN CALL SCREEN LEAVE TO SCREEN CALL SUBSCREEN AT EXIT-COMMAND OK Field
|

Objectives: Tabstrip Controls

Upon completion of this section you will be able to: Create tabstrips in the graphical screen painter. Create subscreens for use with tabstrips. Integrate tabstrips in a module pool program . . .
-

With the application server. Without the application server.

Graphical Screen Painter

Text I/O Template Radio Button

Frames Subscreen Area Table Controls

What are Tabstrips?


SAP R/3

MAL FEM PIC

1991

PIC

FEM

MAL

Year

1991

Year

1991

Winner The Silence of the

Winner The Silence of the Nominees


Beauty and the Beast Bugsy

Nominees
Beauty and the Beast Bugsy

Tabstrips allow users to access multiple subscreens on one normal screen.


|

Creating Tabstrip Controls (Continued)


A. Define subscreen areas and subscreen attributes within each tab page. B. Give your tabs a function code and specify the appropriate function type. C. Reference the subscreen in the dictionary attributes of your tab.
SUB1

A
B

Subscreen Area
C
|

Creating Tabstrip Controls


I. Define your tabstrip in the top include.

II. Use the Graphical Screen Painter to create the tabstrip.*

A. Creates new tabs & pushbuttons.

B. Creates tabstrips. * Tabstrips cannot be created in alphanumeric mode.


|

Special Attributes for Tabstrip Controls

Process on Help-Request

Academy Awards Year 1994 PIC

Screen 9000
PROCESS BEFORE OUTPUT. ... PROCESS AFTER INPUT. ... PROCESS ON HELP-REQUEST.

Category

F1

FIELD YMOVIE-AAYEAR WITH 0001.

Trigger PROCESS ON HELP-REQUEST Flow Logic event for the particular field. This event will display the specified supplemental documentation (i.e., 0001).
|

Process on Value-Request

Screen 9000
Academy Awards

Year
Category

1994

PROCESS BEFORE OUTPUT. ...

PIC

PROCESS AFTER INPUT. ... PROCESS ON VALUE-REQUEST.

F4

FIELD YMOVIE-AAYEAR MODULE VALUE_LIST.

Trigger PROCESS ON VALUE-REQUEST Flow Logic event for the particular field. This event will execute the specified module (i.e., VALUE_LIST).
|

You might also like