Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

.Exe file in application server

Former Member
0 Likes
444

Hi All,

Can you tell me how to place .EXE file in application server . Can you help me with code to upload the exe file on application server. Or Is there any another way to do it.

Thanks

Shan

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
378

Try this code.



REPORT  zrich_0002.

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

data: file1 type string.

PARAMETERS: p_file1 TYPE localfile DEFAULT 'c:sapcar.exe',
            p_file2 TYPE localfile DEFAULT 'usrnspsyssapcar.exe'.

start-of-selection.

file1 = p_file1.
call method cl_gui_frontend_services=>gui_upload
   EXPORTING
    filename                = file1
    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.

Regards,

Rich Heilman

Hi All,

Can you tell me how to place .EXE file in application server . Can you help me with code to upload the exe file on application server. Or Is there any another way to do it.

Thanks

Shan

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
379

Try this code.



REPORT  zrich_0002.

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

data: file1 type string.

PARAMETERS: p_file1 TYPE localfile DEFAULT 'c:sapcar.exe',
            p_file2 TYPE localfile DEFAULT 'usrnspsyssapcar.exe'.

start-of-selection.

file1 = p_file1.
call method cl_gui_frontend_services=>gui_upload
   EXPORTING
    filename                = file1
    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.

Regards,

Rich Heilman