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: 

Excel file download in application server

Former Member
0 Kudos
300

Hi all,

I want to write int table content (itab) as tab delimitated file on application server with following code. It works fine on SAP version 5 onwards but do not work in version3 on which I m working now. It gives syntax error.

Can anyone Plz tell me any replacement for this code which will work fine on version3.

open dataset d1 for output in text mode.

loop at itab.

concatenate itab-fld1 itab-fld2 into str

separated by <b>cl_abap_char_utilities=>horizontal_tab.</b>

transfer str to d1.

endloop.

close dataset d1.

cl_abap_char_utilities=>horizontal_tab ."this is stat is not identified in vers 3."

1 ACCEPTED SOLUTION

Former Member
0 Kudos
84

Hi,

declare char variable

data:l_space(5) type c value '#####'.

open dataset d1 for output in text mode.

loop at itab.

<b>concatenate itab-fld1 l_space itab-fld2 l_space into str.

replace all occurences of '#' in str with ' ' .</b>

transfer str to d1.

endloop.

close dataset d1.

try this one...

i hope this will be helpful to you...

reward if needful..

4 REPLIES 4

former_member225631
Active Contributor
0 Kudos
84

Declare one character variable of lenght 5 and assign 5 spaces for that.

You can use this variable for separated by option. Just try this.

0 Kudos
84

Na! It is not working..

Former Member
0 Kudos
85

Hi,

declare char variable

data:l_space(5) type c value '#####'.

open dataset d1 for output in text mode.

loop at itab.

<b>concatenate itab-fld1 l_space itab-fld2 l_space into str.

replace all occurences of '#' in str with ' ' .</b>

transfer str to d1.

endloop.

close dataset d1.

try this one...

i hope this will be helpful to you...

reward if needful..

0 Kudos
84

Thanks for helpful answer.

But I tried it using

data :a(10) type c value 'abc'.

data : b(10) type c value 'def'.

open dataset d1 for output in text mode.

concatenate a b into a separated by '|'.

transfer a to d1.

close dataset d1.

7 it works fine.