Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

authority check

Former Member
0 Likes
743

HI abapers

how to check the authority for a custom field in my screen

thanks in advance

priya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
678

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

4 REPLIES 4
Read only

FredericGirod
Active Contributor
0 Likes
678

Hi,

look the syntax of the command : Authority-check. (F1 in SE38 on this words).

Rgd

Frédéric

Read only

Lakshmant1
Active Contributor
0 Likes
678

Hi Priya,

Check demo programs

DEMO_AUTHORITY_CHECK

DEMO_SPECIAL_TECH_AUTH_CHECK

Hope this helps

Thanks

Lakshman

Read only

Former Member
0 Likes
679

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

Read only

vinod_gunaware2
Active Contributor
0 Likes
678

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