[ABAP] Datei zw. Verzeichnissen des Appl.-Servers kopieren

PARAMETERS: p_s_file TYPE EPSFILNAM OBLIGATORY. " Quelldatei
PARAMETERS: p_s_dir  TYPE EPSDIRNAM OBLIGATORY. " Quelldirectory
PARAMETERS: p_t_file TYPE EPSFILNAM OBLIGATORY. " Zieldatei
PARAMETERS: p_t_dir  TYPE EPSDIRNAM OBLIGATORY. " Zieldirectory

START-OF-SELECTION.

  cl_cts_language_file_io=>copy_files_local( EXPORTING
                                               im_source_file           = p_s_file
                                               im_source_directory      = p_s_dir
                                               im_target_file           = p_t_file
                                               im_target_directory      = p_t_dir
                                               im_overwrite_mode        = 'F'
                                             EXCEPTIONS
                                               open_input_file_failed   = 1
                                               open_output_file_failed  = 2
                                               write_block_failed       = 3
                                               read_block_failed        = 4
                                               close_output_file_failed = 5
                                               OTHERS                   = 6 ).

  IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.