Skip to Content
0
Former Member
Jun 27, 2008 at 04:31 AM

Application server file path vaidation

974 Views

I have written the code for application server file path validation.

DATA : l_fname TYPE filename-fileintern." type c.

DATA : l_filpath TYPE filename-fileintern,

l_filname(40) TYPE c.

PARAMETER : p_sucfil LIKE rfpdo-rfbifile OBLIGATORY. " rlgrap-filename

AT SELECTION-SCREEN ON p_sucfil.

l_fname = p_sucfil.

CALL FUNCTION 'FILE_GET_NAME'

EXPORTING

  • CLIENT = SY-MANDT

logical_filename = l_fname

OPERATING_SYSTEM = SY-OPSYS

  • PARAMETER_1 = ' '

  • PARAMETER_2 = ' '

  • PARAMETER_3 = ' '

  • USE_PRESENTATION_SERVER = ' '

WITH_FILE_EXTENSION = 'X'

  • USE_BUFFER = ' '

  • ELEMINATE_BLANKS = 'X'

IMPORTING

  • EMERGENCY_FLAG =

  • FILE_FORMAT =

FILE_NAME = l_filpath

EXCEPTIONS

FILE_NOT_FOUND = 1

OTHERS = 2

.

IF sy-subrc <> 0.

message 'Invalid file name' type 'E'.

ENDIF.

But always i will get Invalid file name.

Y is it so.

pls help me.