Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Issues with ABAP2XLSX downgrade to versions < 7.02 #1173

Answered by sandraros
Jimboken asked this question in Q&A
Discussion options

As support for ABAP2XLSX is for versions from Netweaver 7.02, I've been advised to start this discussion for help on adapting the code for versions earlier than 7.02 It is after all only fair to have actual issues for versions that are actually supported! :)

The version I'm trying to retrofit is for a non-unicode Netweaver 7.01 instance, and while mostly successful there are still a few niggles I'd like to iron out with some help from ABAP2XLSX communtity.

  1. When generating excel from ZDEMO_EXCEL3 for example, Excel issues a dialog message that it found a problem with some content in the xlsx and you have to confirm the dialog to open and recover the excel workbook. Allowing recovering generates the spreadsheet with the repair summarised "Removed Records: Document Theme from /xl/workbook.xml part (Workbook)"

  2. I've noticed that the dates in the excel workbook generated are not formatted as dates but as a general excel value (e.g. 43962 instead of 11/05/2020).

Thanks for any suggestions.

You must be logged in to vote
  1. You may use the program we use "internally" for analyzing the regression/differences between actual and expected, which is zdemo_excel_checker. I hope it will work in 7.01, if not it's worth adapting. It's using the expected results stored in the MIME repository when you install the demos repository. For any difference detected, it opens VSCode to show the diff.

  2. In Excel the date is stored as a day counter since 1/1/1980, and the time is stored as fractional part of one day (0.5 means half day =12:00 pm). The different abap2xlsx methods have different behaviors. Some just return the number unformatted, others use the cell format to detect that it's a date or time and convert it using z...

Replies: 2 comments 5 replies

Comment options

  1. You may use the program we use "internally" for analyzing the regression/differences between actual and expected, which is zdemo_excel_checker. I hope it will work in 7.01, if not it's worth adapting. It's using the expected results stored in the MIME repository when you install the demos repository. For any difference detected, it opens VSCode to show the diff.

  2. In Excel the date is stored as a day counter since 1/1/1980, and the time is stored as fractional part of one day (0.5 means half day =12:00 pm). The different abap2xlsx methods have different behaviors. Some just return the number unformatted, others use the cell format to detect that it's a date or time and convert it using zcl_excel_common=>excel_string_to_date.

    CLASS-METHODS excel_string_to_date
    IMPORTING
    !ip_value TYPE zexcel_cell_value
    RETURNING
    VALUE(ep_value) TYPE d
    RAISING
    zcx_excel .
You must be logged in to vote
3 replies
Comment options

Thanks very much @sandraros I've been converting the syntax of that program into something compilable for 7.01.

There are a lot of embedded expressions throughout the code of ABAP2XLSX and I have a question on how best to convert the following embedded expression into something that will work in 7.01?

DATA lv_float TYPE f.
FIELD-SYMBOLS <lv_data> TYPE data.

lv_float = zcl_excel_common=>excel_string_to_number( <ls_sheet_content>-cell_value ).
<lv_data> = |{ lv_float NUMBER = RAW }|.

Thanks again for any help you can offer.

Comment options

NUMBER = RAW means that the target string will be in format without exponent, without thousands separator, sign at the left and with dot as decimal separator, something like -3.1415926.

Comment options

Thanks @sanraros, zdemo_excel_checker highlighted the inconsisitent parts of the excel spreadsheet generated and enabled me to correct the class methods causing issues (ZCL_EXCEL_THEME)

I appreciate you taking the time to help. :)

Answer selected by Jimboken
Comment options

I've just installed ABAP2XLSX in my project, its a SAP ECC 6.0, SAP_ABA 701.
I've copied the objects from other system with higher version.

I've had to addapt some code to activate the objects....

  • Need to add type ABAP in some clases in Type groups.
  • Data element sysuuid_x16 doesn't exists in my version, changed by XSDUUID_RAW
  • Some syntax error for this words in some classes declarations: RISK LEVEL HARMLESS
    DURATION SHORT.
  • Some "new" syntax in class ZCL_EXCEL_WORKSHEET , I had to change the code to not do math operations or call methods in the call to other methods.
  • class CL_SYSTEM_UUID doesnt exist.
  • ZCL_EXCEL_COLUMNS-remove - new syntax
  • ZCL_EXCEL_ROWS-remove - new syntax
  • ZCL_EXCEL_WRITER_2007 - new syntax:
    CREATE_XL_COMMENTS
    CREATE_XL_DRAWINGS_HDFT_RELS
    CREATE_XL_DRAWINGS_VML_RELS
    CREATE_XL_DRAWING_FOR_COMMENTS
    CREATE_XL_SHEET
    CREATE_XL_WORKBOOK: sysuuid_x16 --> XSDUUID_RAW

-ZCL_EXCEL_THEME_FMT_SCHEME
BUILD_XML

  • Class CL_ABAP_UNIT_ASSERT doesnt' exists. I've commented its uses.

I think thats all.

You must be logged in to vote
2 replies
Comment options

@RixarSAP Could you create a public Git repository with your ABAP 7.01 code? (and indicate the original abap2xlsx commit). It may help to create a tool to transform automatically the code from 7.02 to 7.01 by identifying the differences between the versions 7.02 and 7.01. It wouldn't be part of abap2xlsx (because we rely on abaplint which starts from 7.02) but a separate project.
Note that CL_ABAP_UNIT_ASSERT is equivalent to CL_AUNIT_ASSERT (starting from the version 6.40).

Comment options

Hello, @sandraros . I would lile to create a new Git repository. But i dont know why.
In my system report ZABAPGIT_STANDALONE doesn't activate, it has a lot of sintax errros due my old Abap version... :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /