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

Function Module to Download Internal table in EXCEL

dhruv_shah3
Active Contributor
0 Likes
18,861

Hi All,

I need a Function Module to download the Internal table to Excel File.

I Have used SAP_CONVERT_TO_XLS_FORMAT,

but this function modules are using GUI_Download indirectly.

I dont want to use GUI_DOWNLOAD as i am going to call this Function Module in Portal.

So pls anybody has this type of function module.

Thanks & Regards,

Dhruv Shah

14 REPLIES 14
Read only

Former Member
0 Likes
6,400

Try WS_EXCEL

Read only

0 Likes
6,400

Hi,

But this function module is using GUI_DOWNLOAD .

so i am unable to use it in Portal.

Thanks

Read only

Former Member
0 Likes
6,400

Try using FM 'SAP_CONVERT_TO_XLS_FORMAT'. this can be used to download internal table to presentation server xls file. Provide the file address and internal table in the parameters.

Hope this solves your problem.

or else

CALL FUNCTION 'WS_EXECUTE'

EXPORTING

INFORM = 'X'

PROGRAM = 'EXCEL'

COMMANDLINE = 'C:\EXCEL.XLS'.

if this is absolute then you cna use GUI_RUN FM.

Edited by: murali papana on Sep 2, 2008 1:29 AM

Read only

0 Likes
6,400

Hi murali,

I already used this fm but it si working fine in R/3.

But in Portal i cannot use this as it is using GUI_DOWNLOAD.

also WS_EXECUTE is for opening the file with data already in it.

I want to transfer the data from internal table to excel.

If you have any other FM pls tell me.

Thanks & Regards,

Dhruv Shah

Read only

0 Likes
6,400

use open dataset/read dataset

open dataset d1 for output in text mode ENCODING DEFAULT.

LOOP AT I_FINAL.

concatenate I_FINAL-MATNR I_FINAL-WERKS I_FINAL-VERID

I_FINAL-ATWRT I_FINAL-ATWRT1 I_FINAL-ATWRT2

into str

separated by cl_abap_char_utilities=>horizontal_tab.

transfer str to d1.

endloop.

close dataset d1.

Read only

Former Member
0 Likes
6,400

Hi dhruv,

Use the FM:-

MS_EXCEL_OLE_STANDARD_DAT

Also check link,

[Internal Table to Excel|http://abaplovers.blogspot.com/2008/05/abap-internal-table-to-excel-sheet.html]

Luck,

Bhumika

Read only

0 Likes
6,400

Hi Bhumika,

Thanks for reply, but this also indirectly uses GUI_Download Function Moduel which i cant use in Portal.

If you have any other FM then pl reply me.

Thanks & Regards,

Dhruv Shah

Read only

Former Member
0 Likes
6,400

Hi,

I hope the below link will help you.

Thanks,

Khushboo.

Read only

Former Member
0 Likes
6,400

Hi

Cheers

Snehi

Read only

0 Likes
6,400

Hi Snehi.

Thanks for Reply. I already used this Function Module.

But it is also using GUI_DOWNLAOD. which is not accessible in Portal

Read only

Former Member
0 Likes
6,400

Hi,

Do you think it causes problem if I offer you to create excel file through mail attachment and get this file from mail then?

If you do like this, just you have to provide the attch type as XLS,

and it will create it for you.

Maybe helps.

Deniz.

Read only

Former Member
0 Likes
6,400

Hi

Go through the link given below :

With Regards

Sandeep

Read only

Former Member
0 Likes
6,400

Hello Dhruv.

In Agreement with Deniz.

It is required to Export the query as an excel file.

[SAP HELP Library - Standard Reference - Exporting as a CSV File / MS Excel 2000 File|http://help.sap.com/saphelp_nw04/helpdata/en/d2/11a28fc26d4042a6d230a9783152f2/content.htm]

[SDN - Reference - Error in "Export to Microsoft Excel" from Portal|;

Hope this works out well.

Good Luck & Regards.

Harsh Dave

Read only

0 Likes
6,400

Hi,

I am not using BI

Using Visual Composer and R/3