ABAP log

August 29, 2007

The best ABAP short dump.

Filed under: ABAP, SAP — abaplog @ 7:25 pm

We all love ST22. I have seen many funny messages there. And this one, well… it’s a tribute to SAP short dumps. See for yourself and have fun.

Note: The image can be resized by your browser and be hardly readable. Clicking the mouse over it helps to get the original size.

August 15, 2007

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

Filed under: ABAP, SAP — abaplog @ 8:51 pm

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. NOTE: use “view source” function of your browser – there are field symbols that are interpreted as HTML tags (I’ll have to fix that…)

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.

Create a free website or blog at WordPress.com.