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

Cannot open application server file even if it exists...

aris_hidalgo
Contributor
2,823

Hello Experts,

I cannot open a file residing in one of the directories in the application server

using command OPEN DATASET. The file is there but OPEN DATASET gives me a value of 8

in SY-SUBRC. Any solutions for this?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,075

Do you have authorizations?

Thanks,

Kiran

9 REPLIES 9
Read only

Former Member
0 Likes
2,076

Do you have authorizations?

Thanks,

Kiran

Read only

0 Likes
2,075

Hi Kiran,

How do I check?

Thank you!

Read only

0 Likes
2,075

the path u mention is case sensitive... even the .txt or .dat is case sensitive...

to check the autho.. use CG3Y and CG3Z tr. to move to app to pres server and pres to app server...

Read only

0 Likes
2,075

Hi J@Y,

What I did was to use FM F4_DXFILENAME_TOPRECURSION then get the path and use it in OPEN DATASET. The file is existent when I checked using AL11. The cases is as is.

Read only

0 Likes
2,075

Hi,

I used CG3Y to read the file but it says "permission denied". Can I change my authorization to read this file or do I need the help of basis?

Read only

0 Likes
2,075

ok .. basis need to give u the permission.

Before opening dataset check file authority with FM AUTHORITY_CHECK_DATASET

CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
      EXPORTING
        activity         = 'WRITE'
        filename         = filename
      EXCEPTIONS
        no_authority     = 1
        activity_unknown = 2
        OTHERS           = 3.

Read only

0 Likes
2,075

How have you declared te variable for stroing filename?? using String??

If yes, change the datatype to cffile-filename

Read only

0 Likes
2,075

Hi J@Y,

I used your FM but its not giving me exceptions. I just tried in SE37.

Read only

0 Likes
2,075

Hi, Try this way to handle exceptions and gives what exactly the message is

REPORT  ZVENKAT_ALV_LIST.
PARAMETERS P_FILE(120) TYPE C.
DATA:OREF   TYPE REF TO CX_ROOT,
     TEXT   TYPE STRING.

TRY.
    OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*    IF SY-SUBRC NE 0.
  CATCH CX_SY_ARITHMETIC_ERROR INTO OREF.
    TEXT = OREF->GET_TEXT( ).
  CATCH CX_ROOT INTO OREF.
    TEXT = OREF->GET_TEXT( ).
*    ENDIF.

ENDTRY.
CLOSE DATASET P_FILE.
IF NOT TEXT IS INITIAL.
  WRITE / TEXT.
ENDIF.
Thanks Venkat.O