‎2005 Feb 24 6:59 AM
Hi,
I have an Internal table in my program that I want to save to disk in some way...
Is there any FM or something for this ?
//Martin
‎2005 Feb 24 7:23 AM
Hi Martin,
By "disk" do you mean your local hard drive or is it the SAP Application Server that you are referring to ?
Regards,
Anand Mandalika.
‎2005 Feb 24 7:12 AM
martin,
you could use FM 'WS_DOWNLOAD' or 'GUI_DOWNLOAD' - the documentation inline should be simple enough to follow.
ryan.
‎2005 Feb 24 7:23 AM
Hi Martin,
By "disk" do you mean your local hard drive or is it the SAP Application Server that you are referring to ?
Regards,
Anand Mandalika.
‎2005 Feb 24 7:52 AM
Hi,
I have a abap report and now I want to save the the internal table to a file (static path).
No user input should be nessesary.
EX
In other programming languages:
MyInternalTAb.Save('
SERVER1\TMP\output.txt')
Howto in ABAP ?
//Martin
Message was edited by: Martin Andersson
‎2005 Feb 24 8:29 AM
As Ryan has already suggested WS_DOWNLOAD AND GUI_DOWNLOAD, I would also recommend to use the method GUI_DOWNLOAD from the class CL_GUI_FRONTENDSERVICE . Go to SE24, put the class name and you will find the various methods available. One of them is GUI_DOWNLOAD.
I would suggest you to use the PATTERN button in SE38, then click on ABAP 00, and there mention the name of the method(GUI_DOWNLOAD) , class name (CL_GUI_FRONTENDSERVICE). It writes the code for you. All you now need to do is
a) Mention the filename
b) Mention the filetype
c) Pass the internal table
Let us know how it goes.
Regards,
Subramanian V.
‎2005 Feb 24 8:35 AM
try this:
call function 'WS_DOWNLOAD'
exporting
filename = cpath
"c:tempoutput.txt
filetype = 'DAT' "tab-delimited
tables
data_tab = itab
exceptions
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
others = 10.
ryan.
‎2005 Feb 24 8:53 AM
A TRANSFER can also be used. You do a transfer of a field, a string, or a structure. You must always transfer internal tables line by line, for example, using a LOOP construction.