Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CSV file - Strings with multiple double quotes and commas

SAPSeeker
Participant
0 Kudos

Dear Guru's,

I am trying to write data from an internal table into a CSV file, but some fields has multiple commas (,) and double quotes (") within it. I tried covering the whole string within double quotes ("), but since the string has multiple double quotes and commas, the output in the file is not aligned. Can someone guide me how to overcome this issue ?

I don't want to have Horizontal tab as delimiter, since this is .CVS file and not .XLS file.

Thanks and Regards,

Gaurav.

1 ACCEPTED SOLUTION

SAPSeeker
Participant
0 Kudos

Got the issue resolved.

Followed the format of adding double quotes before existing ones and also covering the entire string within double quotes, as mentioned in the below RFC.

RFC 4180 - Common Format and MIME Type for Comma-Separated Values (CSV) Files

Best Regards,

Gaurav.

2 REPLIES 2

former_member183045
Contributor
0 Kudos

I suggest you generate it with ;

(Semicolon).

Additionalally you can use the following function module.

SAP_CONVERT_TO_CSV_FORMAT


Regards, Andreas

SAPSeeker
Participant
0 Kudos

Got the issue resolved.

Followed the format of adding double quotes before existing ones and also covering the entire string within double quotes, as mentioned in the below RFC.

RFC 4180 - Common Format and MIME Type for Comma-Separated Values (CSV) Files

Best Regards,

Gaurav.