Saturday, March 15, 2014
CL_GUI_FRONTEND_SERVICES=>FILE_EXIST Method to check whether a file exists or not. This method receives as a parameter an address and name of a particular file, and returns RESULT = 'X' if there is a file else SPACE if there is no file.
REPORT ZTEST_FRONT_END_SERVICES. data gv_result type abap_bool. *&----------------------------------------------------* * Selection-screen *&----------------------------------------------------* PARAMETERS: p_file TYPE string. *&----------------------------------------------------* * Selection-screen Validation *&----------------------------------------------------* AT SELECTION-SCREEN. CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST EXPORTING FILE = p_file RECEIVING RESULT = gv_result EXCEPTIONS CNTL_ERROR = 1 ERROR_NO_GUI = 2 WRONG_PARAMETER = 3 NOT_SUPPORTED_BY_GUI = 4 others = 5. IF SY-SUBRC <> 0. * Implement suitable error handling here else. IF gv_result is INITIAL . MESSAGE 'File is not available' TYPE 'E'. ENDIF. ENDIF.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
0 comments:
Post a Comment
Your useful comments, suggestions are appreciated.Your comments are moderated.