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: 

Create tab seperated file on application server

Former Member
0 Kudos

Hi all

I need to create a file with Tab separation. I have a solution on a 4.7 system as shown below. But this does not work on a 4.6 system as the class does not exist.

How can I do this on a 4.6 system?

Thank you four your reply.

Herbert

CONSTANTS c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.

LOOP AT t_material.

CONCATENATE

t_material-id

t_material-brand

t_material-desc

t_material-level

t_material-flag

INTO w_line

SEPARATED BY c_tab.

TRANSFER w_line TO w_file2.

ENDLOOP.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

do this way...

  • Table to store final data

CONSTANTS: cns_09(2) TYPE n VALUE 09,

c_val1 TYPE c VALUE 'X'.

DATA: g_deli(1) TYPE c.

  • table to place delimiter

DATA: BEGIN OF it_hex,

tab TYPE x,

END OF it_hex.

ASSIGN g_deli TO <fs> TYPE c_val1.

it_hex-tab = cns_09.

<fs> = it_hex-tab.

LOOP AT t_material.

CONCATENATE

t_material-id

t_material-brand

t_material-desc

t_material-level

t_material-flag

INTO w_line

SEPARATED BY g_deli.

TRANSFER w_line TO w_file2.

ENDLOOP.

3 REPLIES 3

Former Member
0 Kudos

do this way...

  • Table to store final data

CONSTANTS: cns_09(2) TYPE n VALUE 09,

c_val1 TYPE c VALUE 'X'.

DATA: g_deli(1) TYPE c.

  • table to place delimiter

DATA: BEGIN OF it_hex,

tab TYPE x,

END OF it_hex.

ASSIGN g_deli TO <fs> TYPE c_val1.

it_hex-tab = cns_09.

<fs> = it_hex-tab.

LOOP AT t_material.

CONCATENATE

t_material-id

t_material-brand

t_material-desc

t_material-level

t_material-flag

INTO w_line

SEPARATED BY g_deli.

TRANSFER w_line TO w_file2.

ENDLOOP.

0 Kudos

Thank you for the quick reply

Former Member
0 Kudos

hi,

Make use of ASCII value of TAB.

<b> constants : c_tab(2) type x value '09'.</b>

try to contatenate this constant instead of cl_abap_char_utilities=>horizontal_tab

Regarsd

Sailaja.