‎2007 May 26 4:29 AM
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
‎2007 May 26 4:31 AM
‎2007 May 26 4:51 AM
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.
‎2007 May 26 5:19 AM
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
‎2007 May 26 5:38 AM
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
‎2007 May 26 5:39 AM
it should be and try it .
i belive it should work
Reward Points if it is helpful
Thanks
Seshu
‎2007 May 26 5:40 AM
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.