Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Modify screen statement used in which event ?

former_member242512
Participant
0 Likes
2,091

Hi ,

We can use Modify screen statement in PBO . Can we use it in PAI ? If yes why and if not why ?

Thanks and regards

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
1,184

Hi,

You can modify the structure screen in your ABAP program during the PBO event of a screen, to modify screen elements in the ABAP program.

The modified elements override the static attributes of the screen fields for exactly a single screen call.

The only allowed statements that you can use with screen are:

LOOP AT SCREEN.
...
  MODIFY SCREEN.
...
ENDLOOP.

LOOP AT SCREEN is an own statement, which is not to be confused with a loop over an internal table.

At the beginning of the PBO, ACTIVE is always set to 1, regardless of the static attribute settings. Setting ACTIVE to 0 automatically sets INPUT = 0, OUTPUT = 0, and INVISIBLE = 1. Any other changes to the settings of INPUT; OUTPUT, and INVISIBLE to the current screen element are ignored. Conversely, setting INPUT = 0, OUTPUT = 0, and INVISIBLE = 1 automatically sets ACTIVE to 0, and any further assignment to ACTIVE for the current screen element will be ignored. The setting ACTIVE = 1 has no other effect on the attributes. The only purpose of the ACTIVE component is to allow you to make a screen field inactive through a single assignment. You should particularly note that a module call linked to a FIELD statement in the screen flow logic is always executed, even when SCREEN-ACTIVE = 0 for the field in question. If you want to prevent a module from being processed for an inactive field, you must specify the FIELD- and MODULE statements separately.

Next time, please use F1 yourself.

[Setting Attributes Dynamically|http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/content.htm]

Regards,

Clemens

5 REPLIES 5
Read only

Clemenss
Active Contributor
0 Likes
1,184

doubl

Edited by: Clemens Li on Nov 7, 2009 7:56 PM

Read only

Clemenss
Active Contributor
0 Likes
1,185

Hi,

You can modify the structure screen in your ABAP program during the PBO event of a screen, to modify screen elements in the ABAP program.

The modified elements override the static attributes of the screen fields for exactly a single screen call.

The only allowed statements that you can use with screen are:

LOOP AT SCREEN.
...
  MODIFY SCREEN.
...
ENDLOOP.

LOOP AT SCREEN is an own statement, which is not to be confused with a loop over an internal table.

At the beginning of the PBO, ACTIVE is always set to 1, regardless of the static attribute settings. Setting ACTIVE to 0 automatically sets INPUT = 0, OUTPUT = 0, and INVISIBLE = 1. Any other changes to the settings of INPUT; OUTPUT, and INVISIBLE to the current screen element are ignored. Conversely, setting INPUT = 0, OUTPUT = 0, and INVISIBLE = 1 automatically sets ACTIVE to 0, and any further assignment to ACTIVE for the current screen element will be ignored. The setting ACTIVE = 1 has no other effect on the attributes. The only purpose of the ACTIVE component is to allow you to make a screen field inactive through a single assignment. You should particularly note that a module call linked to a FIELD statement in the screen flow logic is always executed, even when SCREEN-ACTIVE = 0 for the field in question. If you want to prevent a module from being processed for an inactive field, you must specify the FIELD- and MODULE statements separately.

Next time, please use F1 yourself.

[Setting Attributes Dynamically|http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/content.htm]

Regards,

Clemens

Read only

Former Member
0 Likes
1,184

Modify screen will work only in PBO .It makes no sense in PAI as the screen is already outputted on the GUI when event PAI is fired.modify screen shd be always defined in between loop at screen statement.

Read only

Former Member
0 Likes
1,184

Hi Ujjawal,

There is not sense to keep MODIFY SCREEN statement in PAI , as it changes the properties of screen elements before display, to display them as desired.

PAI is executed after the dislpay of screen.

Hence, MODIFY SCREEN is placed in PBO which is executed before display of screen.

Hope you understand it.

Read only

0 Likes
1,184

Hi , Thanks for your answers ...