Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

open dataset

Former Member
0 Likes
1,070

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.

7 REPLIES 7
Read only

Former Member
0 Likes
882

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

Read only

Former Member
0 Likes
882

Hi:

have a look at

[Open Dataset|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm]

Regards

Shashi

Read only

Former Member
0 Likes
882

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

Read only

Former Member
0 Likes
882

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

Read only

Former Member
0 Likes
882

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

Read only

Former Member
0 Likes
882

Thankyou everybody for your replies. It was really helpful.

Anuradha

Read only

Former Member
0 Likes
882

Thankyou my question is answered.