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

Split command for theTAB spacing in file.

Former Member
0 Likes
1,191

Hi all,

Requirement is to read a file from the application server and process it.

The file has the TAB spacings and seen from AL11 shows # for tabs.

I have read the line in a character of 1024. Now on splitting at delimiter '/h/' as seen in debug it does not split the line as reqired.

How to split the columns with tab space.

appreciate your inputs.

Thanks,

Stock

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,162

Hi,

1. SPLIT f AT g INTO h1 ... hn.

e.g.

DATA: ONE(10) TYPE C,

TWO(10) TYPE C,

SPLIT FIELD AT '#' INTO ONE TWO.

regards

Nicole

10 REPLIES 10
Read only

Former Member
0 Likes
1,163

Hi,

1. SPLIT f AT g INTO h1 ... hn.

e.g.

DATA: ONE(10) TYPE C,

TWO(10) TYPE C,

SPLIT FIELD AT '#' INTO ONE TWO.

regards

Nicole

Read only

Former Member
0 Likes
1,162

Split the line at the special character cl_abap_char_utilities=>horizontal_tab.

SPLIT lv_line AT cl_abap_char_utilities=>horizontal_tab INTO TABLE itab.

Please mark points if the solution was useful.

Regards,

Manoj

Read only

Former Member
0 Likes
1,162

hi stock,

i'm not quite shur if it works, but try this:

CONSTANTS:

CON_NEWL TYPE ABAP_CHAR1 VALUE ABAP_CHAR_UTILITIES=>NEWLINE,

CON_TAB TYPE ABAP_CHAR1 VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

and split with CON_TAB. Perhaps it helps.

Regards, Dieter

Read only

0 Likes
1,162

I tried with the above statements, but get the error as

Class CL_ABAP_CHAR_UTILITIES is unkonwn.

i am workin on SAP 4.6c.

Read only

0 Likes
1,162

Use this code.

data lv_tab type char1 value %_HORIZONTAL_TAB.

split lv_line at lv_tab into table itab.

Please mark points if the solution was useful.

Regards,

Manoj

Read only

0 Likes
1,162

Hi stock,

sorry but you can use

CONSTANTS: CON_NEWL TYPE X VALUE '0D', "OK for non Unicode

CON_TAB TYPE X VALUE '09'. "OK for non Unicode

or

CONSTANTS: CON_NEWL TYPE X VALUE %_NEWLINE,

CON_TAB TYPE X VALUE %_HORIZONTAL_TAB.

Regards, Dieter

Read only

0 Likes
1,162

Hi ,

%_HORIZONTAL_TAB is not accepted without quotes ' ' .

If given with quotes it takes only the 5 character and the split does not work.

How it has to be declared.

Read only

0 Likes
1,162

Hi,

i'm not sure if it works in your system. Try '09'.

Regards, Dieter

Read only

Former Member
0 Likes
1,162

Hi,

does it work?!?!

Regards, Dieter

Read only

0 Likes
1,162

hi,

i tried with 09 even ....but didnt work for tabs

Regards,

stock