07-23-2007 4:19 PM
Hello folks,
I have a quick question:
I need to create a dataset file and save it on my desktop. Then read data from a table and store it in my dataset file.
How can I do this?
Please advise and rewards will be given appropriately.
Ol.
07-23-2007 4:21 PM
Hi,
Use fm GUI_UPLOAD and GUI_DOWNLOAD.
Search this forum with key word "GUI_UPLOAD and GUI_DOWNLOAD" for sample code.
aRs
07-23-2007 4:23 PM
Hi,
You can create the DATASETS in the Appliaction server only, we can not create the datasets in the Presentation server(Desktop), you can create the files in the Presentation server, but every time it will be over write you can not add the data, but in the Application server you can update the data with the latest data, or you can add the records to the fiel which is already existed
Regards
Sudheer
07-23-2007 4:23 PM
Hi,
For storing data to your desktop you can use GUI_DOWNLOAD.
You can read data from database and store it in internal table. Pass the internal table to the function module. Specify the path where you want to download.
This will download to your desktop.
Reward if helpful.
07-23-2007 4:23 PM
Refer to these related threads
http://www.sapdevelopment.co.uk/file/file_downloadsap.htm
http://www.sapdevelopment.co.uk/file/file_uploadsap.htm
http://www.sapdevelopment.co.uk/file/file_uptabsap.htm
Regards,
Santosh
07-23-2007 4:23 PM
Hi,
Basic form
READ DATASET dsn INTO f.
Addition
... LENGTH len
Effect
Reads a record from the sequential file specified in dsn (a field or a literal) and stores it in the field f (usually a field string).
Binary mode (addition IN BINARY MODE in the OPEN DATASET statement:
Read from file in length of field f .
Text mode (addition IN TEXT MODE in the OPEN statement):
Read a line.
If the specified file is not open, READ DATASET attempts to open the file dsn ( IN BINARY MODE FOR INPUT or with the specifications of the last OPEN command for this file). Any errors result in the termination of the program.
To read all the records in a file, you are recommended to place READ DATASET in a DO loop that you leave with EXIT .
The return code value is set as follows:
SY-SUBRC = 0 Record read from file.
SY_SUBRC = 4 End of file reached.
Example
Define the field string REC :
DATA: BEGIN OF REC,
TEXT(30),
NUMBER TYPE I,
END OF REC.
Read the file "/usr/test":
DO.
READ DATASET '/usr/test' INTO REC.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
WRITE: / REC-TEXT, REC-NUMBER.
ENDDO.
Notes
You can use TRANSFER to output records to a sequential dataset.
The format of file names depends largely on the operating system. You can access portable programs by using the function module FILE_GET_NAME which returns the physical name for a given logical file name.
Addition
... LENGTH len
Effect
Stores the length of the record read from the file in the field len .
Pls reward all helpful points.
Regards,
Ameet
07-23-2007 4:24 PM
use the FM gui_download to get the data into your presentation server from the application server and gui_upload for vice-versa.
go to www.se37.com for the documentation regarding any FM.
regards,
srinivas
<b>*reward for useful answers*</b>
07-23-2007 4:27 PM
hi
good
go through this link,
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/content.htm
thanks
mrutyun^