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: 

Split string at signal #

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hello Amit,

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

regards,

Maggie

sridhar_k1
Active Contributor
0 Kudos

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