06-19-2006 3:15 PM
Hi,
could anyone explain wats meant by
open dataset p_file for input in text mode
read dataset p_file for input in text mode.
thanks,
Ponraj.s.
ponraj_rec@yahoo.com
06-19-2006 3:17 PM
open dataset p_file for input in text mode
<b>To open a file on the application server for reading.</b>
read dataset p_file for input in text mode.
<b>To read the opened file .</b>
Regards,
Ravi
06-19-2006 3:17 PM
open dataset p_file for input in text mode
<b>To open a file on the application server for reading.</b>
read dataset p_file for input in text mode.
<b>To read the opened file .</b>
Regards,
Ravi
06-19-2006 3:17 PM
hi Ponraj,
1. the first statement open dataset is for <b>opening the file</b> from the application server.
2. the second statement is for <b>reading the file</b>( existing ) from the application server.
Hope i have answered your question
Have a look at this program for further queries
http://www.sapdevelopment.co.uk/file/file_uploadsap.htm
Regards,
Santosh
06-19-2006 3:19 PM
The DATASET statements are the statement that you use to read a file from the application server. You open the file using the OPEN dataset statement, you then read it using the READ dataset statement.
report zrich_0001.
Parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.txt'.
data: itab type table of string.
data: wa type string.
start-of-selection.
open dataset d1 for input in text mode.
if sy-subrc = 0.
do.
read dataset d1 into wa.
if sy-subrc <> 0.
exit.
endif.
append wa to itab.
enddo.
endif.
close dataset d1.
http://help.sap.com/saphelp_webas620/helpdata/en/fc/eb3d42358411d1829f0000e829fbfe/frameset.htm
Regards,
Rich Heilman
06-19-2006 3:20 PM
Hi,
1. Opens the specified file.
OPEN ... FOR INPUT opens the file in read mode.
2. Imports a record from a sequential file whose index and name are specified in dsn into the data object
Rgds,
Prakash
06-19-2006 3:37 PM