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

Excel Sheet format

Former Member
0 Likes
1,002

Hi,

I need to download internal table data into application server in excel sheet format

how do i do it ?

can anybody help me regarding this issue.

Thanks

Sudha

6 REPLIES 6
Read only

amit_khare
Active Contributor
0 Likes
808

use open dataset and directly put the extension as .XLS

Check the links -

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
808

Hi,

Go through the following code

DATA FNAME(60) VALUE 'myfile'. " File name of applicationserver

TYPES: BEGIN OF TY_ITAB,

matnr TYPE matnr.

TYPES: END OF OF TY_ITAB

DATA : ITAB TYPE TABLE OF TY_ITAB.

DATA : WA LIKE LINE OF ITAB.

*Populate ITAB as per ur requirement

OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.

LOOP AT ITAB INTO WA.

TRANSFER WA TO FNAME.

ENDLOOP.

CLOSE DATASET FNAME.

Reward if useful.

thanks

Aneesh.

Read only

Former Member
0 Likes
808

I have done by using Open dataset but i had bad experience,it will have all junk data while downloading from internal table to xl file in application server.

so try to use below one and you will get good results

Try using FM MS_EXCEL_OLE_STANDARD_DAT there is a field in it FILE_NAME LIKE RLGRAP-FILENAME. Give the desired path of the application server. This will save your excel file on the server.

Now read that file again using another function module given above.

Reward Points if it is helpful

Thanks

Seshu

Read only

Former Member
0 Likes
808

Hi,

also , i need to give the extension as '.csv' in application server path .

if i use open data set and give the extension as .csv will i able download it into excel

Thanks

Sudha

Read only

0 Likes
808

it should be and try it .

i belive it should work

Reward Points if it is helpful

Thanks

Seshu

Read only

0 Likes
808

No if you give the extension as .CSV it will not save in excel format but will be comma delimited format.

But this file can be easily open in excel.

Regards,

Amit

Reward all helpful replies.