on 10-09-2013 8:07 AM
Hi All,
I have a report where i am storing spool in a file named "p_file" which is stored on a network path.I am using open dataset statement for downloading the file in application server.But its not working and sy_subrc is retuning "8" instead of "0".and output is coming as "'operating system could not open file".
DATA : p_file LIKE rlgrap-filename VALUE '\\daload2\saptrans\transECCGBL'.
* downloading the file in application server
OPEN DATASET p_file FOR OUTPUT IN BINARY MODE .
IF sy-subrc = 0 .
WRITE : / 'List of Invoices excluded Due to No Accounting Document'.
LOOP AT g_it_temp INTO g_is_temp.
TRANSFER g_is_temp TO p_file .
CLEAR g_is_temp.
ENDLOOP.
CLOSE DATASET p_file.
ELSE.
WRITE : / 'operating system could not open file' .
ENDIF.
Please Help...!!
Hi,
please add the MESSAGE option to the OPEN statement:
DATA mess TYPE string.
OPEN DATASET p_file FOR OUTPUT IN BINARY MODE MESSAGE mess.
So you can get the OS message in mess.
Regards,
Klaus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Umesh,
If you have provided the correct Application Server path and still you are getting Sy-SUBRC = 8, then the file is not created. Before the data is written in file, the file needs to be created in the server path. I think you do not have write authorization in that server path.
Also you could use some catchable exceptions to check exactly why the error is coming.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Umesh,
May be your File path is wrong, check it again and correct it and the file path does not contain extenstion of file whether it is 'TXT'or 'PDF' etc.
Thanks & Regards,
Goutam Kolluru.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Umesh,
Check if the file is marked read only and you have given sufficient permissions for the fie.
Thanks,
Ajay Bose
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Umesh,
Check the file path and check whether in that path you have authorisation to place the file???
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.