Application Development and Automation 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: 
Read only

Validate application server file

Former Member
0 Likes
1,162

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

5 REPLIES 5
Read only

Former Member
0 Likes
884

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.

Read only

Former Member
0 Likes
884

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

Read only

Former Member
0 Likes
884

Hi,

your code is correct,

check the given file is there in application server.

use transaction AL11.

Regards

Adil

Read only

0 Likes
884

Hi,

Still I am getting the same error.

help me out

Read only

0 Likes
884

Check whether its case sensitive