Application Development 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: 

Screen painter

Former Member
0 Kudos

Hi Friends,

I have made a GUI screen using Screen Paiter, having around 12 input fields. Out of these 12 input fields, I want to disable five fields for some user.

ie., In a sigle screen, some fields should be enabled for entry and some should be disabled, based on the user name.

Please guide me as to how to achieve this.

Regards,

MARK K

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Just put this code at your PBO Module.


IF SY-UNAME = "xxx".
  LOOP AT SCREEN.
    IF SCREEN-NAME CS 'FIELD1'.
        SCREEN-ACTIVE  = '1'.
        SCREEN-OUTPUT  = '1'.
        SCREEN-INVISIBLE = '1'.
        MODIFY screen .
    ENDIF.

    IF SCREEN-NAME CS 'FIELD2'.
        SCREEN-ACTIVE  = '1'.
        SCREEN-OUTPUT  = '1'.
        SCREEN-INVISIBLE = '1'.
        MODIFY screen .
    ENDIF.
    ........
  ENDLOOP.
ENDIF.

Notes:

  • Sy-Uname = User Name

  • Field1 = Your Field name

  • Set INVISIBLE to = 0 for INVISIBLE.

Regards,

11 REPLIES 11

Former Member
0 Kudos

yeah u can do/achieve by using

but u have to put a logic on what basis u have to disable that one.

loop at screen.
screen-input = 0.
modify screen.
endloop.

Former Member
0 Kudos

Hi,

Just put this code at your PBO Module.


IF SY-UNAME = "xxx".
  LOOP AT SCREEN.
    IF SCREEN-NAME CS 'FIELD1'.
        SCREEN-ACTIVE  = '1'.
        SCREEN-OUTPUT  = '1'.
        SCREEN-INVISIBLE = '1'.
        MODIFY screen .
    ENDIF.

    IF SCREEN-NAME CS 'FIELD2'.
        SCREEN-ACTIVE  = '1'.
        SCREEN-OUTPUT  = '1'.
        SCREEN-INVISIBLE = '1'.
        MODIFY screen .
    ENDIF.
    ........
  ENDLOOP.
ENDIF.

Notes:

  • Sy-Uname = User Name

  • Field1 = Your Field name

  • Set INVISIBLE to = 0 for INVISIBLE.

Regards,

0 Kudos

I am getting the following error, when I used your code.

I have used this code in PBO part.

-


Field "LOOP" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement.

-


IF SY-UNAME = "abcd".

LOOP AT SCREEN.

IF SCREEN-NAME CS 'Ztab-Amount'.

SCREEN-INVISIBLE = '1'.

MODIFY screen .

ENDIF.

ENDLOOP.

ENDIF.

-


Pls let me know what is screen-name.

Pls help.

Regards,

Field "LOOP" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement.

0 Kudos

Hi Mark,

If your requirement is hiding the I/O field , then use the ACTIVE element of the int.table SCREEN and not INVISIBLE.

IF SY-UNAME = "ABCD".

LOOP AT SCREEN.

IF SCREEN-NAME CS 'ZTAB-AMOUNT'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Regards,

SP.

Former Member
0 Kudos

IF sy-uname = 'XXXX'.

loop at screen.

if screen-name = 'xxx'.

screen-invisible = 1.

endif.

modify screen.

endloop.

endif.

Regards,

Ravi

Former Member
0 Kudos

Hi Mark,

U can assign a group name to those fields..

When the user open the screen u can check the sy-uname.

IF sy-uname = 'some name'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'MOD'.

screen-input = 0.

SCREEN-INVISIBLE = 1.

endif.

modify screen.

endloop.

endif.

Hope that helps.

Regards,

Tanveer.

<b>Please mark helpful answers.</b>

0 Kudos

Thanks Tanveer,

Your example works fine but, I am getting star mark (*) in all the fields of this particular group.

How to remove the astrick mark.

Pls guide me.

Regards

0 Kudos

Thanks to All,

It is working fine now.

Once again thanks.

Regards,

MARK K.

Former Member
0 Kudos

Hi,

Use the event AT SELCTION SCREEN OUTPUT. In this event based up on the user name loop the screen and set the corresponding properties for the UI elements. The properties are like Name (Element Name),Visible, Input etc.,

Example: SCREEN-INVISIBLE = 1

SCREEN-INPUT = 1.

Hope this helps.

Regs,

Venkat

Message was edited by: Venkat Ramanan Natarajan

Message was edited by: Venkat Ramanan Natarajan

Message was edited by: Venkat Ramanan Natarajan

Former Member
0 Kudos

Hi,

Use

loop at screen.

screen-input = 0.

modify screen.

endloop.

You can also group the fields according to read only or read/write only.

E.g., All read only fields belong to GRP1.

then do

screen-input = 0.

screen-output = 1.

modify screen.

Regards,

Sangeeta.

Former Member
0 Kudos

Hi,

Use

loop at screen.

screen-input = 0.

modify screen.

endloop.

You can also group the fields according to read only or read/write only.

E.g., All read only fields belong to GRP1.

then do

screen-input = 0.

screen-output = 1.

modify screen.

Regards,

Sangeeta.