‎2009 Feb 11 5:36 AM
HI friends,
I want to know when do we use for input/output/update in open dataset?
for eg:
PERFORM BUILD_DSFULLNAME
USING T_EDIBP_DIR2-FILETARGET
T_EDIBP_DIR2-RUNID
T_EDIBP_DIR2-DATASET
T_EDIBP_DIR2-FILENAME
CHANGING DSFULLNAME_ORI.
OPEN DATASET DSFULLNAME_ORI.
above is the code.what should i use above.
Anuradha.
‎2009 Feb 11 5:40 AM
HI
we use input for reading the data from the file in the application server
output to write the data into the file in the application server
update when we are updating the data in the file application server.
example
data: w_file(255) type c value 'file'.
OPEN DATASET w_file FOR INPUT IN TEXT MODE ENCODING DEFAULT
MESSAGE fs_mesg.
OPEN DATASET w_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
MESSAGE fs_mesg.
OPEN DATASET w_file FOR UPDATE IN TEXT MODE ENCODING DEFAULT
MESSAGE fs_mesg.
report zxyx.
TABLES spfli.
DATA itab LIKE TABLE OF spfli WITH HEADER LINE.
DATA w_file(200) TYPE c VALUE 'FILE'.
SELECT * FROM spfli INTO TABLE itab.
SORT itab BY carrid ASCENDING
connid DESCENDING.
OPEN DATASET w_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT itab.
WRITE:/ itab-carrid,
itab-connid.
TRANSFER itab-carrid TO w_file.
TRANSFER itab-connid TO w_file.
ENDLOOP.[http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/content.htm]
thanks
sarves
‎2009 Feb 11 5:43 AM
Hi:
have a look at
[Open Dataset|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm]
Regards
Shashi
‎2009 Feb 11 5:48 AM
Hi,
when you want to create a new file on the application server you use for output.
when you want to read from the file from application server you use for input,
when you want to modify some lines in the file or add certain lines you use for update.
Regards,
Siddarth
‎2009 Feb 11 5:53 AM
Hi ,
Open the file of Application server -
for Input -- To read ( Read keyword ) from the file
for Output -- To write ( Transfer keyword ) from the file
Regards
Pinaki
Edited by: Pinaki Mukherjee on Feb 11, 2009 6:53 AM
‎2009 Feb 11 5:56 AM
Hi Anuradha,
Date Sets are nothing but files on Application Server, they can even be called as Sequential files.
Open Dataset is used to open required file on the application Server.
Read Dataset is used to read the contents required file on the application Server.
OPEN DATASET, READ DATASET,CLOSE DATASET ARE USED TO READ AND PLACE THE DATA IN THE APPLICATION SERVER.
OPEN DATASET IS USED TO OPEN THE DATASET.
SYNTAX:
OPEN DATASET <DATASET NAME>
FOR INPUT/OUTPUT
IN TEXT/BINARY
MODE ENCODING/ASCII
DEFAULT.
CLOSE DATASET IS USED TO CLOSE THE DATASET.
SYNTAX:
CLOSE DATASET <DATASET NAME>.
Hope it helps.
Regrds
Mansi
‎2009 Feb 12 9:01 AM
Thankyou everybody for your replies. It was really helpful.
Anuradha
‎2009 Feb 12 9:01 AM