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 the data into dynamic work area or internal table

Former Member
0 Likes
9,589

I need to fill the dynamic internal table from string.

String contains continues data fields are separated by '#'.

So, I need to split the string at '#' into dynamic work area fields. Can any body please help me at this point.

Thanks, Pedda

8 REPLIES 8
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
3,160

Hi,

You can use the command SPLIT which does this.

DATA: str1 TYPE string,

str2 TYPE string,

str3 TYPE string,

itab TYPE TABLE OF string,

text TYPE string.

text = `What#a#drag#it#is#getting#old`.

SPLIT text AT '#' INTO TABLE itab.

Regards,

Sesh

.

Read only

Former Member
0 Likes
3,160

Use the split statement...

SPLIT <c> AT <delimiter> INTO <c1> ... <cn>.

this should do it

Read only

Former Member
0 Likes
3,160

Hello,

do like this.

data: begin of itab occurs 0,
           line(15),
end of itab.

split string at '#' into table itab.

Vasanth

Read only

Former Member
0 Likes
3,160

Hi,

use SPLIT command.

Read only

Former Member
0 Likes
3,160

Hi,

Use <b>SPLIT <c> AT '#' INTO TABLE <itab>.</b>

Regards,

Padmam.

Read only

Former Member
0 Likes
3,160

Hi,

You can split a string into the individual lines of an internal table as follows:

SPLIT <c> AT <del> INTO TABLE <itab>.

The system adds a new line to the internal table <itab> for each part of the string.

If all target fields are long enough and no fragment has to be truncated, SY-SUBRC is set to 0.

Otherwise it is set to 4.

Ex.

Data : begin of itab occurs 0,

txt(30) type c,

end of itab.

Data : string(30) type c value 'abc#def#ghi'.

SPLIT string AT '#' INTO TABLE itab.

Regards,

Bhaskar

Read only

Former Member
0 Likes
3,160

I got the solution. Thanks for all.

Read only

0 Likes
3,160

Hello,

How you fix it ?

In my program, I opened the dataset succesfully.Then I want to use split .

My code is split data as '# ' into iT.

but it does not work.'#' are keep into the internal table.

How you fix your problem ?