"
Supported by

(Português) Verificar pasta

Sorry, this entry is only available in European Portuguese. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.

Eis uma função para verificar se uma pasta existe e se nela temos permissões de escrita.


PARAMETERS: p_dir TYPE btctext80 DEFAULT '/usr/sap/trans'.

CALL FUNCTION 'PFL_CHECK_DIRECTORY'
  EXPORTING
    directory = p_dir
    write_check = 'X'
* FILNAME = ' '
  EXCEPTIONS
    pfl_dir_not_exist = 1
    pfl_permission_denied = 2
    pfl_cant_build_dataset_name = 3
    pfl_file_not_exist = 4
    others = 5.

CASE sy-subrc.
  WHEN 0.
    WRITE /: 'Directory:', p_dir, ' exists'.
  WHEN 1.
    WRITE /: 'Directory does not exist:', p_dir.
  WHEN 2.
    WRITE /: 'No permission to write in directory:', p_dir.
ENDCASE.

Obrigado Renato Oliveira.

O Abapinho saúda-vos.

Deixe um comentário


About Abapinho
Abapinho runs on WordPress
Articles (RSS) e Comments (RSS).