Application Development 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: 

Split command for theTAB spacing in file.

Former Member
0 Kudos
100

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

Former Member
0 Kudos
71

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

Former Member
0 Kudos
72

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

Former Member
0 Kudos
71

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

Former Member
0 Kudos
71

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

0 Kudos
71

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.

0 Kudos
71

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

0 Kudos
71

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

0 Kudos
71

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.

0 Kudos
71

Hi,

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

Regards, Dieter

Former Member
0 Kudos
71

Hi,

does it work?!?!

Regards, Dieter

0 Kudos
71

hi,

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

Regards,

stock