2010 May 31 3:48 PM
Hi,
i want to check the authority before the selection-screen. I do it in this way:
AT SELECTION-SCREEN OUTPUT.
*
AUTHORITY-CHECK OBJECT 'Z_REPORT'
ID 'PROGRAM' FIELD SY-REPID
ID 'ACTVT' FIELD '16'. "Ausführen
*
IF SY-SUBRC <> 0.
MESSAGE E010 WITH 'Keine Berechtigung für Programm: '
SY-REPID.
ENDIF.
*
But the selection appears without any parameters.
Is there a way to check without the selection-screen?
thanks.
regards, Dieter
2010 May 31 4:05 PM
Probably not, processing is already in PBO stage at this point, same with INITIALIZATION.
There is an authorization group in the program attributes that is checked before any selection screen appears, but this works with standard authorization objects S_PROGRAM and S_DEVELOP. Maybe look into using these instead of your own Z_REPORT.
Thomas
Hi,
i want to check the authority before the selection-screen. I do it in this way:
AT SELECTION-SCREEN OUTPUT.
*
AUTHORITY-CHECK OBJECT 'Z_REPORT'
ID 'PROGRAM' FIELD SY-REPID
ID 'ACTVT' FIELD '16'. "Ausführen
*
IF SY-SUBRC <> 0.
MESSAGE E010 WITH 'Keine Berechtigung für Programm: '
SY-REPID.
ENDIF.
*
But the selection appears without any parameters.
Is there a way to check without the selection-screen?
thanks.
regards, Dieter
2010 May 31 3:59 PM
Hi Dieter,
Please check the below code for at selection screen authorization check.
Handling selection screen events
AT SELECTION-SCREEN ON p_carrid.
IF p_carrid IS INITIAL.
MESSAGE 'Please enter a value' TYPE 'E'.
ENDIF.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'CARRID' FIELD p_carrid
ID 'ACTVT' FIELD '03'.
IF sy-subrc = 4.
MESSAGE 'No authorization for carrier' TYPE 'E'.
ELSEIF sy-subrc <> 0.
MESSAGE 'Error in authority check' TYPE 'A'.
ELSE.
IF sy-ucomm = 'ONLI'.
CALL SELECTION-SCREEN '0500'.
ENDIF.
ENDIF.
Regards,
Md Ziauddin
2010 May 31 4:03 PM
2010 May 31 4:05 PM
Probably not, processing is already in PBO stage at this point, same with INITIALIZATION.
There is an authorization group in the program attributes that is checked before any selection screen appears, but this works with standard authorization objects S_PROGRAM and S_DEVELOP. Maybe look into using these instead of your own Z_REPORT.
Thomas
2010 May 31 4:32 PM
Hi Thomas,
thanks for your answer, i will do it in this way.
Regards, Dieter
2010 May 31 4:06 PM
Hi,
If you give Error message in AT SELECTION-SCREEN OUTPUT, control directly exits from the screen. Give your authorization group in program attributes or give it in the transaction code created for that program. This will make sure that the check happens before the program is started for execution.
Thanks,
Vinod.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |