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,790

I am getting sy-subrc = 0 on the function call but I am still getting a return code of 8 (permission denied) on the open dataset. Here is my code.

HELP!!

call function 'AUTHORITY_CHECK_DATASET'

EXPORTING

program = 'ZBS_PRODUCT_OUTBOUND_INTERFACE'

activity = 'WRITE'

filename = '
saberdev\blacksmith\ftpout\bsproduct.txt'

EXCEPTIONS

no_authority = 1

activity_unknown = 2

others = 3.

check sy-subrc = 0.

data: MSG(100).

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

CLEAR MSG.

OPEN DATASET pfilename FOR OUTPUT IN TEXT MODE MESSAGE MSG.

IF SY-SUBRC <> 0.

CONCATENATE 'file error: ' MSG INTO MSG.

MESSAGE E208(00) WITH MSG.

ENDIF.

5 REPLIES 5
Read only

abdul_hakim
Active Contributor
0 Likes
793

hi

file name is case sensitive.plz ensure that u have mentioned the correct filename...

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
793

The path/filename are correct. I am getting a good return code on the authorization check so I do not think there is a problem with the file name.

Read only

0 Likes
793

Does the file already exist? Do you have authority to delete the file from that folder? You can check with your FM.

Read only

0 Likes
793

Janet - Might be worth it to check the permissions/owner on the directory. You might be able to use function module SUBST_GET_FILE_LIST and trans SE37 to do this.

Regards,

Lawrence Schmit

Message was edited by: Lawrence Schmit

Keep in mind that the authority check only verifies your authorization level --> it doesn't verify that the drive/path/filename is valid. Also, it looks as if you're attempting to write to a network drive (assumed because of the back-slashes "
"). If you're writing to a Unix directory, use forward slashes '/'.

Read only

ferry_lianto
Active Contributor
0 Likes
793

Hi Janet,

Please check OSS Note 356505 perhaps it may help.

Regards,

Ferry Lianto