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 - return code 8

Former Member
0 Likes
1,546

I am using the following statement:

OPEN DATASET pfilename FOR OUTPUT IN TEXT MODE MESSAGE MSG.

I am getting a sy-subrc = 8 and the message is 'Permission Denied'. The systems administrator said the folder has all permissions so we do not know why this is happening.

Any help would be appreciated.

Thanks,

Janet

9 REPLIES 9
Read only

ferry_lianto
Active Contributor
0 Likes
1,233

Hi Janet,

I assume your permission access is fine.

Perhaps the file has been opened by someone or other program. Please verify.

Regards,

Ferry Lianto

Read only

0 Likes
1,233

Hi,

try with a user that have sap_all role.

Could be your user is noth aythorized.

You could use this function before open the file :

call function 'AUTHORITY_CHECK_DATASET'

exporting

activity = 'READ'

filename = l_auth_filename

exceptions

no_authority = 1

activity_unknown = 2

others = 3.

Hoe it helps

Bye

Andrea

Pls reward if it Helps

Read only

0 Likes
1,233

No, it can not be open, I am creating a new file. I will include the authority check and then report back.

Thanks.

Read only

suresh_datti
Active Contributor
0 Likes
1,233

Before the open dataset, use the function module 'AUTHORITY_CHECK_DATASET' to see if you really have the authn..

~Suresh

Read only

Former Member
0 Likes
1,233

The file might have been opened by some one

Read only

Former Member
0 Likes
1,233

I should mention that this is the first time the network admin has set up this folder. It is the first time this company has tried to write files to the application server. They are running under Windows.

This function is giving me a run-time error that the ABAP is bad.

call function 'AUTHORITY_CHECK_DATASET'

EXPORTING

program = 'ZBS_PRODUCT_OUTBOUND_INTERFACE'

activity = 'WRITE'

filename = pfilename

EXCEPTIONS

no_authority = 1

activity_unknown = 2

others = 3.

pfilename =
saberdev\blacksmith\ftpout\bsproduct.txt

I can not figure out what is wrong with my function call.

Read only

0 Likes
1,233

Hi Janet,

Try by providing file name like this: It may slove your problem

pfilename = '/saberdev/blacksmith/ftpout/bsproduct.txt'

Replace the '\' with '/' in filepath.

Reward poitns if helpful answer.

Ashvender

Read only

Former Member
0 Likes
1,233

File name is case sensitive, check it for case......

Read only

Former Member
0 Likes
1,233

Janet,

I think your file name should be

pfilename(255) Type c Value ' /saberdev/blacksmith/ftpout/bsproduct.txt'.

try with above if not working remove .txt from file name.

pfilename(255) Type c Value ' /saberdev/blacksmith/ftpout/bsproduct'.

Pls. reward if useful.