‎2013 Dec 06 6:21 AM
Hi experts,
I Have A Requirement That..I Have Created A Check Box ....
Parameters: P_c As Check Box Default 'X'.
So Can We Assign the Authorization For That Check Box.....Means Only 'ABAP' And 'HBTABAP' Can Un Tick That..Check Box .Means Only Those 2 Users can Have That access To Disable That Check Box tick mark...Can You Help Me out Of This Experts..
Regards,
uday..
‎2013 Dec 06 9:16 AM
hi ,
at selection screen output.
loop at screen.
if sy-uname ne 'ABAP' or sy-uname 'HBTABAP' .
if screen-name cs 'p_c'.
screen-active = 0.
endif.
endif.
modify screen.
endloop.
‎2013 Dec 06 6:32 AM
Hi Uday,
you can make use of event at selection screen output.
in this event put a condition as below.
if sy-uname = 'ABAP' OR 'HBTABAP' .
loop at screen.
if screen-name = p_c.
screen-disable = 'X'.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = p_c.
clear screen-disable.
modify screen.
endif.
endloop.
endloop.
Please publish if you face any issues on the same
Regards,
Bhaskar
‎2013 Dec 06 7:21 AM
Hi sir,
when i am trying to do that i am facing the below mentioned problem..
1. incorrect logic expression
2. The data object "SCREEN" does not have a component called "DISABLE".
‎2013 Dec 06 7:26 AM
‎2013 Dec 06 8:46 AM
Hi Uday,
check with
screen-active or screen-input.
Please publish if you still face issues.
Thanks,
Bhaskar
‎2013 Dec 06 9:25 AM
hi Sir,
p_chk = 'x' ..by default tick mark is there..so only ajit and sawant user's can untick ...it
so mine is abap when i am untick it it is happening..below is the code i have developed as you said..but it is not working.
AT SELECTION-SCREEN OUTPUT.
if sy-uname = 'SAWANT' OR SY-UNAME = 'AJIT'.
ELSE.
loop at screen.
if screen-name CS p_chk.
SCREEN-INPUT = 0.
modify screen.
endif.
endloop.
endif.
regards,
uday
‎2013 Dec 06 10:02 AM
Hi Uday,
I suggest you to check in debugging, so you are sure that it is not working. then keep a break point at IF statement , then it will be stopped at that point and you can execute statement by statement.
then you will be able to know at which point it is failing.
Let me correct the code here,
if screen-name CS p_chk this line should be like below
IF_SCREEN-NAME = 'P_CHK'.
let me tell you reason, you are checking the screen-field name whether it contains P_CHK or not. we dont bother about the value in p_chk at this point of time.
Happy learning dude.
Regards,
Bhaskar
Message was edited by: bhaskar doppalapudi
‎2013 Dec 06 6:54 AM
Hi,
May I suggest that you use AUTHORITY-CHECK.
That way you do not have to hard code user names in the program.
if 'ABAP' and 'HBTABAP' are developers you can use developer specific authorization objects.
You can also create your own authorization objects.
Regards.
‎2013 Dec 06 7:02 AM
Hi Uday,
If the list of user fixed for ever that these two user will can do this, then you can hard code the user's name and write code accordingly in AT-SELECTION SCREEN OUTPUT. For that you have to use Loop at screen statement as mention by Bhaskar. Check the SCREEN table for attributes of input fields.
If in future the list of user, who can untick the check box, may change then it's better you use authority check.
IF the user's fall into a particular role, then you can create a authorization object and assign it to that role. Then you can check the authorization object in your program to achieve this functionality.
Regards,
Ajit
‎2013 Dec 06 7:28 AM
Hi uday,
Instead of the showing the check box to other user make them invisble.
if sy-uname ne 'ABAP' or sy-uname ne 'HDABAP'.
use the loop at screen and set the use the Visible and invisible field .
endif.
Regards.
Nishant Bansal
‎2013 Dec 06 9:16 AM
hi ,
at selection screen output.
loop at screen.
if sy-uname ne 'ABAP' or sy-uname 'HBTABAP' .
if screen-name cs 'p_c'.
screen-active = 0.
endif.
endif.
modify screen.
endloop.
‎2013 Dec 06 10:06 AM
TRY THIS,
**************************
PARAMETERS: p_c AS CHECKBOX DEFAULT 'X'.
DATA: abap TYPE sy-uname VALUE 'ABAP'.
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'P_C' FOR USER abap id ' ' DUMMY.
IF sy-subrc NE 0 .
LOOP AT SCREEN.
CLEAR screen.
MODIFY SCREEN.
ENDLOOP.
ELSEIF sy-subrc <> 0.
MESSAGE 'No authorization' TYPE 'E'.
ENDIF.
‎2013 Dec 07 4:56 AM
Thank You All For Your valuable Suggestions...
Below is the code i Have developed...as per My Requirement..
So the users abap and hbtabap only can view the check box and can untick that remaining all users can view this in dispaly mode..
AT SELECTION-SCREEN OUTPUT.
IF sy-uname EQ 'ABAP' OR sy-uname EQ 'HBTABAP' .
ELSE.
LOOP AT SCREEN.
IF screen-name CS 'p_chk'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
‎2013 Dec 12 6:38 AM