‎2007 Dec 07 7:01 AM
Hi experts,
I want split the string.
String is like abcd | xyz | nhyu | adfsfs | fslfs | fjsflsfl |.
how can i split without knowing the number of substring.
is there any function module ..?
Pls help me.
Regards,
Murugan Arumugam.
‎2007 Dec 07 7:08 AM
Hi,
DATA: lt_string_data TYPE TABLE OF string,
wa_string TYPE string,
Use SPLIT <input> AT ' ' INTO TABLE lt_string_data.
LOOP AT lt_string_data INTO wa_string.
ls_output = wa_string.
APPEND ls_output TO <outputstiring>.
ENDLOOP.
‎2007 Dec 07 7:07 AM
Hi,
if you dont know the number of occurrences of the delimeter you can use the following code.
data: source type string ,
target type standard table of string .
source = 'This is for test.' .
split source at ' ' into table target .
regards,
Omkar.
‎2007 Dec 07 7:08 AM
Hi,
DATA: lt_string_data TYPE TABLE OF string,
wa_string TYPE string,
Use SPLIT <input> AT ' ' INTO TABLE lt_string_data.
LOOP AT lt_string_data INTO wa_string.
ls_output = wa_string.
APPEND ls_output TO <outputstiring>.
ENDLOOP.
‎2007 Dec 07 7:20 AM
data: begin of wa,
ch(30) type c,
end of wa.
data: itab like table of wa.
data: text type string value 'abcd | xyz | nhyu | adfsfs | fslfs | fjsflsfl |'.
SPLIT text AT '|' INTO TABLE itab.
loop at itab into wa.
write:/ wa-ch.
endloop.
‎2007 Dec 07 12:51 PM