-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Excel file creation takes extremely long time #1043
Comments
abap2xlsx is quite slow but more than 60.000 seconds for 5757 rows and 57-60 columns seems exaggerated for abap2xlsx alone. First, make sure that you have cloned the latest version of abap2xlsx. Secondly, do a test with abap2xlsx alone. The program below took 32 seconds in my case. Make sure you have at least 6000 rows in SELECT * FROM mara UP TO 6000 ROWS INTO TABLE @DATA(table).
DATA(workbook) = NEW zcl_excel( ).
DATA(worksheet) = workbook->get_active_worksheet( ).
worksheet->bind_table( ip_table = table ).
DATA(xlsx_generator) = CAST zif_excel_writer( NEW zcl_excel_writer_huge_file( ) ).
DATA(xlsx_data) = xlsx_generator->write_file( workbook ). Thank you. |
Hi Sandra, But when i use table Table Example-Coding: SELECT * FROM coss UP TO 6000 ROWS INTO TABLE @DATA(table).
DATA(workbook) = NEW zcl_excel( ).
DATA(worksheet) = workbook->get_active_worksheet( ).
worksheet->bind_table( ip_table = table ).
DATA(xlsx_generator) = CAST zif_excel_writer( NEW zcl_excel_writer_huge_file( ) ).
DATA(xlsx_data) = xlsx_generator->write_file( workbook ). The program already took 1 hour and is still running. Could you also try to reproduce this behaviour? Thank you. |
Thank you very much, it doesn't end even with 1 row. There's a bug in method
|
Minimal program to reproduce the bug (endless loop during DATA(gc_save_file_name) = 'bug_1043.xlsx'.
INCLUDE zdemo_excel_outputopt_incl.
START-OF-SELECTION.
DATA(workbook) = NEW zcl_excel( ).
TYPES: BEGIN OF ty_excel_table_line,
field_1 TYPE i,
field_2 TYPE i,
field_3 TYPE i,
END OF ty_excel_table_line,
ty_excel_table TYPE STANDARD TABLE OF ty_excel_table_line WITH EMPTY KEY.
DATA(excel_table) = VALUE ty_excel_table( ).
DATA(field_catalog) = zcl_excel_common=>get_fieldcatalog( ip_table = excel_table ).
LOOP AT field_catalog ASSIGNING FIELD-SYMBOL(<field_catalog_line>).
<field_catalog_line>-scrtext_l = 'Text Text Text Text Text Text Text Tex'.
ENDLOOP.
DATA(worksheet) = workbook->get_active_worksheet( ).
worksheet->bind_table( ip_table = excel_table
it_field_catalog = field_catalog
is_table_settings = VALUE #( top_left_column = 'A' top_left_row = 1 )
iv_default_descr = 'L' ). |
Hi Sandra, thank you very much for your help, the new code fixed my issue. Best regards, Marc |
Fix #1043 * endless loop in bind_table * Handle more than 100 identical texts * correct typos in comments Co-authored-by: sandraros <sandra.rossi@gmail.com> Co-authored-by: Abo <andrea@borgia.bo.it>
Hi,
my intention is to schedule the Controlling period closing reports via background jobs and send the results as attachements in e-mails.
The excel creation for small result table works fine. But with larger results (5757 rows and 57-60 columns) i have massive problems. I have already tried to use ZCL_EXCEL_WRITER_2007 and also ZCL_EXCEL_WRITER_HUGE_FILE. I cancelled both background jobs after 60.000 seconds without any result.
When i run the report online the extraction ALV GRID to Excel only takes a view seconds.
This is my coding (see also URL: https://blogs.sap.com/2021/07/28/sending-spool-list-into-excel-format-through-email-attachment/, comment from Sandra Rossi July 28, 2021 at 5:49 pm)
The attached file is an export from the result of report: SAPKKA00BG
EXPORT.XLSX
Do you have any advice for me?
Thank you very much.
Best regards,
Marc
The text was updated successfully, but these errors were encountered: