2014 May 06 4:14 PM
Hi Experts,
I have a requirement wherein i need to split aaaa#bbbbbbbbbbbb#ccc#dddddddddddddddddddddd#e# into internal table as below:
| Header 1 | Header 2 |
|---|---|
| 1 | aaaa |
| 2 | bbbbbbbbbbbb |
| 3 | ccc |
| 4 | dddddddddddddddddddddd |
| 5 | e |
how can this be done.
Thanks & Regards,
Anil
2014 May 06 4:36 PM
Hi Anil,
Declare one internal table with field string data type.
data : Begin of ty,
var type string,
end of ty.
data it type table of ty.
Then use below syntax,
split <string> at '#' into table it.
Hopes it helps you.
Thanks,
Ashok.
2014 May 06 4:19 PM
2014 May 06 4:25 PM
Hi,
split at into variables?
Number of # is not a constant here. split into variables and appending to table will not work here.
thanks,
Anil
2014 May 06 4:34 PM
2014 May 06 4:36 PM
Hi Anil,
Declare one internal table with field string data type.
data : Begin of ty,
var type string,
end of ty.
data it type table of ty.
Then use below syntax,
split <string> at '#' into table it.
Hopes it helps you.
Thanks,
Ashok.
2014 May 06 4:53 PM
Hi Ashok,
split <string> at '#' into table it. -Doesn't work
split <string> at SPACE into table it. - Works
But same statement with '#' is not working.
Feeling strange.
Thanks,
Anil
2014 May 06 4:57 PM
Hi,
It might be a tab .
Try with cl_abap_char_utilities=>horizontal_tab
regards.
2014 May 06 5:01 PM
Hi Eitan,
How do we split on wrt to tab.
# here is a tab, formed when data uploaded from an excel.
Thanks,
Anil
2014 May 06 5:07 PM
SPLIT text AT cl_abap_char_utilities=>horizontal_tab INTO....
2014 May 06 5:09 PM
SPLIT text AT cl_abap_char_utilities=>NEWLINE INTO.... worked beautifully.
Thank you,
Anil
2014 May 06 5:15 PM