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 FOR INPUT IN TEXT MODE ENCODING DEFAULT

Former Member
0 Likes
7,344

Hi Guys,

please i need help.

I am using this command:

OPEN DATASET db FOR OUTPUT IN TEXT MODE ENCODING  DEFAULT.
   IF sy-subrc NE 0.

and I always get
sy-subrc = 8


db is the directory where the file should be written. I have already put file in this directory in others transation but not manually.

What should I check here.

I have already read others disccusions but I didnt find any help. Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,764

Hi Maria,

This may happen if the file path is not correct.

It may also happen if you do not have write authorization in this folder.

Try giving some other path, eg a file in desktop where you are sure you have read/write authorization.

You need to have write authorization for each directory in your file path parameter.

The file name is case sensitve. so confirm that too.

4 REPLIES 4
Read only

Former Member
0 Likes
3,764

Hi Maria,

You can see the exact error message following this thread http://scn.sap.com/thread/607618.

BR.

Read only

former_member188827
Active Contributor
0 Likes
3,764

Instead of giving directory name "db", specify name of file like:.

DATA: e_file like rlgrap-filename value '/db/file.txt'.

then use e_file in your open data set statement.

This way,file will be created in specified directory. Make sure that name and path of directory is correct.

Regards

Read only

Former Member
0 Likes
3,765

Hi Maria,

This may happen if the file path is not correct.

It may also happen if you do not have write authorization in this folder.

Try giving some other path, eg a file in desktop where you are sure you have read/write authorization.

You need to have write authorization for each directory in your file path parameter.

The file name is case sensitve. so confirm that too.

Read only

Former Member
0 Likes
3,764

HI,

data:name type string.

name = 'TEST'.

Use the syntax, OPEN DATASET name FOR OUTPUT IN TEXT MODE ENCODING  DEFAULT.

Here <name> is the dataset name which will be created in AL11 transaction.

So instead of db use this.