15 pts.
 Create .csv file as output from SAP
We need to create a .CSV file as output from an SAP ABAP program. Currently there is a function to download a file in tab-delimited format (GUI_DOWNLOAD), but we cannot find a way create a .CSV (comma-delimited) output format. Any assistance would be appreciated.

Software/Hardware used:
ASKED: August 3, 2005  4:35 PM
UPDATED: May 8, 2013  4:05 PM

Answer Wiki:
Dear Friend There are different ways in creating a CSV file. The right way is to use the function SAP_CONVERT_TO_CSV_FORMAT. You can just go through the function, everything is clear. To complete, for every convert function there is an equal and opposite convert function, so is TEXT_CONVERT_CSV_TO_SAP. Otherwise, you can create an internal table with one char field of size as required and try to concatenate all values with the required delimiters and so put into this internal table and download this table. But the right way is to use the function. Hope this could help you. Take care.
Last Wiki Answer Submitted:  May 8, 2013  4:06 pm  by  Michael Tidmarsh   14,060 pts.
All Answer Wiki Contributors:  Michael Tidmarsh   14,060 pts. , Barnard   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Hi.

If it’s only for one / few times, you can create your excel file fra SAP, open it via EXCEL and save it as a .csv file.
You can open your .csv fil with notepad and save it again as .txt file.

 5 pts.

 

Hi,

Don’t think a .csv file is a good idea. End-users and outside vendors can fill a data field with just about anything, including commas and semi-colons. You can create
a tab delimited file just as easily, and not worry about stuff, like, say MAKT-MAKTX having a value of “gloves, latex, non-sterile, exam”. That’s a live example from our production system. There are also things like /Cable, ethernet, 8′/ where a single quote (‘) is used for feet, and a double quote (“) is used for inches.

Data: tabchar type X value ’09′,
crlf type x value ’0D0A’. “carraige return/line feed

Concatenate field1 field2 field3 crlf separated by
tabchar into excel_itab.
append excel_itab.

Looking at this e-mail, depending on your browser, the values may not be clear. tabchar is zero nine; crlf is zero delta zero able.

Live Long & Prosper, Bill

 0 pts.