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

Dataset

Former Member
0 Likes
578

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
528

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

5 REPLIES 5
Read only

Former Member
0 Likes
529

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

Read only

Former Member
0 Likes
528

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

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
528

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

Read only

Former Member
0 Likes
528

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

Read only

ferry_lianto
Active Contributor
0 Likes
528

Hi Ponraj,

Please check your email.

Regards,

Ferry Lianto