EXE file uploading (Presentation/Application Servers)

by Alexander

REPORT zdemo.

DATA: idata_tab TYPE TABLE OF string.
DATA: xdata_tab TYPE string.

data: w_file type string.

PARAMETERS: p_file1 TYPE localfile DEFAULT 'c:\sapcar.exe',
                             p_file2 TYPE localfile DEFAULT '\usr\nsp\sys\sapcar.exe'.

start-of-selection.

w_file = p_file1.
call method cl_gui_frontend_services=>gui_upload
  EXPORTING
      filename = w_file
      filetype = 'ASC'
  CHANGING
      data_tab = idata_tab
  EXCEPTIONS
      file_open_error = 1
      file_read_error = 2
      no_batch = 3
      gui_refuse_filetransfer = 4
      invalid_type = 5
      no_authority = 6
      unknown_error = 7
      bad_data_format = 8
      header_not_allowed = 9
      separator_not_allowed = 10
      header_too_long = 11
      unknown_dp_error = 12
      access_denied = 13
      dp_out_of_memory = 14
      disk_full = 15
      dp_timeout = 16
      not_supported_by_gui = 17
      error_no_gui = 18.

OPEN DATASET p_file2 FOR OUTPUT IN BINARY MODE.
CHECK sy-subrc = 0.
 LOOP AT idata_tab INTO xdata_tab.
    TRANSFER xdata_tab TO p_file2.
ENDLOOP.
CLOSE DATASET p_file2.

 


 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image