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: 

Gui Upload and Line Feed within a CSV cell from Excel

Former Member
0 Kudos
391

Hi all,

I am facing the problem that my CSV file to be uploaded via GUI_UPLOAD is containing cells where the Excel user has split the line within the cell. So there are CRLF at the end of the CSV row and single LF within a cell between the field separators.

GUI_UPLOAD is not making a difference and splits the line within the cell.

Is there any solution for this?

Thanks in advance for hints.

Axel

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
134

Hi Axel,

I didn't know that it was considering CRLF and LF the same way. A workaround is to do the job yourself: call GUI_UPLOAD using BIN format (you'll get the characters as bytes), get the frontend encoding (cl_gui_frontend_services=>GET_SAPLOGON_ENCODING), then convert the bytes into characters using CL_ABAP_CONV_IN_CE class (see documentation), and split (statement SPLIT AT) the characters at cl_abap_char_utilities=>cr_lf to get each line, then split each line at cl_abap_char_utilities=>horizontal_tab.

BR

Sandra

1 REPLY 1

Sandra_Rossi
Active Contributor
0 Kudos
135

Hi Axel,

I didn't know that it was considering CRLF and LF the same way. A workaround is to do the job yourself: call GUI_UPLOAD using BIN format (you'll get the characters as bytes), get the frontend encoding (cl_gui_frontend_services=>GET_SAPLOGON_ENCODING), then convert the bytes into characters using CL_ABAP_CONV_IN_CE class (see documentation), and split (statement SPLIT AT) the characters at cl_abap_char_utilities=>cr_lf to get each line, then split each line at cl_abap_char_utilities=>horizontal_tab.

BR

Sandra