Application Development 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: 

FM to validate file path on app server

Former Member
0 Kudos

Hi,

Is there any FM which can be used to validate a File path on the App. Server.

Thanks

A

3 REPLIES 3

Former Member
0 Kudos

hi,

You can give directly a F4 Help to the file on the application server..

FM is F4_DXFILENAME_TOPRECURSION

Regards,

Sailaja.

Former Member
0 Kudos

CALL FUNCTION 'FILE_GET_NAME_USING_PATH'

EXPORTING

CLIENT = SY-MANDT

LOGICAL_PATH = P_LPATH "logical path

OPERATING_SYSTEM = SY-OPSYS

FILE_NAME = 'XXX' "file name

IMPORTING

FILE_NAME_WITH_PATH = LV_FILE

EXCEPTIONS

PATH_NOT_FOUND = 1

MISSING_PARAMETER = 2

OPERATING_SYSTEM_NOT_FOUND = 3

FILE_SYSTEM_NOT_FOUND = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

*--error.

endif.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You could simply try opening it. If sy-subrc <> 0, then you know that the path/filename is not found.

open dataset d1........
if sy-subrc <> 0.
write:/ 'File path not found'.
endif.

Regards,

Rich Heilman