07-17-2013 3:14 PM
Hi Expert,
i am tring to save file into the application server using open data set statment.
OPEN DATASET W_FILENAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT .
using this i am successfully able to save file into one directory of the application server .
but in the other directory (Which is newly created ) , i am not able to save file it is giving me Sy-Subrc = 8 .
what could be possible reason for not saving file into new path in application server.
how can i overcome from this issue.
07-18-2013 12:39 AM
Hi,
Looks like a authorization issue. get in touch with any BASIS guy. Or use FTP tools to see and change access privileges of the folder.
Cheers,
Arindam
07-17-2013 3:29 PM
Hi,
Please check the following
1. Directory names are case sensitive in certain operating systems, please check that you have given the directory name as it appears in AL11 transaction.
2. Please check with your basis/security team if you have authorization to write files in the newly created directory.
Regards,
Kartik
07-17-2013 3:46 PM
Hi Kartik,
Thanks for the reply .
1. i checked the file for the case sensitive . i wrote it correctly.
2. To check Authorization first i use FM
CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
EXPORTING
* PROGRAM =
ACTIVITY = SABC_ACT_WRITE
FILENAME = w_file_tem
EXCEPTIONS
NO_AUTHORITY = 1
ACTIVITY_UNKNOWN = 2
OTHERS = 3
and i m getting Sy-subrc = 0. its mean i have authorization to write file in application server.
i think there could other reason for it ..
07-17-2013 4:08 PM
using addition MESSAGE to check message.
DATA: MESS(60),
OPEN DATASET W_FILENAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT MESSAGE MESS.
if sy-subrc ne 0.
WRITE: 'SY-SUBRC:', SY-SUBRC,
/ 'System Message:', MESS.
endif.
Regards
07-17-2013 5:21 PM
Hi,
OPEN DATASET statements usually fails when the Directory Path is not maintained correctly ( check directory name, path and slash '/' ) or when then the person is not Authorized to access the Directory.
07-18-2013 12:39 AM
Hi,
Looks like a authorization issue. get in touch with any BASIS guy. Or use FTP tools to see and change access privileges of the folder.
Cheers,
Arindam
07-18-2013 1:07 AM
Hi Mohit,
Normally you (or basis team) need to create the directory & sub-directory on the OS-level first and have a read+write permission on it, only then you can start writing to it using open dataset statement.
Regards,
Andre.
07-18-2013 1:27 AM
Hi,
There are 3 levels of permission in UNIX:
Check which group you belong to and if you have all the necessary permissions (Read, Write, Execute).
Cheers,
Arindam
07-18-2013 2:00 AM
Hi Arindam,
Yes I'm aware of this fact, but if you want to "write/put" a file into OS-level from ABAP, usually this is done via "sidadm" user. That's why they are using the "existing" directory (e.g. /sapmnt), and then create a sub-directory for this purpose. So the Basis people knows already which authorisation will be needed, I only mentioned to Mohit that this sub-directory need to be created first.
Cheers,
Andre
07-18-2013 3:02 AM
Hi,
I think OPEN DATASET.. FOR OUTPUT will create the directory and file in case they don't exist, if such privileges are given to the user.
So yes if basis creates folders and file it ok, but OPEN DATASET.. FOR OUTPUT will also do the same if privileges are given.
Cheers,
Arindam
07-18-2013 6:24 AM
Hi Mohit,
when you use open dataset so your file wil be genrated on apllicaition server which is your main server . I also same faceing problem befor some days for that i hv made to program.
1 Main program which is open data set.
2 BDC.
thrught help of bdc i move file from application server to local drive.
create one bdc on Tc : CG3Y and move your file to your local drive .
07-18-2013 2:45 PM
Don't forget to mark your post as the "correct/helpful/assumed answered" answer, so future viewers know what resolved the issue.
07-18-2013 3:13 PM
Hi All ,
Thanks For your valuable reply .
I asked Basis People about my concern . They are checking at their end once i get solve this i will marked it correct/helpful/Assumbed answer and defianlty i will let all of you know about the Status.
07-20-2013 8:49 PM
Dear Mohit
Go to the Directory
Right Click
Click Properties
Select Shared Tab --> check whether the folder is shared one or not? It should be shared
Select Security Tab --> Check whether the SAP User Id is allowed to create file in the folder ie.
Read / Write privilege
Regards,
Venkat
07-23-2013 9:33 AM
Hi All ,
Thank you so much for your answer.
issue was because of read / write authorization not given in the path so Basis team has resolved this.