Вы находитесь на странице: 1из 16

IBM Global Services

Default Values and Cursor Position

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

Objectives
The participants will be able to:
Default field values with the following methods:
PBO module
Parameter ids
Hold data

Position the cursor using two different methods.

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

Overview
In this chapter, we will learn how to set default field values upon entering a screen
and how to set default cursor position on screen fields.
Academy Awards
Execute
transaction

Year

1994

Category

PIC

Default
Values

Academy Awards

Year

1994

Category

PIC

Cursor

Positioning

Winner

Forrest Gump

Notes

The Shawshank Redemption should have won

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

Defaulting Field Values

Method #1

Method #2

PBO Module: Before the screen is displayed to


the user ,assign values to screen fields

Parameter Ids: For ABAP Dictionary fields using


SET/GET PARAMETER ID ABAP statement or
SPA/GPA field attributes

Method #3

Hold Data: Use Hold Data function for the screen

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

PBO Module

Screen 9000
PROCESS BEFORE OUTPUT.
MODULE INITIALIZE.

** MZA04O01 - PBO Modules **


MODULE INITIALIZE OUTPUT.
CLEAR YMOVIE.
YMOVIE-AAYEAR = 1994.
YMOVIE-CATEGORY = PIC.

PBO Module

ENDMODULE.

Academy Awards
Execute
transaction

Default Values and Cursor Position |

Year

1994

Category

PIC

Dec-2008

2005 IBM Corporation

IBM Global Services

Parameter IDs

AAYEAR Data Element

Parameter ID Memory

Parameter
ID YYR

YYR = <value>
YCT = <value>

CATEGORY Data Element


This memory is

Parameter

user and logon

ID YCT

specific

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

Using Parameter IDs

SET/GET PARAMETER ID
ABAP Statement

OR

SPA/GPA
Field Attributes

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

SET/GET PARAMETER ID Statement


** MZA04I01 - PAI Modules **
MODULE SELECT_LISTING INPUT.

Academy Awards

* code to select record from YMOVIE

Year

SET PARAMETER ID YYR FIELD YMOVIE-AAYEAR.


SET PARAMETER ID YCT FIELD YMOVIE-CATEGORY.

1994

Category

PIC

ENDMODULE.

GET

SET

** MZA04O01 - PBO Modules **


MODULE INITIALIZE OUTPUT.
YMOVIE-AAYEAR = 1994.

YYR = 1994

YMOVIE-CATEGORY = PIC.

YCT = PIC

GET PARAMETER ID YYR FIELD YMOVIE-AAYEAR.


GET PARAMETER ID YCT FIELD YMOVIE-CATEGORY.
ENDMODULE.

Default Values and Cursor Position |

Parameter ID Memory

Dec-2008

2005 IBM Corporation

IBM Global Services

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.

Default Values and Cursor Position |

Notice the
parameter
ID name

Dec-2008

2005 IBM Corporation

IBM Global Services

Hold Data
System > User profile > Hold data

Screen Attributes

menu path
Academy Awards
Year

1994

Category

PIC

Short Description
Screen Type

Hold Data

If the user selects the System > User profile > Hold data menu path on a screen
and the screen has been set up for Hold data in the screen attributes, the values
on the screen will be saved by the system for the next time the user comes to the
screen during the current logon.

10

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

Cursor Position

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.

Academy Awards

11

Year

1994

Category

PIC

Winner

Forrest Gump

Notes

The Shawshank Redemption should have won.

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

Positioning the Cursor


Screen Attributes
Short Description

** PBO Module **
OR

Screen Type

MODULE INITIALIZE OUTPUT.


SET CURSOR FIELD
YMOVIE-NOTES.

Cursor position

YMOVIE-NOTES

ENDMODULE.

Academy Awards

12

Year

1994

Category

PIC

Winner

Forrest Gump

Notes

The Shawshank Redemption should have won.

Default Values and Cursor Position |

New Cursor Position

Dec-2008

2005 IBM Corporation

IBM Global Services

Demonstration
Setting default values for fields in a screen.

13

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

Practice
Setting default values for fields in a screen.

14

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

Summary
You can set default values for screen fields using three methods:
In a PBO module
Assign values to screen fields using Parameter IDs for ABAP Dictionary fields
Use Hold Data function for the screen.

By default, the cursor will be positioned in the first field open for input on a screen.
You can change this position two ways:
Set the cursor position in the Screen Attributes
Use the SET CURSOR FIELD ABAP statement in a PBO module.

15

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

IBM Global Services

Questions
What are the different methods for setting default values in a screen ?
What are Parameter IDs ?
Where is the cursor positioned in the screen by default ?

16

Default Values and Cursor Position |

Dec-2008

2005 IBM Corporation

Вам также может понравиться