Skip to Content
0
Former Member
Aug 02, 2006 at 07:52 PM

File path Validation

72 Views

validation of file path

Posted: Aug 2, 2006 2:42 PM Reply E-mail this post

OPEN DATASET g_filepath IN TEXT MODE FOR INPUT

MESSAGE g_msg.

IF sy-subrc = 0.

MESSAGE e001 WITH 'File Already Exist' g_msg .

CLOSE DATASET g_filepath.

leave Program.

ELSE .

CLOSE DATASET g_filepath.

ENDIF.

here when control goes to ELSE. then may be file doesnot exist or Invalid File Path.

if File doesnot exist then OK . (I have to write data into it)

what to do when Invalid File Path ( eg /temp/gtc\abc.txt). here \ wrongly given.

so how o handle such wrong inputs.

Plz reply