‎2006 Nov 15 6:00 PM
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
‎2006 Nov 15 6:02 PM
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
‎2006 Nov 15 6:02 PM
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
‎2006 Nov 15 6:08 PM
Check if you have this Object in your profile S_DATASET. if not,have it added...
~Suresh
‎2012 Nov 30 10:42 AM
Hey Suresh,
Thanks...
Solution worked for me.... I was getting error in RZ70..
Thanks,
Ishan Sangai
‎2006 Nov 15 6:14 PM
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?
‎2006 Nov 15 6:19 PM
If the other program also has an OPEN DATASET statement then ignore my earlier reply.. then the object already exists...
~Suresh
‎2006 Nov 15 6:22 PM
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.
‎2006 Nov 15 8:04 PM
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.
‎2006 Nov 16 12:29 AM
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
‎2006 Nov 16 1:00 PM
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.