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 Problem

Former Member
0 Likes
1,778

Hello All,

I am just trying to open the file and read from file.

While opening with OPEN DATASET statement, it is giving the error. The error code is: sy-subrc=8. The file location is my local drive. Can you help?

The following is the code:

DATA:

g_dsn(30) VALUE 'C:\SI1061003'.

The open statement is:

OPEN DATASET g_dsn FOR INPUT IN TEXT MODE.

Thanks for the help,

Sobhan.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
870

Hi,

Does the file store in PC?

If your file is stored in PC, please use FM GUI_UPLOAD instead.

If it is stored in application server then you can use OPEN DATASET statement.

Regards,

Ferry Lianto

6 REPLIES 6
Read only

Former Member
0 Likes
871

Hi,

Does the file store in PC?

If your file is stored in PC, please use FM GUI_UPLOAD instead.

If it is stored in application server then you can use OPEN DATASET statement.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
870

Hi,

Use GUI_UPLOAD function module for getting the data from a local file..

Thanks,

Naren

Read only

Former Member
0 Likes
870

Hello Sobhan Annepu

Open dataset concept is to open a file on the application server and not on your local drive.

Instead use GUI_UPLOAD FM.

Thanks vj

Read only

Former Member
0 Likes
870

OPEN DATASET is used when file is in application server

pls use GUI_UPLOAD or GUI_DOWNLOAd if the file is in ur PC

Read only

0 Likes
870

Thanks to you all for the great help.

Thanks,

Sobhan.

Read only

Former Member
0 Likes
870

hello ,

while storing files in application server, u could n't predict operating system, so don't mention the path..

try this piece of code...

PARAMETERS:

P_FNAME(20) TYPE C DEFAULT 'MYFILE.TXT'.

OPEN DATASET P_FNAME

FOR OUTPUT

IN TEXT MODE

ENCODEING DEFAUT.

IF SY-SUBRC EQ 0.

WRITE 'FILE OPENED'.

TRANSFER SY-UNAME TO P_FNAME.

ENDIF.

CLOSE DATASET P_FNAME.