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

FM for Path Validation in Application server and Presentation server??

Former Member
0 Likes
1,140

Hi All,

I want to FM name which I can use in te Path Validation in Application server and Presentation server.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

former_member508729
Active Participant
0 Likes
683

Hi Vipin,

I am not sure where you have to check the file existance on presentation and application server.

please check this FM DX_FILE_EXISTENCE_CHECK.

Regards

Ashutosh

Reward points if helpful

4 REPLIES 4
Read only

Former Member
0 Likes
683

You can use the DIRECTORY_EXIST and FILE_EXIST methods of CL_GUI_FRONTEND_SERVICES class for the prsentation server.

For App server check these,

One more for the same topic

Regards

Kathirvel

Read only

Former Member
0 Likes
683

Hi Vipin,

For presentation server use

CALL METHOD cl_gui_frontend_services=>directory_create

and for Application server use

CALL FUNCTION 'FILE_GET_NAME_USING_PATH'

reward me if it helps u,

BALU.

Read only

Former Member
0 Likes
683

HI,

To validate the Application server file..

FORM validate_app_file USING  fp_file  TYPE FILENAME-FILEINTERN.

  data : l_fname(60).

  CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
      LOGICAL_FILENAME = FP_FILE
      OPERATING_SYSTEM = SY-OPSYS
    IMPORTING
      FILE_NAME        = L_FNAME
    EXCEPTIONS
      FILE_NOT_FOUND   = 1
      OTHERS           = 2.
  IF SY-SUBRC = '0'.
    OPEN DATASET  L_FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
      MESSAGE s007 DISPLAY LIKE c_e.
    ELSE.
      CLOSE DATASET l_fname.
    ENDIF.
  ENDIF.

ENDFORM.                    " validate_app_file

Regards

Sudheer

Read only

former_member508729
Active Participant
0 Likes
684

Hi Vipin,

I am not sure where you have to check the file existance on presentation and application server.

please check this FM DX_FILE_EXISTENCE_CHECK.

Regards

Ashutosh

Reward points if helpful