Create .csv file as output from SAP

15 pts.
Tags:
SAP ABAP
SAP development
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Hassan
    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 pointsBadges:
    report
  • Sapfool
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following