Skip to Content
-1

Trouble reading parts of Package xlsx file

Oct 26, 2017 at 11:01 AM

38

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member Nov 22, 2017 at 04:03 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Mike Pokraka Oct 26, 2017 at 02:05 PM
1

Have you looked at using ABAP2XLSX? Soooo much easier.

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks for the suggestion.

0