‎2009 Dec 09 11:55 AM
Hi every body,
I'm trying to process a file which is on the server.
The file has to columns and when i try to fill the data of the columns i realized that i need to identify the tabulation code.
Does anubody know how can i read the data set and identify that 09 key to fill the table in the way i want.
Thanx!!
‎2009 Dec 09 12:42 PM
Hai Jon,
check out the following code...
DATA str TYPE string
READ DATASAET <dataset_name> into str
SPLIT str AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL TAB into table <internal_table>.
‎2009 Dec 09 12:12 PM
Hi!
If you read the whole line into a structure or a variable, you can process it with the following commands:
SPLIT ls_struc AT ' '. "you have to put the tabulator char here between the ' '-s
And how can you enter this?
You can use any kind of text editors, personally I prefer the PSPAD freeware text editor (search it with google and download it if you don't have any). Select the tab character and then copy-paste it into your code.
Regards
Tamá
‎2009 Dec 09 12:27 PM
Hello,
Which version of SAP are you in ? If i am not mistaken then from version 4.7 you can use the constant CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB to identify the TABs.
This has been answered many times before in the forum. You can search it.
BR,
Suhas
‎2009 Dec 09 12:42 PM
Hai Jon,
check out the following code...
DATA str TYPE string
READ DATASAET <dataset_name> into str
SPLIT str AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL TAB into table <internal_table>.
‎2009 Dec 09 1:04 PM
Older versions:
data: delimiter(1) type x value '09'.
split <string> at delimiter into <field-list>.
Delimiter will cause an error if Unicode is enabled...switch unicode off in program attributes if not required.
Better solution already mentioned (ABAP Class method) below for later versions.