cancel
Showing results for 
Search instead for 
Did you mean: 

Generic ABAP utility class to upload and download Excel spreadsheet

abaprules
Explorer
618

Hello ABAPers!

How many times have you struggled with Excel spreadsheet (XLSX and CSV) uploading and downloading routines with validations, date formats, decimals points, etc.? I created a generic handler class to help repetitive handling of Excel spreadsheets in our programs. Please, feel free to check it out at:

https://github.com/ewoyadmin/abap-excel-upload-download-handler.git

I'm glad if someone finds it helpful. 🙂

Happy coding! 

Sandra_Rossi
Active Contributor

Note that you have posted your message as a question. For a blog post go to https://community.sap.com/t5/technology-blogs-by-members/bg-p/technology-blog-members > Create a Blog.

EDIT July 31st: blog post created here > Generic ABAP utility class to upload and download ... - SAP Community

shais
Participant

Welcome to the community and thanks for sharing.
However, downloading/uploading an XLSX/CSV is a very popular subject, with a new blog post being published almost every month.

Two comments regarding your solution:
1. Your CSV implementation might be too simplistic. e.g. It doesn't handle a case in which the field value itself contains the field separator character.
2. The conversion to XLSX file (FM TEXT_CONVERT_XLS_TO_SAP) has a very significant technical restriction: It works only in foreground of Windows workstations (with OLE). Please check also ABAP2XLSX.

View Entire Topic
Sandra_Rossi
Active Contributor
0 Kudos

As I previously said, it's not a question.

Anyway, whatever you post it as a question or a blog post, you'd better describe it completely in sap.com, not explain it in the external Web site only, otherwise many people would post useless short information and require people to navigate to the Web site to understand what it is about exactly. So, to clarify, your tool has these limitations, copied from your repository:

  • ZCL_EXCEL_HANDLER is a general Excel upload/download handler class for SAP ABAP systems. It supports both XLSX and CSV file formats for uploading and downloading data between SAP and PC or application server.
     
  • FEATURES
    • Upload and download CSV files
    • Upload and download XLSX files
    • Support for both PC and application server file handling
    • Customizable CSV column separator
    • Header line handling for CSV files
    • Automatic data type conversion and validation
       
  • NOTES
    • Method upload_xlsx works only on Windows workstations with Excel installed and in foreground only (using OLE)
    • All other methods support upload and download on both PC (foreground) and application server (foreground/background)
    • The class handles data type conversions and validations automatically
    • Error handling is implemented using the ZCX_EXCEL_HANDLER exception class
abaprules
Explorer
Thank you for your kind reply and advide! My bad, this was my first post. 😕 I tried to delete the this Q/A post, but I did not find a way to do it. Then I tried to post the same as a blog, but I guess it is in review....
Sandra_Rossi
Active Contributor
It's not possible to delete anything here but a workaround is when your blog post is published, you may set the text "deleted" in the title and body of your question.