2008 Jan 03 7:24 AM
Using OPEN dataset getting no authority dump.
Statement used is
-
OPEN DATASET y_filename FOR APPENDING IN TEXT MODE ENCODING DEFAULT
-
This statement is giving dump message "no authority"
y_filename has the value /usr/sap/tmp/text03012008.txt
Above mentioned file "text03012008.txt" does not exit on Application server and should be created
kindly advsie
2008 Jan 03 7:47 AM
As specified in online-help on instruction OPEN DATASET you have to check authority before opening any dataset.
Use Function Module AUTHORITY_CHECK_DATASET
Else you could try to CATCH the error OPEN_DATASET_NO_AUTHORITY
If an error occurs, then OPEN DATASET FOR OUTPUT
If an other error occurs, then has your user the right to create file on this directory.
CATCH SYSTEM-EXCEPTIONS OPEN_DATASET_NO_AUTHORITY = 1.
OPEN DATASET y_filename FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
ENDCATCH.
IF sy-subrc = 1.
CATCH SYSTEM-EXCEPTIONS OPEN_DATASET_NO_AUTHORITY = 1.
OPEN DATASET y_filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
ENDCATCH.
ENDIF.
IF sy-subrc = 1.
" errror message => Contact BC team for authorization
ENDIF.
Regards
2008 Jan 03 8:25 AM
Used the FM AUTHORITY_CHECK_DATASET
getting the output as no authority
How to proceed as I know that the file does not exit and has to be created through the open dataset command .
2008 Jan 03 9:59 AM
The person who is running ur report( creating the file) should have the authority to create in the database ie application layer level
2008 Jan 06 1:08 AM
Are you running this in the foreground or background? Does the userID have operating system file permission to the file?
/usr/sap/tmp/text03012008.txt
Can you verify the application server can see this path from the console?
2008 Jan 07 6:52 AM
Hi,
Ur id must have Authority to create a File on App Server. If not ask the basis to give a authorization.
Regards,
Srinivas M
2008 Jan 07 8:51 AM
2023 May 24 6:32 PM
AUTHORITY-CHECK OBJECT 'S_DATASET'
ID 'PROGRAM' FIELD sy-cprog
ID 'ACTVT' FIELD 'READ' "WRITE READ_WITH_FILTER WRITE_WITH_FILTER DELETE
ID 'FILENAME' FIELD y_filename.
IF sy-subrc IS INITIAL.
OPEN DATASET y_filename.
ENDIF.