on 04-13-2006 6:20 PM
Hi all,
<b>OPEN DATASET p_fname FOR OUTPUT IN TEXT MODE .</b>
the contents of p_fname is :
/QR1/interfaces/msds/out/msds_out.txt
Can anyone tell me when does the bove staement returns sy-subrcd value 8.Should the file exist on the applicaton server ? I am trying to write some data into the file msds_out.txt on the application server but the fle is not there.
Regards,
Varun.
Message was edited by: varun sonu
If it is not there, it will create it. If you are getting a sy-subrc = 8, the problem is probably with the path. Make sure that you are using a valid path to the application server.
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
report zrich_0001.
* ABC here is of course the system id.
parameters: d1 type localfile default '/usr/sap/ABC/sys/Data1.txt'.
data: it001 type table of t001 with header line.
start-of-selection.
select * into table it001 from t001.
open dataset d1 for output in text mode.
loop at it001.
transfer it001 to d1.
endloop.
close dataset d1.
Regards,
RIch Heilman
SY-SUBRC = 0:
The file was opened.
SY-SUBRC = 8:
The file could not be opened.
Example
DATA:
dsn(20) TYPE C VALUE '/usr/test.dat',
rec(80) TYPE C.
OPEN DATASET dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc <> 0.
EXIT.
ENDIF.
READ DATASET dsn INTO rec.
WHILE sy-subrc <> 0.
WRITE / rec. READ DATASET dsn INTO rec.
ENDWHILE.
CLOSE DATASET dsn.
Thanks
Vikranth Khimavath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Varun,
Write like this:
OPEN DATASET P_Fname IN TEXT MODE.
Do not use FOR OUTPUT. Check if it works.
Thanks,
Sreekanth G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can execute tr.AL11 and make sure about the path ..
Thanks
Saquib
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.