Skip to Content
-1

Trouble reading parts of Package xlsx file

Dear experts,

I'm trying to load file content of XLSX file into a package and trying to access parts of package but it's not working if the xlsx file was created by Libre Office but it's working if the file is MS office file.

here is my code :

l_uri = lo_parts->get_part( 2 )->get_parts( )->get_part( 3 )->get_uri( )->get_uri( ).


lo_xml_part_uri = cl_openxml_parturi=>create_from_partname( l_uri ).
lo_xml_part = lo_package->get_part_by_uri( lo_xml_part_uri ).
CH_SHARED_DTAT = lo_xml_part->get_data( ).
*Load sheet data
CLEAR l_uri.
l_uri = lo_parts->get_part( 2 )->get_parts( )->get_part( 2 )->get_uri( )->get_uri( ).

lo_xml_part_uri = cl_openxml_parturi=>create_from_partname( l_uri ).
lo_xml_part = lo_package->get_part_by_uri( lo_xml_part_uri ).
CH_SHEET_DTAT = lo_xml_part->get_data( ).

Please advise me.

Thanks,

Houriya

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 22, 2017 at 04:03 PM

    Dear community,

    To load the XML data, for an Excel from LibreOffice origin, you need to read part '2' and to load the sheet data, you need to read part'1'.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 26, 2017 at 02:05 PM

    Have you looked at using ABAP2XLSX? Soooo much easier.

    Do a search on here for more info, the project is on github for download.

    Add comment
    10|10000 characters needed characters exceeded