2006 Jul 17 12:25 PM
using read stmt is it possible to open the file in presentation server then how?
2006 Jul 17 12:28 PM
Hello Mohan,
For reading the file in the presentation server u have to use GUI_UPLOAD Fm.
If useful reward points.
Vasanth
2006 Jul 17 12:28 PM
Hello Mohan,
For reading the file in the presentation server u have to use GUI_UPLOAD Fm.
If useful reward points.
Vasanth
2006 Jul 17 12:29 PM
HI
you can open the file from the presentation server using
gui_upload fm. why you want to use the read statement.
regards
kishore
2006 Jul 17 12:29 PM
Hi,
Yes, it is possible, refer the following,
Retrieve Data file from Application server(Upload from Unix)
DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
OPEN DATASET i_file FOR INPUT IN TEXT MODE.
IF sy-subrc NE 0.
MESSAGE e999(za) WITH 'Error opening file' i_file.
ENDIF.
DO.
Reads each line of file individually
READ DATASET i_file INTO wa_datatab.
Perform processing here
.....
ENDDO.
You can also refer the following link to understand how it works,
http://www.sapdevelopment.co.uk/file/file_updown.htm
Rgds,
2006 Jul 17 12:30 PM
Hi,
You can use the FM GUI_UPLOAD to fetch the file from the presentation server into an internal table.You can read the internal table to fetch the data.
2006 Jul 17 12:30 PM
READ statement is used in case of DATASET. For file on presentation server, you should GUI_UPLOAD function or method GUI_UPLOAD of CL_GUI_FRONTEND_SERVICES.
Regards,
Ravi
Note : Please mark all the helpful answers
2006 Jul 17 12:31 PM
Hi Mohan,
READ TABLE statement is used to read single record of a Internal Tables.
READ cannot be used for reading data from Presentation server(PC).
<b>READ DATASET</b> is used for reading files on Application server.
Consider this code.
DATA : msg(200). "For holding messages during OPEN DATASET
DATA : i_int LIKE tedata-data.
OPEN DATASET w_path FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE msg.
IF sy-subrc NE 0.
MESSAGE w_osmsg TYPE 'S' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING.
ENDIF.
DO.
READ DATASET w_path INTO i_int.
IF sy-subrc EQ 0.
APPEND i_int.
CLEAR i_int.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET w_path.
If READ DATASET is used before opening a file, READ DATASET tries to open a file (IN BINARY MODE FOR INPUT or with the options of the last OPEN DATASET statement for this file)
For reading files on Presentation server use FM'S <b>GUI_UPLOAD</b> for getting data from Presentation server to ABAP PRogram and <b>GUI_DOWNLOAD</b> for putting data from ABAP PRogram to Presentation server.
Regards,
Arun Samabrgi.