‎2008 Jun 23 3:41 PM
Hi,
I have to validate the application server file path on selection screen.
I am using following code :
form VALID_APP_FILEPATH using p_filpath TYPE FILENAME-FILEINTERN.
data : l_fname(60).
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
LOGICAL_FILENAME = p_filpath
OPERATING_SYSTEM = SY-OPSYS
IMPORTING
FILE_NAME = L_FNAME
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC ne 0.
MESSAGE 'Enter the valid file path'(e01) TYPE 'E'.
ENDIF.
endform. " VALID_APP_FILEPATH
but if i choose correct file path from F4 help also.
It displays error message.
Sy-subrc always equals 1.
Help me out
‎2008 Jun 23 3:47 PM
This FM "FILE_GET_NAME" is used get the physical file name of a logical file.You can't use it to validate the file.You have to use OPEN DATASET statement to validate the file from application server.
‎2008 Jun 23 3:48 PM
Hi,
I have implemented the code mentioned by you and am not having any problems even when I use F4 to get the fle name.
Pls recheck and get back if the error persists.
Reward if found helpful.
Warm Regards,
R Adarsh
‎2008 Jun 23 3:48 PM
Hi,
your code is correct,
check the given file is there in application server.
use transaction AL11.
Regards
Adil
‎2008 Jun 24 6:39 AM
‎2008 Jun 24 7:25 AM