‎2009 Sep 22 3:50 AM
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?
‎2009 Sep 22 3:57 AM
‎2009 Sep 22 3:57 AM
‎2009 Sep 22 4:00 AM
‎2009 Sep 22 4:09 AM
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...
‎2009 Sep 22 4:12 AM
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.
‎2009 Sep 22 4:16 AM
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?
‎2009 Sep 22 4:17 AM
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.
‎2009 Sep 22 4:17 AM
How have you declared te variable for stroing filename?? using String??
If yes, change the datatype to cffile-filename
‎2009 Sep 22 4:28 AM
Hi J@Y,
I used your FM but its not giving me exceptions. I just tried in SE37.
‎2009 Sep 22 4:44 AM
Hi,
Try this way to handle exceptions and gives what exactly the message is
Thanks
Venkat.OREPORT 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.