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

Error in SPLIT statement

Former Member
0 Likes
960

I have a piece of code like below:

select * from zconfig into table i_zconfig where ZKEY = 'ZI2X11'.

if sy-subrc eq 0.

loop at i_zconfig.

split i_zconfig-zto at "," into table i_ordtyp.

loop at i_ordtyp.

write:/ i_ordtyp-ordtyp.

endloop.

endloop.

endif.

It shows a syntactic error in the split statement as:

"INTO" expected after "LOOP"

Please suggest!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
931

HI,

use single quotes here.

split i_zconfig-zto at ',' into table i_ordtyp.

rgds,

bharat.

8 REPLIES 8
Read only

Former Member
0 Likes
931

see the syntax below.

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 space INTO: str1 str2 str3,

TABLE itab.

otherwise u have to get the values in variable then...append that into a internal table..

Regards

Sugumar G

Edited by: Sugumar Ganesan on Mar 25, 2008 11:53 AM

Read only

Former Member
0 Likes
932

HI,

use single quotes here.

split i_zconfig-zto at ',' into table i_ordtyp.

rgds,

bharat.

Read only

dhruv_shah3
Active Contributor
0 Likes
931

Hi,

Use single quotes

Regards,

Dhruv Shah

Edited by: Dhruv Shah on Mar 25, 2008 4:22 PM

Read only

Former Member
0 Likes
931

Hi

i_ordtyp should be of type

data: begin of i_ordtyp occurs 0,

text(255),

end of i_ordtyp.

size of text may be any.

Regards

Aditya

Read only

Former Member
0 Likes
931

use single quote ..

split i_zconfig-zto at ',' into table i_ordtyp.

Read only

Former Member
0 Likes
931

Hi,

select * from zconfig into table i_zconfig where ZKEY = 'ZI2X11'.

if sy-subrc eq 0.

loop at i_zconfig.

split i_zconfig-zto at ',' into table i_ordtyp.

if i_ordtyp[] is not initial.

loop at i_ordtyp.

write:/ i_ordtyp-ordtyp.

endloop.

endif.

refresh i_ordtyp.

endloop.

endif.

Read only

Former Member
0 Likes
931

Thx'

Read only

Former Member
0 Likes
931

Thx'