Register Login

Reading a comma delimited file in ABAP (aka CSV file).

Updated May 18, 2018

Download functions of SAP allow you to write data into a file on the presentation server in many different formats. However, reading files (uploading) is very limited. A common question asked on forums is how to upload a comma delimited file. This format, also known as CSV, is used by many programs including MS Excel. For example, you may want to save an Excel spreadsheet into CSV file and then upload it into SAP. Unfortunately, there is no function that can help you.

Few years ago I had to extend an ABAP program with a capability to read CSV files. I wrote a very simple parser that can read files with any delimiter, not only comma. (It actually has to be a printable character, control characters will most likely not work). The delimiter can be set as a constant in the body of the parser form. It can be easily changed to be a form parameter. The code of the parser can be downloaded here.

If you find any problems that have to be fixed, please send your suggestions (the best would be some working code), as a comment on this article.