2009 Mar 11 4:26 PM
Hi Guys/Dolls
I've written a program (ok I lie not me - some other ABAPER) but I need to modify it slightly.
I need to evaluate which user group the person is in and based upon that enable or diasble a selection item on the front screen.
Would appreciate any help + a very small code example would suffice.
Many thanks in advance.
Raj
Hi Guys/Dolls
I've written a program (ok I lie not me - some other ABAPER) but I need to modify it slightly.
I need to evaluate which user group the person is in and based upon that enable or diasble a selection item on the front screen.
Would appreciate any help + a very small code example would suffice.
Many thanks in advance.
Raj
2009 Mar 11 4:31 PM
Hi,
use the select query in the initialization event.
data : begin of wa,
BNAME type XUBNAME,
CLASS type XUCLASS,
end of wa.
INITIALIZATION.
select single BNAME " BNAME gives the user name from table USR02
class " Class gives the user group from table USR02
into wa
from usr02
where bname = sy-uname.
AT Selection-screen ouput.
if wa-class = 'XYZ'.
loop at screen.
if screen-name cs 'INPUTFIELD'.
screen-active = 0.
modify screen.
endif.
endloop.Regards,
Siddarth
2009 Mar 13 10:03 AM
Ok managed to solve this via the following piece of code which needs to go within the "initialization" section but still have one problem namely variants that were setup with the extraction option selected are still coming up with that option even though the code to disable the extraction option has been implemented as shown below - should the code below be implemented within the i"initialization" section or elsewhere?
initialization.
DATA: BEGIN OF user_parameters OCCURS 20.
INCLUDE STRUCTURE usparam.
DATA: END OF user_parameters.
CALL FUNCTION 'SUSR_USER_READ'
EXPORTING
user_name = sy-uname
TABLES
user_parameters = user_parameters.
IF sy-subrc <> 0.
MESSAGE i113(zh).
RETURN.
ELSE.
LOOP AT user_parameters.
IF user_parameters-parid = 'UGR' AND user_parameters-parva <> '99'.
LOOP AT SCREEN.
IF screen-name CS 'IEXT'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
ENDIF.
2009 Mar 13 5:01 PM
Finally sorted
I've had to re-duplicate the code at the
at selection-screen output.
so I've procedurised it now looks like this.
initialization.
* RP 12.03.09 - Disable the extraction radio button except when the user is in
* user group 99.
perform disable_extraction.
*
at selection-screen output.
perform screen_control.
* RP 12.03.09 - Disable the extraction radio button except when the user is in
* user group 99.
perform disable_extraction.
form DISABLE_EXTRACTION .
* RP - 12.03.09 - WO 1751 on CH1185.
* Disable the extraction radio button except when the user is in
* user group 99.
DATA: BEGIN OF user_parameters OCCURS 20.
INCLUDE STRUCTURE usparam.
DATA: END OF user_parameters.
CALL FUNCTION 'SUSR_USER_READ'
EXPORTING
user_name = sy-uname
TABLES
user_parameters = user_parameters.
IF sy-subrc <> 0.
MESSAGE i113(zh).
RETURN.
ELSE.
LOOP AT user_parameters.
IF user_parameters-parid = 'UGR' AND user_parameters-parva <> '99'.
LOOP AT SCREEN.
IF screen-name CS 'IEXT'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
ENDIF.
endform. " DISABLE_EXTRACTION
2009 Mar 13 5:04 PM
Hi,
instead of reduplicating the code...
you can just write it in at selection-screen output...
as this will also be triggered when the selection screen is displayed for the first time and all other time as well.
so just writing at that place will do...
Regards
Siddarth
2009 Mar 13 5:03 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |