Application Development 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: 

ABAP2XLSX. Blank sheets

0 Kudos

I download the project form code exchange.

When I run the demo reports all the files are empty.

When I debug the internal tables are filled.

Whe trying to open the file in excel I recieve a message that the file format is wrong.

Any idea what I did wrong.

Thanks

Frances

1 ACCEPTED SOLUTION

0 Kudos

I download the tatest NUGG and activation of all objects.

All demos are working.

Thanks for your help.

One last question. How do I transport all this to the QA and production systems.

Regards

Frances

12 REPLIES 12

Former Member
0 Kudos

Is your Excel version correct? XLSX is only in Excel 2007 and later, I think.

0 Kudos

Thanks for your reply.

My excel version is 2007.

0 Kudos

Hi,

Which version of abap2xlsx are you using, released or daily build?

What is the version of your SAP application server?

Could you paste exact message from excel?

0 Kudos

I hope this is wat you asked.

This is the first time I try this.

I download version 3 of abap2xlsx.

Application Server AIX6.1 Version 5.

When I run the demo program ZDEMO_EXCEL I recieve a message

"0 bytes transfer."

All the demo files are downloaded in the folder .

Example: 03_iTab.xlsx

When I open the file messaga.

"Excel cannot open the file '03_iTab.xlsx'' because the file format or file extension is no valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."

We upgrade to office 2007 a year ago. Is there something that needed to change op SAP to convert to office 2007?

0 Kudos

Hi,

I was asking about version of SAP (6.40, 7.00 ...)

What is the size of 03_iTab.xlsx on the disk? is it 0 bytes?

If you debug ZDEMO_EXCEL3 is lt_file_tab empty or filled when calling cl_gui_frontend_services=>gui_download?

0 Kudos

Hi Frances,

as you're using the old 3.0 Version I would suggest that you update to the 4.0 Version which was released just recently: https://cw.sdn.sap.com/cw/releases/21?container=1016. Then please let us know about the results.

Best regards

Gregor

0 Kudos

Sorry.

We are on ECC 6.0 (EHP3)

Sapgui 720

When I debug table lt_test have 109 lines.

But none in lv_file and lt_file_tab.

ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium2.

ls_table_settings-show_row_stripes = abap_true.

lo_worksheet->bind_table( ip_table =

is_table_settings = ls_table_settings ).

lo_worksheet->freeze_panes( ip_num_rows = 3 ). "freeze column headers when scrolling

column_dimension = lo_worksheet->get_column_dimension( 'E' ). "make date field a bit wider

column_dimension->set_width( 11 ).

CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007.

lv_file = lo_excel_writer->write_file( lo_excel ).

  • Convert to binary

lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ).

lv_bytecount = XSTRLEN( lv_file ).

Regards

Frances

0 Kudos

> lo_worksheet->bind_table( ip_table =

> is_table_settings = ls_table_settings ).

Hi Frances,

It's just a copy and paste error that no data object is assigned to ip_table?

Could you please try only demo1 that is the simplest demo?

Is the interface ZIF_EXCEL_WRITER correctly implemented in class ZCL_EXCEL_WRITER_2007, sometimes saplink has problems and you need to import the nugget twice.

Let us know.

Regards,

Ivan

0 Kudos

Thanks for all the help.

Ivan,

The problem was with interface ZIF_EXCEL_WRITER. I just copy the coding into the method.

Now only ZDEMO_EXCEL15 gave an error.

Information on where terminated

Termination occurred in the ABAP program "ZCL_EXCEL_WRITER_2007==

in "CREATE_CONTENT_TYPES".

The main program was "ZDEMO_EXCEL15 ".

In the source code you have the termination point in line 135

of the (Include) program "ZCL_EXCEL_WRITER_2007=========CM002".

The termination is caused because exception "CX_SY_REF_IS_INITIAL

procedure "CREATE_CONTENT_TYPES" "(METHOD)", but it was neither h

nor declared

in the RAISING clause of its signature.

The procedure is in program "ZCL_EXCEL_WRITER_2007=========CP ";

code begins in line

1 of the (Include program "ZCL_EXCEL_WRITER_2007=========CM002 ".

SOURCE CODE:

132 lo_element_root->append_child( new_child = lo_element ).

133

134 " Worksheet node

>>>>> lv_worksheets_num = excel->get_worksheets_size( ).

136 DO lv_worksheets_num TIMES.

137 lo_element = lo_document->create_simple_element( name = lc_xml_node_ov

138 parent = lo_document ).

Regards

Frances

0 Kudos

Definitely looks like installation problem.

As Ivan suggested I'd recommend importing latest NUGG once again and activation of all objects.

0 Kudos

I download the tatest NUGG and activation of all objects.

All demos are working.

Thanks for your help.

One last question. How do I transport all this to the QA and production systems.

Regards

Frances

0 Kudos

By design SAPLink imports all objects as local ones.

You can go to SE80 , select Local Objects from the drop down on the left and assign all the abap2xlsx objects to some transportable package.