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: 

Parsing a csv file with carriage return replaced with #

Former Member
0 Kudos

Hi,

We have a weird problem. We are able to download a csv file using standard FM HTTP_GET. We want to parse the file and upload the data into our SAP CRM system. However, the file downloaded, has the carriage return replaced and the character # replaces it and everything seems like its one line.

I understand that the system replaces the Carriage return with the charater #. My question is, if I try to pass this file into my program to parse for the data, will there be any issues in the system recognizing that "#" that it is a carriage return and that the data in the file is not 1 record but multiple records?

2 REPLIES 2

Former Member
0 Kudos

Hi

'#' is what you see in the SAP. But the actuall ascii associated will be of carraige return itself. So to identify if you have multiple records of not don't use hard coded '#' but instead use the constant CL_ABAP_CHAR_UTILITIES=>CR_LF.

Regards

Ranganath

Former Member
0 Kudos

Hi,

what is the way you are uploading file? I usually use FM GUI_UPLOAD and I didn't noticed problems with different end-of-line characters. Try to upload file using this FM, then you can use FM TEXT_CONVERT_TEX_TO_SAP to convert CSV data to internal table.

Pavel