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

ZCL_EXCEL_WRITER_2007 Constructor for SAP_BASIS 701 #1171

Closed
Jimboken opened this issue Jan 10, 2024 · 5 comments
Closed

ZCL_EXCEL_WRITER_2007 Constructor for SAP_BASIS 701 #1171

Jimboken opened this issue Jan 10, 2024 · 5 comments
Labels

Comments

@Jimboken
Copy link

Jimboken commented Jan 10, 2024

I've been attempting to downgrade the syntax of ABAP2XLSX for a 701 Netweaver system and am having difficulty getting the CONSTRUCTOR of ZCL_EXCEL_WRITER_2007 to work.

The system is non-unicode, with a codepage 1100 for the application server. Does ABAP2XLSX only funciton on Unicode systems?

I get a CONVT_CODEPAGE shortdump with exception CX_SY_CONVERSION_CODEPAGE from the call to CL_ABAP_CONV_IN_CE=>UCCPI.

My amended CONSTRUCTOR code is as follows:

 METHOD constructor.
   DATA: lt_unicode_point_codes TYPE TABLE OF string,
         lv_unicode_point_code  TYPE i.

*** 7.01
   DATA: ls_unicode_point_code TYPE string,
         lv_uccp               TYPE sychar02.

   me->ixml = cl_ixml=>create( ).

*** 7.01   SPLIT '0,1,2,3,4,5,6,7,8,' " U+0000 to U+0008
***       && '11,12,'             " U+000B, U+000C
***       && '14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,' " U+000E to U+001F
***       && '65534,65535'        " U+FFFE, U+FFFF
***      AT ',' INTO TABLE lt_unicode_point_codes.

   CONCATENATE '0,1,2,3,4,5,6,7,8,' " U+0000 to U+0008
               '11,12,'             " U+000B, U+000C
               '14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,' " U+000E to U+001F
               '65534,65535'        " U+FFFE, U+FFFF
          INTO ls_unicode_point_code.

   SPLIT ls_unicode_point_code
     AT ',' INTO TABLE lt_unicode_point_codes.

   control_characters = ``.
*** 7.01   LOOP AT lt_unicode_point_codes INTO lv_unicode_point_code.
***      control_characters = control_characters && cl_abap_conv_in_ce=>uccpi( lv_unicode_point_code ).
***    ENDLOOP.
   LOOP AT lt_unicode_point_codes INTO lv_unicode_point_code.
     lv_uccp = cl_abap_conv_in_ce=>uccpi( lv_unicode_point_code ).
     CONCATENATE control_characters lv_uccp INTO control_characters.
   ENDLOOP.

 ENDMETHOD.

Any help most welcome, thank you.

@sandraros
Copy link
Collaborator

I think there would be only minor issues to make it work on 7.01.

The issue you have is maybe more related to the kernel bugged for some values. Try to see which numbers are fine, which numbers are faulty. Then just remove the faulty ones. Instead of UCCPI you may also try with UCCP, use hex version instead of number, e.g. 'FFFF' instead of 65535.

NB: you may also use (I think) & instead of &&:

   SPLIT '0,1,2,3,4,5,6,7,8,' " U+0000 to U+0008
       & '11,12,'             " U+000B, U+000C
       & '14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,' " U+000E to U+001F
       & '65534,65535'        " U+FFFE, U+FFFF
      AT ',' INTO TABLE lt_unicode_point_codes.

@gregorwolf
Copy link
Collaborator

Just out of curiosity: Does SAP still provide support for 7.01?

@Jimboken
Copy link
Author

Jimboken commented Jan 10, 2024

I think there would be only minor issues to make it work on 7.01.

The issue you have is maybe more related to the kernel bugged for some values. Try to see which numbers are fine, which numbers are faulty. Then just remove the faulty ones. Instead of UCCPI you may also try with UCCP, use hex version instead of number, e.g. 'FFFF' instead of 65535.

NB: you may also use (I think) & instead of &&:

   SPLIT '0,1,2,3,4,5,6,7,8,' " U+0000 to U+0008
       & '11,12,'             " U+000B, U+000C
       & '14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,' " U+000E to U+001F
       & '65534,65535'        " U+FFFE, U+FFFF
      AT ',' INTO TABLE lt_unicode_point_codes.

Thank you!

Commenting out 65534 & 65535 made it work, without the relevant characters in the output of ZDEMO_EXCEL1 of course, but I can work with that.

I tried switching to UCCP, however conversion still not possible for FFFE and FFFF.

Thanks very much for your help.

@Jimboken
Copy link
Author

Just out of curiosity: Does SAP still provide support for 7.01?

Just about I think!

@sandraros
Copy link
Collaborator

Closing the issue. Please post a discussion for anything related to 7.01. I'll help as far as I can, e.g. if the answer is fast.

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

No branches or pull requests

3 participants