Giter VIP home page Giter VIP logo

abap2xlsx's Introduction

abap2xlsx - Read and generate Excel Spreadsheets with ABAP

For general information please refer to the blog series abap2xlsx - Generate your professional Excel spreadsheet from ABAP and the documentation. Please refer to the official wiki for the abapGit installation guide. Note that the Demo programs are provided in a separate repository, and can be installed after abap2xlsx.

For questions, bug reports and more information on contributing to the project, please refer to the contributing guidelines.

Version support: minimum tested version is SAP_ABA 731, it might work on older versions still but we need volunteers to test it.

abap2xlsx's People

Contributors

alsp80 avatar andreaborgia-abo avatar atomkrieg avatar berreke avatar bigld avatar bilencekic avatar d-schaaf avatar ennowulff avatar fidley avatar foxahead avatar gh14cc10 avatar gregorwolf avatar hannesrempel avatar ivanfemia avatar larshp avatar mfallen avatar oberhm avatar oliver-huetkoeper avatar pacojkaa avatar pksingh78 avatar pokrakam avatar psio3123 avatar redwolf112 avatar rplantiko avatar sandraros avatar stefanrutzmoser avatar stefanschmoecker avatar stefanschnell avatar striezl avatar tmackowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

abap2xlsx's Issues

ZAKE_SVN_A2X - incorrectly included in 1.1 nugget - missing code to compile

What steps will reproduce the problem?

  1. download nugget
  2. install nugget
  3. attempt to activate all

What is the expected output? What do you see instead?
expect clean activation - see error activating ZAKE

What version of the product are you using? On what operating system?
1.1 - NW7.01

Please provide any additional information below.

Active sheet is set to 2 but still the first sheet is displayed

I've added the report ZDEMO_EXCEL19 to create a Excel file where the second sheet should be the active one. Unfortunately when opening the created file still the first sheet is displayed and the second sheet is just a selected tab. I tried to find the error also by comparing the XML output of a file created in Excel but I wasn't able to fix it. Attached you find the generated file.

Conditional Formating with dynamic Switches

Hi Gregor,
The possibility fpr conditional formatting is are very usefull feature, but the borders, e.g. between red, yellow and green lights are fix in den generateion coding for the excel sheet ( Method CREATE_XL_SHEET in class ZCL_EXCEL_WRITER_2007)

Code Snippet:
WHEN zcl_excel_style_conditional=>c_iconset_3trafficlights2 OR
zcl_excel_style_conditional=>c_iconset_3arrows OR
zcl_excel_style_conditional=>c_iconset_3arrowsgray OR
zcl_excel_style_conditional=>c_iconset_3flags OR
zcl_excel_style_conditional=>c_iconset_3signs OR
zcl_excel_style_conditional=>c_iconset_3symbols OR
zcl_excel_style_conditional=>c_iconset_3symbols2 OR
zcl_excel_style_conditional=>c_iconset_3trafficlights OR
zcl_excel_style_conditional=>c_iconset_3trafficlights2.
APPEND '0' TO lt_percent_val.
APPEND '33' TO lt_percent_val.
APPEND '67' TO lt_percent_val.

Wouldn`t it be better, if you can set these borders from "outside" for example as parameter in class zcl_excel_style_conditional?

Thanks,
Matthias

Missing interface method implementation in NUGG

What steps will reproduce the problem?

  1. Download, install and activate 2.0 nugget
  2. Run any demo program
  3. Get Short Dump CALL_METHOD_NOT_IMPLEMENTED

What is the expected output? What do you see instead?

What version of the nugg are you using?
2.0

Provide the version of the following components?
SAP_BASIS 700 0018
SAP_ABA 700 0018

Please provide any additional information below.

I think the implementation for ZCL_EXCEL_WRITER_2007->ZIF_EXCEL_WRITER~WRITE_FILE was not included in the nugg file

GETWA_NOT_ASSIGNED error when using ZCL_EXCEL object returned from method

In the attached demo report ZDEMO_EXCEL1_REF I try to create the ZCL_EXCEL object in a local class method. When no internal table is used for the ZCL_EXCEL object, then the creation of the Excel 2007 file works fine. But as soon as I get the data from an internal table this shortdump happens:


    Termination occurred in the ABAP program "ZCL_EXCEL_TABLE===============CP" -
     in "GET_REFERENCE".
    The main program was "ZDEMO_EXCEL1_REF ".

    In the source code you have the termination point in line 23
    of the (Include) program "ZCL_EXCEL_TABLE===============CM004".

Vertical align and wrap text

Helo guys,

I tried to set vertical alignment and word wrapping but it did not work. There are attributes and constants in the ZCL_EXCEL_STYLE_ALIGNMENT class but they are not written to output file.

I made following patch and it started to work. I use the latest daily build.

Class: ZCL_EXCEL_WRITER_2007

Method: CREATE_XL_STYLES

Contents Unchanged:
1 1 method CREATE_XL_STYLES.
2 2
3 3
... ... ...
71 71 lc_xml_attr_defaultpivotstyle TYPE string VALUE 'defaultPivotStyle',
72 72 lc_xml_attr_applyalignment TYPE string VALUE 'applyAlignment',
73 73 lc_xml_attr_horizontal TYPE string VALUE 'horizontal',

Following lines added:
74 lc_xml_attr_vertical TYPE string VALUE 'vertical',
75 lc_xml_attr_wraptext TYPE string VALUE 'wrapText',

Contents Unchanged:
76 74 lc_xml_attr_formatcode TYPE string VALUE 'formatCode',
77 75 " Node namespace
78 76 lc_xml_node_ns TYPE string VALUE 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'.
... ... ...
171 169 ls_alignment = lo_style->alignment->get_structure( ).
172 170 ls_numfmt = lo_style->number_format->get_structure( ).
173 171

The following lines were changed:
174 CLEAR ls_cellxfs.
175
176
172 CLEAR ls_cellxfs.
173
174

Contents Unchanged:
177 175 * Compress fonts
178 176 READ TABLE lt_fonts FROM ls_font TRANSPORTING NO FIELDS.
179 177 IF sy-subrc EQ 0.
... ... ...
615 613 MOVE ls_alignment-horizontal TO lv_value.
616 614 lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_horizontal
617 615 value = lv_value ).

Following lines added:
618 IF ls_alignment-vertical IS NOT INITIAL.
619 MOVE ls_alignment-vertical TO lv_value.
620 lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_vertical
621 value = lv_value ).
622 ENDIF.
623 IF ls_alignment-wraptext = '1' OR ls_alignment-wraptext = 'X'.
624 lv_value = 1.
625 lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_wraptext
626 value = lv_value ).
627 ENDIF.

Contents Unchanged:
628 616 lo_element->append_child( lo_sub_element_2 ).
629 617 ENDIF.
630 618 lo_element_cellxfs->append_child( lo_element ).
... ... ...
699 687 lo_renderer->render( ).
700 688
701 689 endmethod.

Problem with compatibility Pack for MS Office 2000

Hello,

I found a problem with opening XLSX in MS Office 2000/XP with Compatibility Pack 12.0.6021.5000.
Excel was unable to open the file. I did some research and found the reason. Problem is caused by attributex "outlineLevelRow" and "outlineLevelCol".
I also found a simle solution - I just added markup-compatibility prefix and it started to work.
My modification is in attached file.

Too small definitions for ZEXCEL_S_CELLXFS - FILLID and ZEXCEL_S_STYLES_MAPPING - STYLE

Hi abap2xlsx Team,

during my development of ZDEMO_EXCEL21 I've tried also other divisions of 255. But when I've tried 11 then I ran unto dumps because the some elements of the Styles structures where only defined as INT1. When I've changed ZEXCEL_S_CELLXFS - FILLID to INT4 and also ZEXCEL_S_STYLES_MAPPING - STYLE to INT4 the problem was solved. But I've still got an invalid output as described in issue #38. Let's discuss if that could be a valid enhancement.

Best regards
Gregor

Exception ZCX_EXCEL thrown when style is set for an empty cell

I've added the lines:

  " Set only the style
  lo_worksheet->set_cell_style( ip_column = 'B' ip_row = 7 ip_style = lv_style_filled_green_guid ).

to the ZDEMO_EXCEL2 report. But now the method SET_CELL_STYLE of class ZCL_EXCEL_WORKSHEET throws the exception ZCX_EXCEL with the message "No Data in this cell". I hope it's possible to format also empty cells as I want to indicate the user that this cell can be maintained.

Dealing with worksheet titles containing spaces

Follow Tomek Mackowski's suggestion in the Discussion [[url:https://cw.sdn.sap.com/cw/message/43769|Dealing with worksheet titles containing spaces]] and make the title attribute of ZCL_EXCEL_WORKSHEET private and create getter and setter for this field. Getter could have an optional parameter "return_escaped" which would take care of all the special cases.

Negative numbers

ersion 2.0

Negative numbers are exported in "SAP" format with minus sign at the end, for example 123.00-
This format is not understood by Excel.

I made a simple patch, see bellow.

class ZCL_EXCEL_COMMON

METHOD number_to_excel_string .
DATA: lv_value_c TYPE c LENGTH 100.

WRITE ip_value TO lv_value_c EXPONENT 0 NO-GROUPING.
REPLACE ALL OCCURRENCES OF ',' IN lv_value_c WITH '.'.
REPLACE ALL OCCURRENCES OF '-' IN lv_value_c WITH ''.
IF ip_value < 0. CONCATENATE '-' lv_value_c INTO lv_value_c. ENDIF.
ep_value = lv_value_c.
CONDENSE ep_value NO-GAPS.
ENDMETHOD.

Graphics

Add functionality for handling Graphics

Output created with ZDEMO_EXCEL21 not valid

Hi abap2xlsx Team,

I've just created the report ZDEMO_EXCEL21 which creates a 18 lines to 12 columns (216 Cells) grid for all web save colors (255 / 51). Unfortunately the output is not valid. Hope someone can have a look at this problem.

Best regards
Gregor

Class missing?

What steps will reproduce the problem?

  1. Import Nugget and activate
  2. Try Demo 1

What is the expected output? What do you see instead?
Demo 1 "Hello World" / Short dump

What version of the product are you using? On what operating system?
1.0 dated 30.06.2010 / Windows 7

Please provide any additional information below.
It seems as if CL_OBJECT_COLLECTION_ITERATOR cannot be found. With which version of SAP (lowest) will the abap2xlsx generator work?

Wrong content type for worksheet in [Content_Types].xml

What steps will reproduce the problem?

  1. Run ZDEMO_EXCEL1
  2. Unzip HelloWorld.xlsx
  3. Open [Content_Types].xml

What is the expected output? What do you see instead?

Content type for /xl/worksheets/sheet1.xml should be:

currently it is :

What version of the nugg are you using?
1.1

Provide the version of the following components?
SAP_BASIS 701.003
SAP_ABA 701.003

Please provide any additional information below.

It looks like a copy-paste error in ZCL_EXCEL_WRITER_2007-CREATE_CONTENT_TYPES

line 165 is
value = lv_xml_node_worksheet_pn ).

and should be changed to
value = lc_xml_node_worksheet_ct ).

Unnecessary relation to printerSettings/printerSettings1.bin - file format not valid

What steps will reproduce the problem?

  1. Run ZDEMO_EXCEL1
  2. Open HelloWorld.xlsx in 'Open XML SDK 2.0 Productivity Tool' or 'Package Explorer'

What is the expected output? What do you see instead?
I'd expect that files created by abap2xlsx are valid and created according to schema. Currently there are number of issues which prevent from opening these files in OpenXML tools. They can be opened in Excel which is more fault tolerant.
I reported one issue about content types earlier today.

This one is about xl/workbook/_rels/sheet.xml.rels file.
Currently this file is generated with relation to '../printerSettings/printerSettings1.bin'
As this file doesn't exist it gives validation error.
I suggest that xl/workbook/_rels/sheet.xml.rels should not be created at all - it is not necessary now.
If you want to keep it then it shouldn't contain relations to printer settings.

What version of the nugg are you using?
1.1

Provide the version of the following components?
SAP_BASIS 701.003
SAP_ABA 701.003

Please provide any additional information below.

Here are the links to the tools I mentioned before
http://packageexplorer.codeplex.com/
http://www.microsoft.com/downloads/details.aspx?FamilyID=c6e744e5-36e9-45f5-8d8c-331df206e0d0&displaylang=en

Error when executing ABAP_2_ELSX

What steps will reproduce the problem?
1.Copied the installer prg
2.gives warning abt zcl_saplink exception not caught
3.tried to run the prg with the nugg

What is the expected output? What do you see instead?
method "Get_Active_worksheet" is unknown or protected or private

What version of the nugg are you using?
Dont know

Provide the version of the following components?
SAP_BASIS
SAP_ABA

Please provide any additional information below.

Cannot create spreadsheet with both drawing and table or hyperlink

Drawings feature added code to create new sheet relation in ZCL_EXCEL_WRITER_2007-CREATE_XL_SHEET_RELS.
Relation Id for drawings is hardcoded to 'rId1'. It works fine when there is only one relation in the sheet. When there are more relations following error is thrown in Excel/validator:
'rId1' ID conflicts with the ID of an existing relationship for the specified source.

Tables and hyper links can create multiple relations so drawings code should take this into account.

Attaching report with repro.

Text rotation

What steps will reproduce the problem?

REPORT zdemo_excel14.

DATA: lo_excel TYPE REF TO zcl_excel,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
lv_file TYPE xstring,
lv_style_center_guid TYPE zexcel_cell_style,
lv_style_right_guid TYPE zexcel_cell_style,
lv_style_left_guid TYPE zexcel_cell_style,
lv_style_general_guid TYPE zexcel_cell_style,
lv_bytecount TYPE i,
lt_file_tab TYPE STANDARD TABLE OF solisti1,
lo_style_center TYPE REF TO zcl_excel_style,
lo_style_right TYPE REF TO zcl_excel_style,
lo_style_left TYPE REF TO zcl_excel_style,
lo_style_general TYPE REF TO zcl_excel_style.

CREATE OBJECT lo_excel.

" Get active sheet
lo_worksheet = lo_excel->get_active_worksheet( ).
lo_worksheet->title = 'sheet1'.

"Center
lo_style_center = lo_excel->add_new_style( ).
lo_style_center->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center.
lv_style_center_guid = lo_style_center->get_guid( ).
"Right
lo_style_right = lo_excel->add_new_style( ).
"lo_style_right->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_right.
lo_style_right->alignment->textrotation = 2.
lv_style_right_guid = lo_style_right->get_guid( ).
"Left
lo_style_left = lo_excel->add_new_style( ).
lo_style_left->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_left.
lv_style_left_guid = lo_style_left->get_guid( ).
"General
lo_style_general = lo_excel->add_new_style( ).
lo_style_general->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_general.
lv_style_general_guid = lo_style_general->get_guid( ).

lo_worksheet->set_cell( ip_row = 2 ip_column = 'A' ip_value = 'Test' ).

lo_worksheet->set_cell( ip_row = 2 ip_column = 'B' ip_value = 'Centered Text' ip_style = lv_style_center_guid ).
lo_worksheet->set_cell( ip_row = 3 ip_column = 'B' ip_value = 'Right Text' ip_style = lv_style_right_guid ).
lo_worksheet->set_cell( ip_row = 4 ip_column = 'B' ip_value = 'Left Text' ip_style = lv_style_left_guid ).
lo_worksheet->set_cell( ip_row = 5 ip_column = 'B' ip_value = 'General Text' ip_style = lv_style_general_guid ).

lv_file = lo_excel->save_as( zcl_excel=>c_xlsx ).

"convert to table
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lv_file
IMPORTING
output_length = lv_bytecount
TABLES
binary_tab = lt_file_tab.
"Save the file
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = lv_bytecount
filename = 'C:\Alignment.xlsx'
filetype = 'BIN'
TABLES
data_tab = lt_file_tab.

What is the expected output? What do you see instead?

'Right text' in horizontal direction.

What version of the nugg are you using?

Provide the version of the following components?
SAP_BASIS 700
SAP_ABA 700

Please provide any additional information below.

I tried to change the direction of the text to vertical direction using:
lo_style_right->alignment->textrotation = 2.
But it doesn't work. I have noticed, that you have implemented the alignment class just few days ago. Does it mean that the text rotation hasn't been implemented yet or am I doing anything wrong?

Are you going to implement 'Freezing panes' in future?

Best regards
Ivo

Methods to convert Excel dates and times back to SAP formats

With the ability to read in a spreadsheet there is a need to translate dates and times back into SAPs format so I propose the following methods for ZCL_EXCEL_COMMON.

Method: EXCEL_STRING_TO_DATE
Importing: ip_value TYPE ZEXCEL_CELL_VALUE
Returning: ep_value TYPE d

data: lv_date_int TYPE i,
lc_date_baseline TYPE d VALUE '19000101'.

TRY .
lv_date_int = ip_value.
ep_value = lv_date_int + lc_date_baseline - 2.
CATCH CX_SY_CONVERSION_ERROR.
CLEAR ep_value.
ENDTRY.
*---------------------
Method: EXCEL_STRING_TO_TIME
Importing: ip_value TYPE ZEXCEL_CELL_VALUE
Returning: ep_value TYPE t

DATA: lv_seconds_in_day TYPE i,
lv_day_fraction TYPE f,
lc_seconds_in_day TYPE i VALUE 86400.

try.

lv_day_fraction = ip_value.
lv_seconds_in_day = lv_day_fraction * lc_seconds_in_day.

ep_value = lv_seconds_in_day.

catch CX_SY_CONVERSION_ERROR.
clear ep_value.
endtry.
*-----------------

Cheers
Steve

Wrong content type for worksheet in [Content_Types].xml

What steps will reproduce the problem?

  1. Run ZDEMO_EXCEL1
  2. Unzip HelloWorld.xlsx
  3. Open [Content_Types].xml

What is the expected output? What do you see instead?

Content type for /xl/worksheets/sheet1.xml should be:

currently it is :

What version of the nugg are you using?
1.1

Provide the version of the following components?
SAP_BASIS 701.003
SAP_ABA 701.003

Please provide any additional information below.

It looks like a copy-paste error in ZCL_EXCEL_WRITER_2007-CREATE_CONTENT_TYPES

line 165 is
value = lv_xml_node_worksheet_pn ).

and should be changed to
value = lc_xml_node_worksheet_ct ).

Range Border

Hi all,

Is there any method to set border of ranges? I couldn't find any thing about border of a range..

Thanks.

Sending attachment as email ( Format Error )

What steps will reproduce the problem?

 constants:
    gc_tab  type c value cl_bcs_convert=>gc_tab,
    gc_crlf type c value cl_bcs_convert=>gc_crlf.

  DATA:
    mailto type ad_smtpadr.

  CONACATENATE SY-UNAME '@GMAIL.COM' INTO MAILTO.

  data send_request   type ref to cl_bcs.
  data document       type ref to cl_document_bcs.
  data recipient      type ref to if_recipient_bcs.
  data bcs_exception  type ref to cx_bcs.

  data main_text      type bcsy_text.
  data binary_content type solix_tab.
  data binary_content1 type SOLIX.
  data size           type so_obj_len.
  data sent_to_all    type os_boolean.

  clear: binary_content[].

*     loop at lt_file_tab into lt_file_tab1.
*
*
*     binary_content1-line = lt_file_tab1-line.
*
*     append binary_content1 to binary_content.
*
*     endloop.

CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
  EXPORTING
    IP_SOLITAB        = lt_file_tab
 IMPORTING
   EP_SOLIXTAB       = binary_content
          .

  try.

*     -------- create persistent send request ------------------------
      send_request = cl_bcs=>create_persistent( ).

*     -------- create and set document with attachment ---------------
*     create document object from internal table with text
      append 'Multiple worksheets!'
                to main_text.                               "#EC NOTEXT
      document = cl_document_bcs=>create_document(
        i_type    = 'RAW'
        i_text    = main_text
        i_subject = 'Mul_sheets.xlsx' ).                    "#EC NOTEXT

*     add the spread sheet as attachment to document object
      document->add_attachment(
        i_attachment_type    = 'XLS'                        "#EC NOTEXT
        i_attachment_subject = 'MulSpreadSheet.xlsx'        "#EC NOTEXT
        i_att_content_hex    = binary_content ).

*     add document object to send request
      send_request->set_document( document ).

*     --------- add recipient (e-mail address) -----------------------
*     create recipient object
      recipient = cl_cam_address_bcs=>create_internet_address( mailto ).

*     add recipient object to send request
      send_request->add_recipient( recipient ).

*     ---------- send document ---------------------------------------
      sent_to_all = send_request->send( i_with_error_screen = 'X' ).

      commit work.

      if sent_to_all is initial.
        message i500(sbcoms) with mailto.
      else.
        message s022(so).
      endif.

*   ------------ exception handling ----------------------------------
*   replace this rudimentary exception handling with your own one !!!
    catch cx_bcs into bcs_exception.
      message i865(so) with bcs_exception->error_type.
  endtry.

Performance problem

Hi guys,

I have a problem with generating big sheet. I tried to create a file with more than 10000 rows, but it took very long time.
I did some analysis and found problem in method SET_CELL of class ZCL_EXCEL_WORKSHEET. There is following code:
APPEND ls_sheet_content TO sheet_content.
SORT sheet_content BY cell_row cell_col
This will sort sheet_content every time a new cell is added. Use of sorted table and INSERT .. INTO TABLE should be faster.

Convert Cell format into Number Format

What steps will reproduce the problem?

  1. Cell format in number is not working

What is the expected output? What do you see instead?
By default Cell format is Text

What version of the nugg are you using?
I am using Daily Nugg File which was downloaded on Aug 26, 2010

Provide the version of the following components?
SAP_BASIS
SAP_ABA

SAP_ABA 700 0014 SAPKA70014 Cross-Application Component
SAP_BASIS 700 0014 SAPKB70014 SAP Basis Component

Please provide any additional information below.

I am trying to convert cell into number but it doesn't work.

DATA: lo_number_format TYPE REF TO zcl_excel_style.
lv_num_format_guid TYPE zexcel_cell_style.

lo_number_format = lo_excel->add_new_style( ).
lo_number_format->number_format->C_FORMAT_NUMBER_COMMA_SEP1 = zcl_excel_style_number_format=>c_format_number_comma_sep1.
lv_num_format_guid = lo_number_format->get_guid( ).

ERROR: NO SAVE_AS method in ZCL_EXCEL

I download the latest ZCL_EXCEL and ZDEMO_EXCEL15(version 139).
When I compile ZDEMO_EXCEL15, it reports that below code error:
Line 18:
TRY.
CREATE OBJECT reader TYPE zcl_excel_reader_2007.
excel = reader->load_file( 'C:\iTab.xlsx' ).
lv_file = excel->save_as( zcl_excel=>c_xlsx ).

Error message is: SAVE_AS is unknown.
I checked methods of ZCL_EXCEL and don't find SAVE_AS neither.

ABAP2XLSX standard demo reports Bug?

Please see attached two excel files generated out of the ABAP2XLSX test reports. There are some errors if I'm opening theses files.
Issue #35 caused similar problems. Same code - 3.0 stable 06.12.2010 - is working on a SAP_BASIS version SAPKB70106.
Thanks in advance.

Short dump when using Number Formats

What steps will reproduce the problem?

  1. Install NUGG_ABAP2XLSX_V_1_1.nugg
  2. Try to use a number format (I am trying to use '0.00%')
  3. Run the program

What is the expected output? What do you see instead?
I get a system exception "CX_SY_CONVERSION_NO_NUMBER"

What version of the nugg are you using?
NUGG_ABAP2XLSX_V_1_1.nugg

Provide the version of the following components?
SAP_BASIS SAPKB70018
SAP_ABA SAPKA70018

Please provide any additional information below.
It looks like it is trying to use the actual number format code as the link to some stored number formats. I can see that instead of referencing something like Borders directly, it stores them in a table and then references the index of this table.

It looks like it's trying to the same thing with the number formats, but it's assigning a 20-character field (ls_format) to an INT2 field (ls_cellxfs-numfmtid). And there is no LT_FORMATS table, as would correspond with LT_BORDERS for example.
This is in method CREATE_XL_STYLES of class ZCL_EXCEL_WRITER_2007.

Thanks guys.

package check errors:

What steps will reproduce the problem?

  1. Package check switched on globally in system
  2. Activate data elements
  3. Error message "Activity terminated because errors occurred during package checks"

What is the expected output? What do you see instead?
Activation of data elements without errors/warnings. You can ignore the message and activate the data elements but the warning stays with these elements.

What version of the nugg are you using?
v.1.1

Provide the version of the following components?
SAP_BASIS 700 0020 SAPKB70020 SAP Basis Component
SAP_ABA 700 0020 SAPKA70020 Cross-Application Component

Please provide any additional information below.
Could help if you'll use the predefined type string instead of domain string (which is included in the package S_CODE_INSPECTOR with package interfaces which doesn't support this domain for other packages).

See screenshot with the concerning data elements. (It's in German, but the names are the important information.)

Remove calcChain.xml

What steps will reproduce the problem?

  1. Run ZDEMO_EXCEL6
  2. Open result xlsx file

What is the expected output? What do you see instead?
My Excel 2010 complains about the file and displays message wiht error in /xl/calcChain.xm

What version of the nugg are you using?
1.1

Provide the version of the following components?
SAP_BASIS 701
SAP_ABA 701

Please provide any additional information below.
/xl/calcChain.xm is used by excel to figure out the order of calculations.
As explained in http://openxmldeveloper.org/articles/Creating_Spreadsheets_Server.aspx (scroll down to Integrity Issues chapter) this part will be created by Excel on first load.
I suggest we remove it completely from files generated by abap2xlsx and let Excel manage it.

Error when worksheet has more than 1000 rows

When a worksheet has more than 1000 rows the GET_REFERENCE method in the ZCL_EXCEL_TABLE class generates an invalid refernce eg A1:L1,234

The two WRITE statements should have EXPONENT 0 NO-GROUPING NO-SIGN added to them
or perhaps better yet the WRITE and CONDENSE stmts can be be replaced with

lv_top_row_string    = zcl_excel_common=>number_to_excel_string( settings-top_left_row ).
lv_bottom_row_string = zcl_excel_common=>number_to_excel_string( lv_bottom_row ).

Thanks in advance.

Configurable default date format used in SHEET->SET_CELL

As Ivan suggested in comments for issue #42 we could have an option to change default date format used in SHEET->SET_CELL method.
This setting determines in which format dates are presented in xlsx sheet when user passes date fields (type d) and doesn't provide the style explicitly.

I would suggest:

  • adding private attribute to store the setting
  • initialize it in constructor with fall-back mechanism: get user default > get system default > get fixed value for ex. yyyy.mm.ddd
  • add getter and setter for the attribute to allow changes from the calling application

Tomek

ABAP2XLSX standard demo reports Bug?

Please see attached two excel files generated out of the ABAP2XLSX standard demo reports. There are some errors if I'm opening theses files.
Could you please have a look at it?

BTW: Problem occurs in stable version 2.0 and with the daily build from 10.11.2010.

Thanks in advance!

Could not activate structure ZEXCEL_S_FIELDCATALOG

What steps will reproduce the problem?

  1. Imported nugget into SAP EHP4 system
  2. while trying to activate the structure ZEXCEL_S_FIELDCATALOG error occured
  3. Error Text: Field name POSITION is reserved (Do not use structure as include in DB table)

What is the expected output? What do you see instead?

Structure should get activated, but not activated

What version of the nugg are you using?

ABAP2XLSX_V_2_0

Provide the version of the following components?
SAP_BASIS - 701
SAP_ABA - 701

Please provide any additional information below.

Allowing for zero dates in DATE_TO_EXCEL_STRING

In ZCL_EXCEL_COMMON=>DATE_TO_EXCEL_STRING it should check for a zero date value and return an empty cell rather than a value of -693595.

We've added
CHECK ip_value NE '00000000'.
before calculating the date number.

Thanks
Steve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.