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

CL_GUI_FRONTEND_SERVICES

Former Member
0 Likes
483

Hi ,

I am new to OOP ABAP.i want the code to upload a flat file from PC to appl server using CL_GUI_FRONTEND_SERVICES.

Thanks,

Rakesh.

Hi ,

I am new to OOP ABAP.i want the code to upload a flat file from PC to appl server using CL_GUI_FRONTEND_SERVICES.

Thanks,

Rakesh.

1 REPLY 1
Read only

Peter_Inotai
Active Contributor
0 Likes
444

You can have a look on this example:

Peter

*- Get current windows directory of user
  call method cl_gui_frontend_services=>directory_get_current
    CHANGING
      current_directory            = lv_currdir
    EXCEPTIONS
      directory_get_current_failed = 1
      cntl_error                   = 2.
*- Only for 4.7 or higher :
*      error_no_gui                 = 3
*      not_supported_by_gui         = 4
*      OTHERS                       = 5.

*- Open windows popup for file selection
  call method cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      initial_directory = lv_currdir
    CHANGING
      file_table        = lv_files
      rc                = lv_rc.

*- Get selected file from network or pc
  read table lv_files index 1 into lv_fname.


  call method cl_gui_frontend_services=>gui_upload
    EXPORTING
      filename        = lv_fname
      filetype        = lc_type
    CHANGING
      data_tab        = pt_f_cont[]
    EXCEPTIONS
      file_open_error = 1
      file_read_error = 2
      bad_data_format = 8
      others          = 19.