Skip to Content
0
Former Member
Oct 01, 2007 at 12:56 PM

While downloading into Excel

10 Views

Hi i am using ole concept to donwload data from internal table to Excel.

For example i am giving my logic.

types: begin of x_jobs,

sno(3) type n,

jobname(50) type c,

comment type string,

end of x_jobs.

data: t_jobs type standard table of x_jobs,

w_jobs type x_jobs.

w_jobs-sno = 100.

w_jobs-jobname = 'HAA'.

append w_jobs to t_jobs.

w_jobs-sno = 2.

w_jobs-jobname = 'BAI'.

append w_jobs to t_jobs.

loop at t_jobs into w_jobs.

w_tabix = sy-tabix.

w_jobs-comment = 'What is your name'.

concatenate w_jobs-comment 'My name is Subhani' into w_jobs-comment

modify t_jobs from w_jobs index w_tabix transporting comment.

endloop.

When i am downloading to excel with OLE concpet output is as fallows(ignore doted lines just to separate column i have used)

SNO JOBNAME COMMENT

100--


HAA--


What is your nameMy name is Subhani

2--


BAI--


What is your nameMy name is Subhani

But i want the output as fallows (What is your name and My name is Subhani should be in one cell of excel sheet and in different lines)

SNO JOBNAME COMMENT

100--


HAA
"What is your name
--


-


My name is Subhani"----


2--


BAI--


"What is your name

-


My name is Subhani"

in version 6.0 i have one method 'CL_ABAP_CHAR_UTILITIES=>NEWLINE'

If i use this as in fallowing code output is coming according to my requirement.

loop at t_jobs into w_jobs.

w_tabix = sy-tabix.

w_jobs-comment = 'What is your name'.

concatenate w_jobs-comment 'My name is Subhani' into w_jobs-comment

separated by cl_abap_char_utilities=>newline.

modify t_jobs from w_jobs index w_tabix transporting comment

endloop.

But presently i am working in 4.6c where there is no such method.

How can i do this in 4.6c.

Please help me.

Regards,

Subhai.