in src/zgoog_i_bqtr_gen_mass_cds_c02.prog.abap [0:0]
METHOD csv_to_itab.
TYPES: BEGIN OF lty_tab,
rec(1000) TYPE c,
END OF lty_tab.
DATA: lt_tab TYPE TABLE OF lty_tab,
ls_data TYPE gty_excel_data.
FIELD-SYMBOLS: <ls_tab> TYPE lty_tab.
cl_gui_frontend_services=>gui_upload(
EXPORTING
filename = iv_file
CHANGING
data_tab = lt_tab
EXCEPTIONS
file_open_error = 1 " File does not exist and cannot be opened
file_read_error = 2 " Error when reading file
no_batch = 3 " Front-End Function Cannot Be Executed in Backgrnd
gui_refuse_filetransfer = 4 " Incorrect front end or error on front end
invalid_type = 5 " Incorrect parameter FILETYPE
no_authority = 6 " No Upload Authorization
unknown_error = 7 " Unknown error
bad_data_format = 8 " Cannot Interpret Data in File
header_not_allowed = 9 " Invalid header
separator_not_allowed = 10 " Invalid separator
header_too_long = 11 " Header information currently restricted to 1023 bytes
unknown_dp_error = 12 " Error when calling data provider
access_denied = 13 " Access to File Denied
dp_out_of_memory = 14 " Not Enough Memory in DataProvider
disk_full = 15 " Storage Medium full
dp_timeout = 16 " Timeout of DataProvider
not_supported_by_gui = 17 " GUI does not support this
error_no_gui = 18 " GUI not available
OTHERS = 19
).
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT lt_tab ASSIGNING <ls_tab>.
CLEAR ls_data.
SPLIT <ls_tab>-rec AT ',' INTO ls_data-tablename
ls_data-cdsviewname
ls_data-sqlviewname.
APPEND ls_data TO ct_table.
ENDLOOP.
DELETE ct_table INDEX 1.