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

How do I split multiple times?

Former Member
0 Likes
1,355

Hello,

I want to split my code into a workarea and append this to a an internal table for a later perform.

But sometimes the text contains more than 3 numbers for example 3;5;3;6;2;5 but its always 3,6,9,12... number. How can I solve the problem that I want to loop 3 times, then the next 3 numbers and so on?

DATA: text(100) type c,
it_1 TYPE STANDART TABLE LIKE text,
it_2 TYPE STANDART TABLE LIKE text,
it_3 TYPE STANDART TABLE LIKE text,
string(100) TYPE c.


text = '123;2;2'.

SPLIT text AT ';' INTO  wa_1-c1 wa_1-c2 wa_1-c3.

APPEND wa_1-c1 to it_1.
APPEND wa_1-c2 to it_2.
APPEND wa_1-c3 to it_3.

LOOP at it_1 INTO string.
PERFORM task using string.
ENDLOOP.
2 REPLIES 2
Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
865

F1 on SPLIT command 🙂

SPLIT text AT ';' INTO TABLE ...

https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abapsplit.htm

-- Tomas --
Read only

0 Likes
865

Probably the OP is not pleased with your answer as it's now posted in stackoverflow: https://stackoverflow.com/questions/54353779/how-do-i-split-multiple-times-in-abap