‎2008 Jun 10 1:09 PM
Hi,
I have a piece of code which writes the output of report to a file on application server.
I'm using OPEN DATASET with APPEND option.
for one particular path i'm getting error sy-subrc = 8.
when i try to write to file on other path, i'm able to successfully write the data to file.
please let me know , if there is any way to over come this.
Thanks,
Raghavendra
‎2008 Jun 10 1:23 PM
hi,
Sy-subrc = 8 means Internal error(Unknown reason) might be operating system couldn't open file. Check out if u have authorizations to write to the file of that path ...
Regards,
Santosh
‎2008 Jun 10 1:27 PM
use MESSAGE <msg> addition with open dataset this will give you the error message passed by operating system.
example : taken from help.sap.com
DATA: MESS(60),
FNAME(10) VALUE 'hugo.xyz'.
OPEN DATASET FNAME MESSAGE MESS.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC:', SY-SUBRC,
/ 'System Message:', MESS.
ENDIF. with this you will know whats wrong.. in my opinion that file doesnot exist.
‎2008 Jun 10 2:58 PM
Most likely its an authorization problem. Ask basis to have it fixed or chose an alternate path to write the file.
‎2008 Jun 12 6:18 AM
Hi,
I tried to capture the error message, the message states as
'Permission Denied'.
but i'm able to create folders in this path, i'm not sure why this message occurs.
If any one has come across such error, please let me know how to over come this.
Thanks and Regards,
Raghavendra
‎2008 Jun 12 6:28 AM
‎2008 Jun 12 7:17 AM
‎2008 Jun 12 7:19 AM
Hi ,
Please try to catch system exceptions when you are opening the dataset. Usually, when we use open dataset with append mode there are 2 cases possible
1. If the file exists it is opened in appending mode and system moves to the end of file.
2. If the file does not exists then the system creates it.
In your case sy-subrc is set to 8 which is surely an internal program error . The actual cause of error can be determined if you catch the system exceptions. It might be a possibility that the file you are trying to append might already be open for output.
Please try the following in your program to know the exact cause of error. ( just an example)
CATCH SYSTEM-EXCEPTIONS cx_sy_file_open = 1
open_dataset_no_authority = 2
dataset_too_many_files = 3
cx_sy_file_authority = 4.
OPEN DATASET filename FOR APPENDING IN TEXT MODE.
ENDCATCH.
Now check the sy-subrc value
If you want to handle all the possible system exceptions just go to F1 help of OPEN DATSET and check the catchable runtime system exceptions.
Please let me know if it is helpful.
‎2013 Nov 01 5:32 AM
Hi,
I'm also facing same kind of issue..
i checked all the suggested ways.. but still getting the value of SY-SUBRC is 8..
Operating system is Sun OS.. its working fine in dev and prd ..
issue is only with quality..
Kindly let me know your ideas to fix this..
Thanks,
Prakash