‎2006 Jun 06 5:53 AM
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
‎2006 Jun 06 5:59 AM
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,
‎2006 Jun 06 5:58 AM
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.
‎2006 Jun 06 5:59 AM
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,
‎2006 Jun 06 6:14 AM
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.
‎2006 Jun 06 6:39 AM
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.
‎2006 Jun 06 6:01 AM
IF sy-uname = 'XXXX'.
loop at screen.
if screen-name = 'xxx'.
screen-invisible = 1.
endif.
modify screen.
endloop.
endif.
Regards,
Ravi
‎2006 Jun 06 6:04 AM
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>
‎2006 Jun 06 6:25 AM
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
‎2006 Jun 06 6:37 AM
Thanks to All,
It is working fine now.
Once again thanks.
Regards,
MARK K.
‎2006 Jun 06 6:07 AM
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
‎2006 Jun 06 6:08 AM
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.
‎2006 Jun 06 6:09 AM
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.