Can I output a CSV file in an ABAP program?

Can I output a CSV file in an ABAP program?

How can I output a CSV file in an ABAP program? The CSV output file format has become very popular, but I cannot find any function module in SAP that will output a CSV file by simply removing all leading and trailing spaces of each field in a given output structure and adding in the comma separators.

WS_DOWNLOAD cannot do this. I just wonder if there is another function module available to do this.

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

There is no provided function module to do this. You have to code the comma delimiters in yourself. I believe on one of the forums of the SAP Development Network* there is code posted that does this in a generic way.

* Registration required to access the SDN

This was first published in June 2005