Skip to Content
0
Former Member
Nov 20, 2012 at 06:52 AM

Check directory_exist

230 Views

Hi experts,

I'm doing directory path validation using below code.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST

EXPORTING

DIRECTORY = L_DIRECTORY

RECEIVING

RESULT = L_STRING

EXCEPTIONS

CNTL_ERROR = 1

ERROR_NO_GUI = 2

WRONG_PARAMETER = 3

NOT_SUPPORTED_BY_GUI = 4

OTHERS = 5.

IF L_STRING = SPACE.

MESSAGE 'invalid directory' type 'E'.

ENDIF.

In above i'm getting L_STRING value SPACE instead of 'X' and sy-subrc = 1. But i'm giving valid directory.

when i debugging i'm getting error in the below code.

CALL METHOD CL_GUI_CFW=>FLUSH

EXCEPTIONS

CNTL_SYSTEM_ERROR = 1

CNTL_ERROR = 2

others = 3 .

IF SY-SUBRC <> 0. " here i'm getting sy-subrc =2.

RAISE CNTL_ERROR.

ENDIF.

It's working in othere systems except mine. can't able to get the issue. Help me....!

<<offer for points removed>>

Regards,

BALAJI.

Message was edited by: Kesavadas Thekkillath