on ‎2022 Aug 12 8:07 AM
How to create authorization checking with tcode? I have tried many ways like creating transaction ZSDI_DRIVER_INFO and ZSDR_DRIVER_INFO during in tcode se80 and assigned the authorization object (F_BKPF_BUK) to the respective tcode.
But nothing change, even when testing I try to insert data not in authorization, It still allows the user to save. I am new in SAP ABAP. Hopefully can get some advice on this...
MODULE USER_COMMAND_0100 INPUT.
CASE ok_code.
WHEN 'CONFIRM' .
IF gv_bukrs IS INITIAL
OR gv_icno IS INITIAL
OR gv_status IS INITIAL.
MESSAGE 'Please fill in field required.' type 'E'.
CALL SCREEN '0100'.
ENDIF.
PERFORM check_data.
WHEN 'QUERY'.
CALL SCREEN '0200'.
WHEN 'UPDATE'.
IF gv_bukrs IS INITIAL
OR gv_icno IS INITIAL
OR gv_status IS INITIAL.
MESSAGE 'Please fill in field required.' type 'E'.
CALL SCREEN '0100'.
ENDIF.
PERFORM check_data2.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.

Request clarification before answering.
From your requirement I understand that you have to code some AUTHORITY-CHECK statements in your code such as
AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
ID 'BUKRS' FIELD gv_bukrs
ID 'ACTVT' FIELD '03'. " display/query
* For activity value, double-click on authorization object for list of values
* examples:
* 02 Update
* 03 Query
* 10 Confirm, etc.
IF sy-subrc <> 0.
* Implement a suitable exception handling here
ENDIF.Adding the authorization object to the transaction definition will only trigger a check at start of transaction with the values you also provided to this transaction (click on 'values' from SE93 screen)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.