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: 

Trouble reading parts of Package xlsx file

0 Kudos

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

1 ACCEPTED SOLUTION

0 Kudos

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'.

3 REPLIES 3

pokrakam
Active Contributor

Have you looked at using ABAP2XLSX? Soooo much easier.

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

0 Kudos

Thanks for the suggestion.

0 Kudos

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'.