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 FM

Former Member
0 Likes
572

Hello,

Does anyone know a standard string FM that split string at an absolut place and consider if the N place is blank or not ?

My meaning is likely:

str = 'test one two three'.

I would like to split str at the 10th place but because it's in a middle of word split it in the 8th place ..

str1 = 'test one'

str2 = 'two three'

and not

str1 = 'test one t'

str2 = 'wo three'

I know that VB has few methods like that, I'm hope abap has it also ..

Thanks in advance,

Rebeka

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
488

Try HRIQ_GB_UCAS_TEXT_WRAP_AROUND.

Thanks

Romit

2 REPLIES 2
Read only

Former Member
0 Likes
489

Try HRIQ_GB_UCAS_TEXT_WRAP_AROUND.

Thanks

Romit

Read only

Former Member
0 Likes
488

Hi Rebeka,

Please check the following code. This would help. FM 'TEXT_SPLIT' does it correctly.

DATA: text(50) TYPE c VALUE 'test one two three',

text1(20) TYPE c,

text2(20) TYPE c.

CALL FUNCTION 'TEXT_SPLIT'

EXPORTING

LENGTH = 10

TEXT = text

  • AS_CHARACTER =

IMPORTING

LINE = text1

REST = text2

.

check sy-subrc = 0.

write : text1 ,

text2.

Reward points if useful.

Regards

Abhishek