‎2008 Nov 12 3:05 PM
Hi ,
i want to read file from server and after the read i get sy-subrc = 8.
what can be the problem ?
here is my code.
DATA:
dsn(500) VALUE '\\ivp08.tlv.sap.corp\DEV_P_Development\EP 6Program Office\r1.txt'.
CLEAR itab. REFRESH itab.
* Read the data.
OPEN DATASET dsn FOR INPUT IN BINARY MODE.
DO.
READ DATASET dsn INTO str.
IF sy-subrc = 0.
APPEND itab.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET dsn.Regards
‎2008 Nov 12 3:10 PM
although you not put the dump information about the error.But it seems you are not authorized to read this file.check the authorization you have, with basis.
‎2008 Nov 12 3:10 PM
although you not put the dump information about the error.But it seems you are not authorized to read this file.check the authorization you have, with basis.
‎2008 Nov 12 4:37 PM
HI Amit,
i try to Access the file (copy paste from the code ) from strart-> run and the file is opened,
what can be the problem ?
Regards
‎2008 Nov 12 4:48 PM
i try to Access the file (copy paste from the code ) from strart-> run and the file is opened,
start > run is the file not in App server? your code for open dataset and all works for file in application server (AL11) only.. if you have file on another FTP server then you need FTP_connect and other FM's.
‎2008 Nov 12 3:10 PM
check the case upper case and lower case... it would be issues generally on the .TXT and .txt both are diff
copy paste the name as it appears on the server address or in AL11.
Translate dsn to Lower case might help
from sap HElp: If the system was able to read data successfully, SY-SUBRC is set to 0. When the end of the file is reached, SY-SUBRC is set to 4. If the file could not be opened, SY-SUBRC is set to 8.
‎2008 Nov 12 4:40 PM
Hi J@Y ,
i try to translate like u write and it's not help ,
maybe u have other idea?
Regards
‎2008 Nov 12 3:11 PM
Hi,
SY-SUBRC = 8 means that .. the file could not be opened.
Check whether the file is present in the server.
It is always safe to have a SY-SUBRC = 0 check after open dataset to avoid... dumps..
open dataset dsn.
if sy-subrc = 0.
...."process
close dataset dsn.
else.
"Throw error message thru coding
Regards
‎2008 Nov 12 3:12 PM
Are you sure that path in dsn points to a file on the app server? Is the name 100% correct?
Also, you read into str, but append itab, this will not work.
Thomas
‎2008 Nov 12 3:17 PM
Hi,
I am sure that if you check the sy-subrc after the OPEN DATASET, you will get a value 8, meaning that the file could not be opened. If you catch the exception you will see why it could not be opened. Read the documentation of OPEN DATASET for exception handling.
Regards,
Juan
‎2008 Nov 12 3:26 PM
HI SY-SUBRC 8..
then it should be some thing to do with the DSN make sure you are using the same case.. the path DSN is case sensitive.... check in tr. AL11 how are the paths defined.. and get the DSN exactly the same.
If this didnt help then try opening the file using tcode cg3y . if not then might be an authorization issue .
‎2008 Nov 12 3:33 PM
Hi,
can you send me the dump analysis screen shot.
if the error is different than the above ones.