‎2006 May 04 4:38 PM
Hello, i need separate a string, example, 1,95,02,55, by ',' into a internal table. if i use "SPLIT p_frase AT ',' INTO TABLE t_frase" but it create a registry for string. Is it posible in only one registry?
Excuse for my bad english.
Thanks.
‎2006 May 04 4:51 PM
thats ok, but my internal table has 26 fields and i want to know if there are one fast way ;-).
Thanks.
‎2006 May 04 4:44 PM
Not sure what you mean by registry. By using the statement that you have provided, it will break the string into the specific parts into each line of the internal table. So if there are 4 fields in your string delimited by ',' you will have 4 records in your internal table. You can also break it out into individual fields.
split field_string at ',' into field1 field2 field3 field4.Regards,
Rich Heilman
‎2006 May 04 4:51 PM
thats ok, but my internal table has 26 fields and i want to know if there are one fast way ;-).
Thanks.
‎2006 May 04 4:55 PM
I am not sure, but try this.
Have a work area of the table
SPLIT STRING_vAR AT ',' INTO WA_TABLE.
I am not sure but this might get the values into individual tables.
Regards,
Ravi
Note : Please mark the helpful answers
‎2006 May 04 5:07 PM
‎2006 May 04 5:07 PM
You may want to try something like this.
report zrich_0001.
data: str type string.
data: istr type table of str with header line.
data: begin of xstructure,
field1(10) type c,
field2(10) type c,
field3(10) type c,
field4(10) type c,
end of xstructure.
field-symbols: <fs>.
str = '12,345,678,901'.
split str at ',' into table istr.
do.
read table istr index sy-index.
if sy-subrc <> 0.
exit.
endif.
assign component sy-index of structure xstructure to <fs>.
<fs> = istr.
enddo.
write:/ xstructure-field1,
xstructure-field2,
xstructure-field3,
xstructure-field4.
Regards,
Rich Heilman
‎2006 May 04 5:17 PM