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

problems with tab

Former Member
0 Likes
932

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!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
681

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>.

4 REPLIES 4
Read only

Former Member
0 Likes
681

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á

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
681

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

Read only

Former Member
0 Likes
682

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>.

Read only

Former Member
0 Likes
681

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.