Application Development and Automation 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: 
Read only

Open dataset problem

Former Member
0 Likes
1,010

Dear all,

I tried to trasfer the contents to the path specified,but here sy-subrc = 8,ie.file could not be opened,but this works in testing and quality,but in production it produces this error,

my code is:

clear : dsn.

concatenate path 'ixxx.txt' into dsn.

open dataset dsn for output in text mode encoding non-unicode ignoring

conversion errors.

if sy-subrc = 0.

loop at itab.

transfer itab to dsn.

endloop.

endif.

close dataset dsn.

Can anyone provide a solution.

Thanks and regards,

Latha prabhu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
966

Hi,

Check whether directory path mentioned in your code is maintained in production system, you can view the directorieds from AL11 transation, you can also go to FILE transaction and check the physical path/logical path maintained in the system.

Hope this helps,

Rgds,

7 REPLIES 7
Read only

Former Member
0 Likes
966

hi,

There might be probelm with access to the particular file.

that particular file/folder don't have write access.

please check access for the file

cheers,

sasi

Read only

Former Member
0 Likes
966

Hi,

Since it works well in Quality Server your program is doing is right.When it comes to production you may not have access rights to partcular path( drive names,....).

Please locate the exact path you have access to and then run this code and it should work.

Please reward points if you find this explanation useful.

Read only

Former Member
0 Likes
966

check with basis if u have the permission to write a file on the production server....that could be the only reason if u have tested successfully in quality

rgds,

PJ

Read only

Former Member
0 Likes
966
  • Download internal table to Application server file(Unix)

DATA: e_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.      

  open dataset e_file for output in text mode.
  lOOP AT it_datatab......
    transfer it_datatab to e_file.
  ENDLOOP.
 
  close dataset e_file.

Check this link

http://www.sapdevelopment.co.uk/file/file_updown.htm

Read only

Former Member
0 Likes
967

Hi,

Check whether directory path mentioned in your code is maintained in production system, you can view the directorieds from AL11 transation, you can also go to FILE transaction and check the physical path/logical path maintained in the system.

Hope this helps,

Rgds,

Read only

Former Member
0 Likes
966

Hi,

With continuation to my above explanation please check the function module <b>AUTHORITY_CHECK_DATASET</b>.

Also the filename you give depends on the OS.To make the programs portable to different OS use the Function module <b>FILE_GET_NAME.</b>

It checks file authorization.You can find its

explanation from the FM's documentation.

Please reward points if you find this explanation useful.

Read only

0 Likes
966

Dear All,

Thank u very much for these quick and responses which solved my problem.I have given some points to all the persons who have helped to solve this problem.Problem solved.

Thanks and Regards,

Latha Prabhu.