How to set (unix) permissions when creating a file in SAP ABAP?

you would think it would be obvious, but when searching through documents, SAP forums, Googling, etc. I was impressively unsuccessful. I am creating a file in ABAP on the Solaris file system using the following code:

OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

the resulting file belongs and is grouped according to the predefined administrator user, which is good, but the sticky gate is that the permissions are set to 660 / rw-rw ----, which means that I can not examine the results. is there a way (maybe using this undefined TYPE definition?) Can I specify the resulting permissions for the new file?

thanks!

+5
source share
3 answers

4.6B:

        CONCATENATE 'chmod ugo=rw ' lc_filename
          INTO lc_chmod SEPARATED BY space.
        CALL 'SYSTEM' ID 'COMMAND' FIELD lc_chmod.

, .

Cheers,

+3

SM69, , ZCHMOD.

chmod, (man chmod - ).

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
  EXPORTING
    commandname                   = 'ZCHMOD'
    additional_parameters         = l_par
    operatingsystem               = l_os
  TABLES
    exec_protocol                 = it_log
  EXCEPTIONS
    no_permission                 = 1
    command_not_found             = 2
    parameters_too_long           = 3
    security_risk                 = 4
    wrong_check_call_interface    = 5
    program_start_error           = 6
    program_termination_error     = 7
    x_error                       = 8
    parameter_expected            = 9
    too_many_parameters           = 10
    illegal_command               = 11
    wrong_asynchronous_parameters = 12
    cant_enq_tbtco_entry          = 13
    jobcount_generation_error     = 14
    OTHERS                        = 15.

, , .

+4

In RZ10, add the install / umask parameter . The default value is 007, you can change it: 000, 002 ... Thus, the generated files will be -rw-rw-rw-, -rw-rw-r -...

+1
source

All Articles