Fonction SAP AUTHORITY_CHECK_DATASET - Check Authorization for File Access

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
ACTIVITY C C 0 Access Type (See Function Documentation)
FILENAME AUTHB-FILENAME C 60 File name
PROGRAM AUTHB-PROGRAM C 40 X ABAP program in which access occurs

Exception Description
ACTIVITY_UNKNOWN Access type unknown
NO_AUTHORITY You are not authorized for this access

Functionality
This function module allows you to check authorization to access files(with the key words OPEN DATASET,READ DATASET, TRANSFER andDELETE DATASET). A check should be performedbefore opening a file.
The authorization check is performed uwing the authorization objectS_DATASET.
Description of function parameters:

  • PROGRAM: Name of the ABAP program from which the file access is
  • performed. If no program name is specified, the system assumes thecurrent program.
    • ACTIVITY: Access type. The possible values are:

    • READ: Read file
      WRITE: Change file
      READ_WITH_FILTER: Read file with filter function
      WRITE_WITH_FILTER: Change file with filter function
      DELETE: Delete file
      • FILENAME: Name of accessed file
      • Example
        TYPE-POOLS SABC.
        CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
        EXPORTING PROGRAM = 'ZDATASET'
        ACTIVITY = SABC_ACT_READ
        FILENAME = '/tmp/sapv01'
        EXCEPTIONS NO_AUTHORITY = 1
        ACTIVITY_UNKNOWN = 2.

        Notes
        The values to be passed as the ACTIVITY are defined as constantsin the TYPE-POOL SABC.

1550116Syntax error in program SAPLSABC
1046588Runtime error OPEN_DATASET_NO_AUTHORITY during phrase export