Skip to content
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

Performance issue using zcl_excel_writer_2007 #528

Closed
MLDOliveira opened this issue Mar 16, 2018 · 12 comments
Closed

Performance issue using zcl_excel_writer_2007 #528

MLDOliveira opened this issue Mar 16, 2018 · 12 comments

Comments

@MLDOliveira
Copy link

MLDOliveira commented Mar 16, 2018

Hi.

I'm starting to use ABAP2XLSX and my first was great, but I'm trying to generate a new XLSX file with 300.000,00 lines and the process is going really slow.

I'm using the code from ZDEMO_EXCEL_OUTPUTOPT_INCL.

This is a summary that I'm using in my code.

CREATE OBJECT go_excel.
gs_table_settings-table_style = zcl_excel_table=>builtinstyle_medium2.
gs_table_settings-show_row_stripes = abap_true.
gs_table_settings-nofilters = abap_true.

"After fisrt declarations I fill the internal table and use bind method
go_worksheet = go_excel->get_active_worksheet( ).
go_worksheet->set_title( "TABLE1" ).
go_worksheet->bind_table( ip_table = it_001_saida10_exc
is_table_settings = gs_table_settings ).

"After that I basically use the code below.
lcl_output=>output( go_excel ).

"I'm doing a test right now using the ZCL_EXCEL_WRITER_HUGE_FILE class with the code below instead of code above

lcl_output=>output( cl_excel = go_excel
iv_writerclass_name = 'ZCL_EXCEL_WRITER_HUGE_FILE' ).

My question is, there is a better way to work with huge files? What is the right way to export big files with many tabs?

@ivanfemia @larshp could you help me?

@ivanfemia
Copy link
Collaborator

ivanfemia commented Mar 16, 2018 via email

@MLDOliveira
Copy link
Author

@ivanfemia do you have an example of using the class ZCL_EXCEL_WRITER_HUGE_FILE?
I'm trying to use it but I'm not moving forward

@ivanfemia
Copy link
Collaborator

ivanfemia commented Mar 16, 2018 via email

@MLDOliveira
Copy link
Author

@ivanfemia the problem is when I use the code below I get a erro message saing that "the method CREATE_XL_SHEET is protected"

CREATE OBJECT cl_writer_huge TYPE zcl_excel_writer_huge_file.
cl_output->xdata = cl_writer_huge->create_xl_sheet( cl_excel ).

@ivanfemia
Copy link
Collaborator

ivanfemia commented Mar 19, 2018 via email

@Pacojka
Copy link

Pacojka commented Jun 28, 2018

Hallo Ivan,

i am facing the same problem.
The main performance issue comes from the getter methods (e.g. ZCL_EXCEL_WORKSHEET->GET_ROW) searching for the right object using an object collection (while/has_next, get_next, if statement).

One quick approach would be to use the object collection and a Hash Table simultaneously. If an object is added to the collection, we add it to the hash table (e.g. key row_id and a reference to the row object). If we need to iterate over all rows, we can still use the object collection. But if we know which object we need, we get it from the hash table with a simple read.

In MLDOliveira´s case, this saves up to 299.999 iterations while calling ZCL_EXCEL_WORKSHEET ->get_row( 300000 ) once. The performance gain while working with big tables should be huge.

I try to find some time to contribute in this great project.

Patrick

@ivanfemia
Copy link
Collaborator

ivanfemia commented Jun 28, 2018 via email

@larshp
Copy link
Member

larshp commented Jun 28, 2018

Guess the PR is https://github.com/ivanfemia/abap2xlsx/pull/532

@ivanfemia
Copy link
Collaborator

ivanfemia commented Jun 28, 2018 via email

@larshp
Copy link
Member

larshp commented Jan 13, 2019

guess this issue can be closed?

@MLDOliveira
Copy link
Author

I didn't test after the merge on July, but I read the comments and apparenty the problem was solved.

@sandraros
Copy link
Collaborator

Let's close the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants