Application Development and Automation 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: 
Read only

Get content EXCEL from ARCHIVOBJECT_GET_TABLE

Jimmy21
Participant
0 Likes
2,629

Hi gurus.

I'm using FM ARCHIVOBJECT_GET_TABLE to get a EXCEL file. I want to get the content of this file and save it into an internal table but without save this file in local client. What FM's can I use?

PS: It's similar to this topic https://answers.sap.com/questions/9352342/problem-reading-binary-output-file-from-archivobje.html

Thanks in advance.

Jimmy.

Hi gurus.

I'm using FM ARCHIVOBJECT_GET_TABLE to get a EXCEL file. I want to get the content of this file and save it into an internal table but without save this file in local client. What FM's can I use?

PS: It's similar to this topic https://answers.sap.com/questions/9352342/problem-reading-binary-output-file-from-archivobje.html

Thanks in advance.

Jimmy.

5 REPLIES 5
Read only

geert-janklaps
SAP Mentor
SAP Mentor
2,258

Hi,

Assuming you're able to successfully read the data using function module ARCHIVEOBJECT_GET_TABLE, you can use function module SCMS_BINARY_TO_XSTRING to convert the return table BINARCHIVOBJECT to an xstring. Using that xstring you can use ABAP2XLSX to read the Excel file data into an internal table.

You can check out the ABAP2XLSX framework here:

https://github.com/sapmentors/abap2xlsx

Best regards,

Geert-Jan Klaps

Read only

2,258

(nitpicking mode) It's ARCHIVOBJECT_GET_TABLE, not ARCHIVEOBJECT_GET_TABLE, and both parameters BINARCHIVOBJECT and BINLENGTH must be used with SCMS_BINARY_TO_XSTRING.

Read only

0 Likes
2,258

Hi.

It's ABAP2XLSX the unique way to read excel file content? because I haven't permissions to transport other programa that not be inside the project.

Read only

0 Likes
2,258

Hi jimmy.moreno,

The only alternative I know of is using class CL_XLSX_DOCUMENT, but haven't used that myself but seen some programs using it in the past. (and it's not that advanced as ABAP2XLSX is)

There is a blog post that explains how you can use it:

https://blogs.sap.com/2019/06/06/excel-file-.xlsx-exportimport/

Best regards,

Geert-Jan Klaps

Read only

0 Likes
2,258

Jimmy Moreno You should ask the client/project to agree on using abap2xlsx and when done, you'll be given the rights to install it (or anyone else). But maybe first check what format is the Excel file, is it XLSX or CSV or what? (NB: don't just consider the file extension as being a source of truth of the file's format, XLS extension was often used to store CSV format...) If it's CSV, you don't need ABAP2XLSX.