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

ABAP dump on authorization issue

Former Member
0 Likes
6,996

hello,

I am not sure if this is the correct forum for this or not.

I have an ABAP program that was written before I got here that performs the following statement

<b>OPEN DATASET w_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.</b>

where w_file is a file on the app server. the users that run this program have no issues.

I have made a copy of the program to add some additional functionality and when the users run this program, the program is abending with the following error messages when trying to execute the same command stated above

Runtime Error OPEN_DATASET_NO_AUTHORITY

Except. CX_SY_FILE_AUTHORITY

I have talking to the security person and he is going to make another role with the authorizations needed to run the program but I am curious as to why the same person can run the one program successfully and my program (which does basically the same thing when it comes to the file processing) abends with the authorization issue.

thanks in advance for your help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,574

You should use the TRY CATCH block and catch the exception, so that it doesn't give a dump or at least handle the sy-subrc.

Regards,

Ravi

Note - Please mark all the helpful answers

9 REPLIES 9
Read only

Former Member
0 Likes
3,575

You should use the TRY CATCH block and catch the exception, so that it doesn't give a dump or at least handle the sy-subrc.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

0 Likes
3,574

Check if you have this Object in your profile S_DATASET. if not,have it added...

~Suresh

Read only

0 Likes
3,574

Hey Suresh,

Thanks...

Solution worked for me.... I was getting error in RZ70..

Thanks,

Ishan Sangai

Read only

Former Member
0 Likes
3,574

Suresh

if the user can run the one program successfully and the other program abend with the authorization issue, what does adding the S_DATASET to the profile do?

Read only

0 Likes
3,574

If the other program also has an OPEN DATASET statement then ignore my earlier reply.. then the object already exists...

~Suresh

Read only

Former Member
0 Likes
3,574

Yes it is basically the same program. I have added some fields to the dataset that is input to the process. the file that I am having the problem with is the file that is opened for output and populated with data that is used when submitting the RFBIBL00 program.

Read only

0 Likes
3,574

I believe you can use FM to check if user has sufficient authorization.

NOTE: authority-check uses PROGRAM NAME, so it looks like your profile should be updated with new program name.

Here is what help says :

Check file access authorization

Functionality

This function module allow you to check the user's authorization to

access files (with the key words OPEN DATASET, READ DATASET, TRANSFER and

DELETE DATASET). A check should be performed before opening a file.

The authorization check is performed uwing the authorization object

S_DATASET.

Description of function parameters:

o PROGRAM: Name of the ABAP/4 program that contains the file access. If

no program name is specified, the system assumes the current program.

o ACTIVITY: Access type. The possible values are:

- READ: Read file

- WRITE: Change file

- READ_WITH_FILTER: Read file with filter function

- WRITE_WITH_FILTER: Change file with filter function

- DELETE: Delete file

o FILENAME: Name of accessed file

Example

TYPE-POOLS SABC.

CALL FUNCTION 'AUTHORITY_CHECK_DATASET'

EXPORTING PROGRAM = 'ZDATASET'

ACTIVITY = SABC_ACT_READ

FILENAME = '/tmp/sapv01'

EXCEPTIONS NO_AUTHORITY = 1

ACTIVITY_UNKNOWN = 2.

Notes

The values to be passed as the ACTIVITY are defined as constants in the

TYPE-POOL SABC.

Read only

Former Member
0 Likes
3,574

Just a lucky guess,

Is the file created on UNIX? I did see something like this because when the program created the file, it didn't create with correct attributes. It might look the same but the attributes of the file or the folder might not the same.

Thanks!

Eric Herlim

Read only

Former Member
0 Likes
3,574

the probelm is corrected.

the program name was not in the S_DATASET authorization object. the security has corrected this and everything is working correctly.

thanks for all of the help on this.