Reputation: 10524
I have a very strange problem.
I have a standard program with the following piece of code that tries to create a file in response to a previous attempt to open it with OPEN DATASET ... FOR INPUT IN BINARY MODE
.
CATCH SYSTEM-EXCEPTIONS dataset_too_many_files = 6
open_dataset_no_authority = 7
open_pipe_no_authority = 8
dataset_no_pipe = 9.
OPEN DATASET filename FOR OUTPUT IN BINARY MODE
MESSAGE msg.
ENDCATCH.
Suprisingly the response to that is sy-subrc = 8
which according to SAP documentation can happen only when OPEN DATASET
is used with FILTER
.
The message in msg
variable has that File could not be opened
, which is irrelevant because we are trying to create this file.
Did anybody experienced something like that? I suppose it has something to do with authority to create a file in a given directory on the operating system level but I cannot find any other log or trace to that. The error message and sy-subrc = 8
seem to be actually misleading in this case. Could more pieces of information be seen by activated tracing in ST01
?
Upvotes: 1
Views: 2733
Reputation: 10524
It turned out that the cause of the problem was in the first place the lack of the directory in which the file should be created. No wonder the system could not create the file in a non-existing folder. The error message is in such a case a misleading one anyway.
Upvotes: 1
Reputation: 11328
Open Dataset Docu: and Open datset os additions
Suprisingly the response to that is sy-subrc = 8 which according to SAP documentation can happen only when OPEN DATASET is used with FILTER.
Not exactly what the docu says. Worth another look.
Ie Would add sy-subrc = 8
on the open dataset
command means
The operating system could not open the file.
Upvotes: 0