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

Split string at line break

Former Member
0 Likes
6,773

Hi,

A string remembers line break as a character # (Hex - 0A) which is different from the normal character # (Hex - 23). I need to split a string at the line break into multiple strings. The normal usage of SPLIT command does not help. If somebody has a better idea, please let me know. Thnaks in advance.

Regards,

Sudhakar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,113

use this..

SPLIT V_STR AT <b>CL_ABAP_CHAR_UTILITIES=>NEWLINE</b> INTO ....

4 REPLIES 4
Read only

Former Member
0 Likes
3,113

well a line break consists normally of two characters.

chr(10)line-break and chr(13)line-feed.

maybe you can skim your string for those two ascii codes 10 and 13.

Read only

Former Member
0 Likes
3,114

use this..

SPLIT V_STR AT <b>CL_ABAP_CHAR_UTILITIES=>NEWLINE</b> INTO ....

Read only

Former Member
0 Likes
3,113

data a type x value '09'.

split int_table-field at '#' into target-field

target fied.

append target_field.

Read only

Former Member
0 Likes
3,113

Thanks a lot to Chandrasekhar. His reply has solved my problem.

Regards,

Sudhakar.