I have Excel file and there are more than one worksheets (multiple worksheets), so I need to upload all data from this worksheets. This function 'TEXT_CONVERT_XLS_TO_SAP' is not suitable because upload only data from active worksheet (only one worksheet).
Asked
Active
Viewed 3,965 times
3 Answers
1
I found these. Normally the way this works is that you provide code what you've tried so far and where problems occured. Asking for solutions is not the thing you get here, but from google:
- https://archive.sap.com/discussions/thread/594226 --> sample coding in report
- https://archive.sap.com/discussions/thread/3191410 --> they even provide an sample report

dotchuZ
- 2,621
- 11
- 39
- 65
-
1**(1)** Example based on OLE (frontend only) **(2)** Example based on classes "Desktop Office Integration" (technology based on OLE + has some stuff at the SAP GUI to "accelerate" OLE - frontend only - note that TEXT_CONVERT_XLS_TO_SAP also uses DOI but SAP has simply limited its features to only one worksheet) – Sandra Rossi Sep 05 '18 at 12:10
0
data: l_t_data type w3mimetabtype,
l_t_files type filetable,
l_rc type i.
cl_gui_frontend_services=>file_open_dialog(
exporting
file_filter = '*.xlsx'
default_filename = '*.xlsx'
changing
file_table = l_t_files
rc = l_rc
).
check l_t_files[] is not initial.
cl_gui_frontend_services=>gui_upload(
exporting
filename = conv string( l_t_files[ 1 ]-filename )
filetype = 'BIN'
importing
filelength = data(l_length)
changing
data_tab = l_t_data
).
try.
data(l_r_xls) = new cl_fdt_xl_spreadsheet(
document_name = conv string( l_t_files[ 1 ]-filename )
xdocument = cl_fxs_converter=>w3mimetab_to_xstring( iv_w3mimetab = l_t_data iv_length = l_length )
).
catch cx_fdt_excel_core.
assert 1 = 2.
endtry.
l_r_xls->if_fdt_doc_spreadsheet~get_worksheet_names( importing worksheet_names = data(l_t_worksheets) ).

Marek
- 1
-2
can u put all data in one sheet ?
you can allways make a macro or so, and join all data from the sheets into one, and then use the TEXT_CONVERT_XLS_TO_SAP that you comment.
good luck

Luis Curado
- 724
- 5
- 16
-
no I can't put all data in one sheet - The condition is that the worksheets will be 14 pieces! – Mykola Sep 04 '18 at 12:10