2020 Feb 07 9:06 PM
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.
2020 Feb 07 9:25 PM
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
2020 Feb 08 2:50 PM
(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.
2020 Feb 11 4:09 PM
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.
2020 Feb 11 5:22 PM
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
2020 Feb 11 7:22 PM
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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |