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 signal #

Former Member
0 Likes
778

Hello,

Is there a function module to convert a string into the tabel TLINE of the function module SAVE_TEXT?

Note that the layout of the user MUST be kept:

eg when test :

_______________________________________

- kdjsdfklqfklqsm

- fjkqmjfkqsdlmjfklmqfjk fdklm jfkm kql k qk

fjkqfkjdlqmf

- jkflmqj

_______________________________________

This text is put in a string where the sign '#' notes a new lines:

eg string of above would be:

"- kdjsdfklqfklqsm#- fjkqmjfkqsdlmjfklmqfjk fdklm jfkm kql k qk##fjkqfkjdlqmf#- jkflmqj"

Is there a way to split this string at sign '#' into various char fields in order to use function C14W_STRING_TO_TLINE (which convert char fields into the tabel TLINE)

thanks,

Maggie

fjkqfkjdlqmf

- jkflmqj

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
661

Hi hans,

1. for separating NEW LINE Character

(which is displayed as #)

2. we can use directly

CL_ABAP_CHAR_UTILITIES=>CR_LF

or

CL_ABAP_CHAR_UTILITIES=>NEWLINE

3. eg.

split myvariable at

CL_ABAP_CHAR_UTILITIES=>NEWLINE

into table itab.

regards,

amit m.

3 REPLIES 3
Read only

Former Member
0 Likes
662

Hi hans,

1. for separating NEW LINE Character

(which is displayed as #)

2. we can use directly

CL_ABAP_CHAR_UTILITIES=>CR_LF

or

CL_ABAP_CHAR_UTILITIES=>NEWLINE

3. eg.

split myvariable at

CL_ABAP_CHAR_UTILITIES=>NEWLINE

into table itab.

regards,

amit m.

Read only

Former Member
0 Likes
661

Hello Amit,

thanks for your help, this class however does not exist in our system yet...

regards,

Maggie

Read only

sridhar_k1
Active Contributor
0 Likes
661

Are you using CL_GUI_TEXTEDIT for text entery? Method GET_TEXT_AS_R3TABLE returns user entered text as a table instead of string.

REgards

Sridhar