SPLIT AT not working for Carriage Return(Resolved)

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Posts: 797
Joined: Wed Dec 18, 2002 5:55 am
Location: Hyderabad, India

SPLIT AT not working for Carriage Return(Resolved)

Post by Gladiator » Fri Feb 13, 2009 10:32 am

The below issue was resolved after doing like given below...
DATA: gv_cr,

gv_cr_lf = cl_abap_char_utilities=>cr_lf.
gv_cr = gv_cr_lf+1(1).

SPLIT gs_text AT gv_cr INTO gs_lines-line1 gs_lines-line2.

Below is the code I have used....

CONSTANTS: gc_crlf TYPE c VALUE cl_abap_char_utilities=>cr_lf.
data: begin of gs_lines,
end of gs_lines.

After reading the file, say, I have a value 'BRAKE SPIDER ASSEMBLY-FINISHED# (1.75 OFFSET) (SHOWN)'
in variable gs_text.

My next command was ....

SPLIT gs_text AT gc_crlf INTO gs_lines-line1 gs_lines-line2.

But, this is not working. My entire text was being placed in gs_lines-line1 instead of splitting the text into two target fields.

What am I doing wrong here? was size of the target fields a problem? We are on 4.7 and Unicode enabled.

Thank you.

Post Reply