Application Development and Automation 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: 
Read only

CSV Conversion Considering Edge Cases

Former Member
0 Likes
512

We currently have a problem converting an internal ABAP table into a CSV file.

Example:

UserID;Name;Pet1;Pet2

D012345 Klaus Meier Dog;Bruno Cat"Kitty

should become

D012345;"Klaus Meier";"Dog;Bruno";"Cat ""Kitty" (<- content delimiter, escaped)

Is there a specific functional module where you can define whether to use such delimiters or not? And what would happen if there is - per accident - only one double quote in the field, can this be escaped e.g. by a second double-quote like Excel does it?

We are running on NW 7.01. Any help highly appreciated.

Best,

Oliver

2 REPLIES 2
Read only

franois_henrotte
Active Contributor
0 Likes
455

you just do

REPLACE ALL OCCURRENCES OF '"' IN my_struc WITH '""'.

then you apply separators

Read only

0 Likes
455

Thanks François,

but what about having the delimiter as part of the record as in "Dog;Bruno"?

Best,

Oliver