2006 Feb 24 12:44 PM
HI abapers
how to check the authority for a custom field in my screen
thanks in advance
priya
2006 Feb 24 12:51 PM
hi
check this
PARAMETERS pa_carr LIKE sflight-carrid.
DATA wa_flights LIKE demo_focc.
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'CARRID' FIELD pa_carr
ID 'ACTVT' FIELD '03'.
IF sy-subrc = 4.
MESSAGE e045(sabapdocu) WITH pa_carr.
ELSEIF sy-subrc <> 0.
MESSAGE e184(sabapdocu) WITH text-010.
ENDIF.
START-OF-SELECTION.
SELECT carrid connid fldate seatsmax seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF wa_flights
WHERE carrid = pa_carr.
WRITE: / wa_flights-carrid,
wa_flights-connid,
wa_flights-fldate,
wa_flights-seatsmax,
wa_flights-seatsocc.
ENDSELECT.
regards
kishore
HI abapers
how to check the authority for a custom field in my screen
thanks in advance
priya
2006 Feb 24 12:46 PM
Hi,
look the syntax of the command : Authority-check. (F1 in SE38 on this words).
Rgd
Frédéric
2006 Feb 24 12:47 PM
Hi Priya,
Check demo programs
DEMO_AUTHORITY_CHECK
DEMO_SPECIAL_TECH_AUTH_CHECK
Hope this helps
Thanks
Lakshman
2006 Feb 24 12:51 PM
hi
check this
PARAMETERS pa_carr LIKE sflight-carrid.
DATA wa_flights LIKE demo_focc.
AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'CARRID' FIELD pa_carr
ID 'ACTVT' FIELD '03'.
IF sy-subrc = 4.
MESSAGE e045(sabapdocu) WITH pa_carr.
ELSEIF sy-subrc <> 0.
MESSAGE e184(sabapdocu) WITH text-010.
ENDIF.
START-OF-SELECTION.
SELECT carrid connid fldate seatsmax seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF wa_flights
WHERE carrid = pa_carr.
WRITE: / wa_flights-carrid,
wa_flights-connid,
wa_flights-fldate,
wa_flights-seatsmax,
wa_flights-seatsocc.
ENDSELECT.
regards
kishore
2006 Feb 24 1:39 PM
SUSR_USER_DISPLAY_WITH_AUTHS Displays user authorisation objects (Note: may have to debug around authority checks)
The following code demonstrates how to check that a user has the correct authority for a particular transaction code. Useful to check if a user has the correct authority before executing a transaction via
BDC input.
authority-check object 'S_TCODE'
id 'TCD'
field 'SM35'.
if sy-subrc ne 0.
User does not have authority for transaction SM35!!!
endif.
Authorisation trace analysis
1. Open two sessions
2. Execute transaction ST01 in one of the sessions
3. Select the authorisation checkbox, note the other traces
you can perform (SQL, RFC, Table Buffer etc)
4. Click the 'Trace On' button
5. Within your other session execte the transaction/report
you want to trace or get the user in question to do it
6. Return to the session where you turned the trace on and
click on 'Trace Off' otherwise it will continue to record all athorisation checks
7. Click on the 'Analysis' button
8. Enter appropriate data into selection screen such as
Username, type of trace records (i.e. Authorization check)
9. Click on the Execute button.
10. Report displaying trace results will now be displayed
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |