09-30-2013 8:19 AM
I am unable to create a file in Application Server using the following statement.
OPEN DATASET filename FOR OUTPUT
IN TEXT MODE ENCODING DEFAULT
MESSAGE msg.
The message I'm getting is "Permission Denied". I have checked authorisation using SU53 which says "The last authorization check was successful". Please help.
09-30-2013 9:08 AM
Hi Ankit,
The Application server permissions are handled at the OS level and not captured by SU53.
Please check with Your BASIS team for the proper authorisations.
Regards,
Vamsi
09-30-2013 8:48 AM
Hi,
If you have proper authorization,then
Check you use close_dataset or not,see this link for details.
http://scn.sap.com/thread/1409662
Hope it will solve.
Thanks
Gourav.
09-30-2013 8:59 AM
Dear Ankit,
If you want to add any file in application server then why are you going it through code, use the GOS services to create and display the files... on server... it's very useful service tool...
Go through this link... https://scn.sap.com/docs/DOC-39470 and use it, if it doesn't fulfills your requirement then revert back on this, then I will try for other thing.....
Many Thanks / Himanshu Gupta
09-30-2013 9:03 AM
Hi,
this issue is independent from your Application authorities.
filename is the complete filename including the pathname.
There must be writing authority in the path for the SAP system user.
Regards,
Klaus
09-30-2013 9:08 AM
Hi Ankit,
The Application server permissions are handled at the OS level and not captured by SU53.
Please check with Your BASIS team for the proper authorisations.
Regards,
Vamsi
09-30-2013 2:24 PM
Yes, either your BASIS team or network administrators will need to solve this.
10-01-2013 2:21 PM
Yes, the BASIS team finally solved the problem by set the permissions of the directory
09-30-2013 10:29 AM
Hi Ankit,
In usual case,
CONCATENATE p_dir1 '\LOG\' sy-datum '_' sy-uzeit '_' p_file1 INTO lv_logfile.
OPEN DATASET lv_logfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
should work. Are you able to create file in application server manually ?
Make sure that the file location is appropriate.
09-30-2013 2:16 PM
Hi Nivedita,
Thanks for your suggestion. The file path is appropriate. And I also tried creating file in Application server using the T-code EG3Z, but there also I got the error "cannot open file <filename>" although I was able to overwrite existing files at the same location using the same T-Code.
09-30-2013 10:50 AM
Hi,
I think that your issue is caused by a missing authorization to write a file on the application server.
Please, verify with your basis team.
Cheers
Ivan
09-30-2013 11:12 AM
You can use following code to capture the error.
TRY.
OPEN DATASET filename FOR OUTPUT IN BINARY MODE MESSAGE V_MSG.
CATCH CX_ROOT
INTO EXCEPTION.
CALL METHOD O_EXCEPTION ->IF_MESSAGE~GET_TEXT
RECEIVING
RESULT = V_MSG.
MESSAGE v_msg
TYPE 'E'.
ENDTRY.
You can capture error in v_msg.
Following are the exceptions for the same:
Catchable Exceptions
Hope that will help you.
Please reward if useful.
09-30-2013 11:27 AM
Hi Ankit,
Ask your basis person to check the authorization for the directory where you are writing the file. The directory should have 'WRITE' permission for the following user.
Hope this will solve your problem.
Regards,
Gopi.
09-30-2013 2:11 PM
Gopi,
Thanks for you Suggestion. User <SID>adm has WRITE permission and there's no user SAPService<SID> in the Unix Systems. But the problem is still there.
10-01-2013 1:37 AM
I am not sure if you have done the following debugging steps.
10-01-2013 4:58 AM
Hi @Ankit Shaw,
So you have denied 2-3 possibilities,which was given by us .
Did You check CLOSE_DATASET?
Show us your code portion.
Thanks
Gourav.
10-01-2013 8:04 AM
Hi Vikas,
Please note the following points with respect to your suggestions:
10-01-2013 8:14 AM
Hi Ankit,
Then PLease Check whether the path in which you are creating your file is being properly filled out or not. You might inadvertently be tring to create a file in some location that does not exist or you are not authorised for.
Regards,
Vamsi
10-01-2013 8:17 AM
Hi Gaurav,
It's not about my code only. I tried creating files using the standard T-Code EG3Z. There also I got the same message. I tried giving different file names(which are not already present in the directory) each time. So I think there's no relevance of the CLOSE_DATASET statement. Still, I'll give it a try.
Thanks
Ankit