Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in saving file into Application server

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

arindam_m
Active Contributor
0 Kudos

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

14 REPLIES 14

Kartik2
Contributor
0 Kudos

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

Former Member
0 Kudos

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 ..

former_member188827
Active Contributor
0 Kudos

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



mayur_priyan
Active Participant
0 Kudos

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.

arindam_m
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

Hi,

There are 3 levels of permission in UNIX:

  • Owner permissions: The owner's permissions determine what actions the owner of the file can perform on the file.
  • Group permissions: The group's permissions determine what actions a user, who is a member of the group that a file belongs to, can perform on the file.
  • Other (world) permissions: The permissions for others indicate what action all other users can perform on the file.

Check which group you belong to and if you have all the necessary permissions (Read, Write, Execute).

Cheers,

Arindam

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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 .

Former Member
0 Kudos

Don't forget to mark your post as the "correct/helpful/assumed answered" answer, so future viewers know what resolved the issue.

Former Member
0 Kudos

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.

venkateswaran_k
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.