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

Reading screen attributes at runtime

Former Member
0 Likes
2,862

Hi all,

i want to read screen attributes (e.g. is the field editable or not) in abap. But i can't find a way to do that.

i know the fm RS_SCREEN_IMPORT  or  RPY_DYNPRO_READ  but these functions do only read the static attributes of the screen (Table D021S). But i need the attributs at runtime (including if they where modified by MODIFY SCREEN at PBO).

Has anyone a solution to this issue?

Thanks a lot.

André

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,056

Hi Andre,

Export the screen attributes in PAI of first screen and import them again in next screen call.

Thanks

Saurabh

10 REPLIES 10
Read only

Former Member
0 Likes
2,055

Hi,

If you want to check the screen attributes at run time. You can use the LOOP at Screen.

Check the structure of the 'SCREEN'

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
2,055

Use loop at Screen for check the attribute of each field

Read only

Former Member
0 Likes
2,055

Hi Andre,

Just to elaborate, in module pool programming, you can set screen field property in PBO. For that you use LOOP statement and a runtime table, SCREEN. This contains screen fields and their attributes.

Do not forget to use MODIFY screen.

Regards

Abhi

Read only

sivaganesh_krishnan
Contributor
0 Likes
2,055

you can use loop at screen .    endloop.

this will let you to process all the screen attribute.

Read only

Former Member
0 Likes
2,055

thanks for your answers.

in deed i can edit and read the attributes directly in the pbo by "loop at screen".

the problem is, that i need to read the values in another screen.

In screen B i need to read the attribute of screen A. and it is not possible to read the attributes in the PBO of screen A, because it is an standard screen. i can not "loop at screen" and read the current value.

i hope i could describe my problem more specific.

Regards

André

Read only

0 Likes
2,055

Hi Andre

You can store the attributes of Screen A in PAI via some implicit enhancemnt and then when PBO of your screen triggers you can read it..

Please provide program and screen number

Nabheet

Read only

0 Likes
2,055

I think I did not read that in the post and I thought you wanted to read same screen.

Regards

Abhi

Read only

Former Member
0 Likes
2,055

Hi Andre,

You can use loop at sceen.  endloop in the event at selection-screen output.

In between you can use the different variables from structure screen.

For example.:-

   LOOP AT SCREEN.
      IF screen-name    EQ 'S_TXT04' OR
        screen-group1  EQ 'ID1'.
        screen-active = '0'.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name    EQ 'S_TXT04' OR
    ENDLOOP.                           " LOOP AT SCREEN.

Here it searches for screen name is eq to S_TXT04 or its group is equal to ID1.

if it matches then screen fields with group ID1 will be active.

Like screen-active you can use these variables as well:

NAME

GROUP1

GROUP2

GROUP3

GROUP4

REQUIRED

INPUT

OUTPUT

INTENSIFIED

INVISIBLE

LENGTH

ACTIVE

DISPLAY_3D

VALUE_HELP

REQUEST

VALUES_IN_COMBO

COLOR

Regards,

Vineesh.

Read only

0 Likes
2,055

I did solve the problem by saving the data in the PBO of screen A (by loop at screen) in an internal talbe and read this stored data in screen B

thanks a lot for your help!

Read only

Former Member
0 Likes
2,057

Hi Andre,

Export the screen attributes in PAI of first screen and import them again in next screen call.

Thanks

Saurabh