Skip to Content
0
Former Member
Dec 14, 2012 at 10:20 AM

OPEN DATASET Not raising Exceptions (CX_SY_FILE_OPEN )

367 Views

Hi Experts

I've got a Method that tests the users permissions. It is basically based on the same principle as the FM PFL_CHECK_DIRECTORY.
My problem however lies with: When I call this method from a test program and stop it after the OPEN DATASET command and then have one of my
Colleagues do the same then there is no exception raised on his side to let him know that the file is already open. I've tried various ways but with no avail,
Has anybody else come across this before and how do I solve it?

Below is the ways that I have tried:

TRY .

OPEN DATASET lv_filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

CATCH cx_root.

" Handle Exception

ENDTRY.

TRY.

OPEN DATASET lv_filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

CATCH cx_sy_file_open INTO lo_err.

lv_string = lo_err-get_text( ).

" Handle Exception

ENDTRY.

OPEN DATASET lv_filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT MESSAGE lv_msg.

IF sy-subrc <> 0.

MESSAGE lv_msg TYPE 'I'.

ENDIF.

NONE of these work :-( All of them open the file from my test program, the Class Builder and my Colleagues machine and none of the
OPEN DATASET Statements Raise the cx_sy_file_open Exception...

Am I Missing something somewhere?

Any help would be appreciated.

Thanks

Vic