cancel
Showing results for 
Search instead for 
Did you mean: 

how to download internal table to excel sheet

Former Member
0 Kudos

I have a requirement to download nearly 8 to 10 internal tables to excel sheets(for each internal table one excel sheet) without displaying the diolog box showing open and save buttons.

scenario :

I will enter the path name like this - C:\myfolder\Custom_programs.xls.

C:\myfolder\Custom_tables.xls.

(File name does not exit..it has to created inside the

specified folder)

in submit button I populate 2 internal tables say it1 and it2. then I need to move the tables contents to the path I have specified above.

attach_file_to_response method is not working for the above reqt since it is showing the dialog box.

Please provide a suitable solution...

Accepted Solutions (0)

Answers (6)

Answers (6)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Please ignore all the responders that are stating that you can use GUI_DOWNLOAD from Web Dynpro ABAP. As you found out, this absolutely will not work, since this function module and other download logic like it depends upon a connection to the SAPGUI. People posting to use the GUI_DOWNLOAD from WDA need to learn a little more about the architecture of WDA before they go posting incorrect repsonses in the forum. I have little tollerance for people posting outright incorrect information in the WDA Forum.

What you want to do - download silent - is not easily done from WDA. There are rules about how web applications must behave in a browser. Normal HTML/JavaScript does not allow silent downloads for security reasons. Obviously there are many untrustworthy websites on the internet that you wouldn't want to allow to directly access your local machine. WDA must live within these same browser limitations.

SAP has done some work using a Java Applet to get around some of these security issues. This funcitonality comes in NetWeaver 7.01. It is the AcfUpDownload UI element:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b9157c878a2d67e10000000a42189c/frameset.htm

However it is designer for usage with the Content or KPro server - so even it might not meet your needs.

Former Member
0 Kudos

Hi all,

Thanks for all your responses but my problem is still not solved. I tried GUI_download in web dynpro by creating service call but it is showing an error. attach_file_to_response is also not possible since it will display dialog box (open, save).

I need the exact functionality of GUI_download in web dynpro ABAP.....please let me know if there is any other possible way.....

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Please ignore all the responders that are stating that you can use GUI_DOWNLOAD from Web Dynpro ABAP. As you found out, this absolutely will not work, since this function module and other download logic like it depends upon a connection to the SAPGUI. People posting to use the GUI_DOWNLOAD from WDA need to learn a little more about the architecture of WDA before they go posting incorrect repsonses in the forum. I have little tollerance for people posting outright incorrect information in the WDA Forum.

What you want to do - download silent - is not easily done from WDA. There are rules about how web applications must behave in a browser. Normal HTML/JavaScript does not allow silent downloads for security reasons. Obviously there are many untrustworthy websites on the internet that you wouldn't want to allow to directly access your local machine. WDA must live within these same browser limitations.

SAP has done some work using a Java Applet to get around some of these security issues. This funcitonality comes in NetWeaver 7.01. It is the AcfUpDownload UI element:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b9157c878a2d67e10000000a42189c/frameset.htm

However it is designer for usage with the Content or KPro server - so even it might not meet your needs.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Please ignore all the responders that are stating that you can use GUI_DOWNLOAD from Web Dynpro ABAP. As you found out, this absolutely will not work, since this function module and other download logic like it depends upon a connection to the SAPGUI. People posting to use the GUI_DOWNLOAD from WDA need to learn a little more about the architecture of WDA before they go posting incorrect repsonses in the forum. I have little tollerance for people posting outright incorrect information in the WDA Forum.

What you want to do - download silent - is not easily done from WDA. There are rules about how web applications must behave in a browser. Normal HTML/JavaScript does not allow silent downloads for security reasons. Obviously there are many untrustworthy websites on the internet that you wouldn't want to allow to directly access your local machine. WDA must live within these same browser limitations.

SAP has done some work using a Java Applet to get around some of these security issues. This funcitonality comes in NetWeaver 7.01. It is the AcfUpDownload UI element:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b9157c878a2d67e10000000a42189c/frameset.htm

However it is designer for usage with the Content or KPro server - so even it might not meet your needs.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Please ignore all the responders that are stating that you can use GUI_DOWNLOAD from Web Dynpro ABAP. As you found out, this absolutely will not work, since this function module and other download logic like it depends upon a connection to the SAPGUI. People posting to use the GUI_DOWNLOAD from WDA need to learn a little more about the architecture of WDA before they go posting incorrect repsonses in the forum. I have little tollerance for people posting outright incorrect information in the WDA Forum.

What you want to do - download silent - is not easily done from WDA. There are rules about how web applications must behave in a browser. Normal HTML/JavaScript does not allow silent downloads for security reasons. Obviously there are many untrustworthy websites on the internet that you wouldn't want to allow to directly access your local machine. WDA must live within these same browser limitations.

SAP has done some work using a Java Applet to get around some of these security issues. This funcitonality comes in NetWeaver 7.01. It is the AcfUpDownload UI element:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b9157c878a2d67e10000000a42189c/frameset.htm

However it is designer for usage with the Content or KPro server - so even it might not meet your needs.

Former Member
0 Kudos

Hi,

Go to Sap Technical > Tutorials>webdynpro Abap

This has got the step by step procedure to Export the Internal Table Values from the Browser to the Excel File.

Regards Madhu

Former Member
0 Kudos

Hi sharmila,

Regards,

Sravanthi

Former Member
0 Kudos

Hi,

Please use the function 'GUI_DOWNLOAD'.

I will give a simple coding here

REPORT  ZTEST.

data : itab like STANDARD TABLE OF zemptable WITH HEADER LINE.

select * FROM zemptable INTO TABLE itab.


CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename                        = 'c:\test.txt'
  tables
    data_tab                        = itab
          .
IF sy-subrc <> 0.
write 'SOme error'.
ENDIF.

Use this code to download the internal table.

Happy Abaping!!!!!!!1

Regards,

Bala.

Former Member
0 Kudos

Hi Bala,

Its not possible to use the Function Module: 'GUI_DOWNLOAD' with WebDynpro for ABAP, as it requires gui controls which comes only from SAP GUI, however, the static method attach_file_to_response of class cl_wd_runtime_services can be used for the same.

However, this wouldn't fulfill Sharmila's initial requirement that is to download without the popup asking suggesting user to open or save.

There is one more option i.e., using the FileDownload UI element, however the same would give the popup asking for opening or saving.

To use this particular UI element, a node with single attribute of type xstring is requiered. Besides a supply function is also required. Refreshing the node, will be done by invalidating the node.

Best Regards,

Rajesh.

former_member226203
Active Contributor
0 Kudos

if u need to only download the data from internal table to Excel sheets, think you can use the FM's for downloading the data into excel from internal tables.GUI_DOWNLOAD can be used.

To call them in Webdynpro Component, please check this link:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9cb5d345-0801-0010-6a8e-fc5...

former_member226203
Active Contributor
0 Kudos

Is it that you need to only download the data from internal table to Excel sheets.?

Is this in Webdynpro Component.

Edited by: Kalyan Chakravarthi on Jan 2, 2009 11:53 AM

Former Member
0 Kudos

Hi Kalyan,

Yes I only need to download data from internal table to excel sheet...this reqt is for web dynpro component...