Back to

Custom authorization check program (Optional feature)

Code example

The following code blocks table MACKV for all users when accessing from Winshuttle QUERY.

FUNCTION Z_WINSHUTTLE_CHECK_ACCESS.

*"----------------------------------------------------------------------

*"*"Local Interface:

*" IMPORTING

*" VALUE(TABLE) TYPE DD02L-TABNAME

*" EXPORTING

*" VALUE(ALLOWED) TYPE BOOLEAN

*" EXCEPTIONS

*" ERROR

*"----------------------------------------------------------------------

*Return access allowed ('X'=True or '-'=False) for current user

ALLOWED = ''. "Initialize

IF TABLE = 'MACKV'. "For any user

ALLOWED = '-'.

ELSE.

ALLOWED = 'X'.

ENDIF.

ENDFUNCTION.

*"----------------------------------------------------------------------

Additionally, authority checking calls for your own authorization objects which can be added in conditions for current users (system field SY-UNAME).

Also in this section

Create custom function group

Create the function module for custom check

Maintain the Flag to activate the custom authorization check