F4 Help for Appl.Server and GUI Files using Class : CL_RSAN_UT_FILES
Summary
This Post narrates usage of Class CL_RSAN_UT_FILES for F4 help in selecting files from Application Server and GUI.
Author(s):
Company: Vinod Kumar T
Created on: 08.09.2010
Author(s) Bio
Vinod Kumar is an ABAP Consultant working with NIIT Technologies Limited.
Class and Methods used in the Sample Code
Class | Method | Description | |
---|---|---|---|
CL_RSAN_UTIL_FILES | F4 | To Display F4 help for files in Application/Presentation Server |
|
Parameters in Method: F4
Parameter | Input/Output | Description |
---|---|---|
I_APPLSERV | Input(Mandatory) | Pass 'X' if the file is to be selected from Application Server, |
I_TITLE | Input(Mandatory) | Popup Window Title |
I_GUI_EXTENSION | Input(Mandatory) | Default Value Space |
I_GUI_EXT_FILTER | Input(Mandatory) | Default Value Space. File Extension filter in File Selection Popup. |
I_GUI_INITIAL_DIRECTORY | Input | Initial Directory to be displayed in File Selection Popup. |
I_APPLSERV_LOGICAL | Input | Default 'X'. Enable The Option to Select logical File name from Application Server |
I_APPLSERV_AL11 | Input | Default 'X'. Enable The Option to Select physical File name from Application Server |
E_CANCELED | Output | Value 'X' if File is not selected. |
E_LOGICAL_FILE | Output | File Selected from Logical File Names |
E_AL11_CHOSEN | Output | Indicates That User Selected First to Choose from AL11 Files |
C_FILE_NAME | Output | Selected File Name |
Process flow of Method
- If Option application server is selected, user can select the Logical file name or Physical file name based on the Options available while executing the method. These options are available through the Popup with options "AL11 Files" (For Physical File Name) and "Log. File Name"(For Logical File Name).
- If the user selects the Option "AL11 Files", List of Physical Files will be displayed. After selecting the required file from the list, another Popup will be displayed for further action. This popup will have the options "Disp.Cont"(Display the contents of the selected file) and "Copy Name"(Move the selected file name for further processing). * If the user selected the Option "Log.File Name", List of logical Files will be displayed. After selecting the file name, the same can be used for further processing.
- If Option presentation server is selected, User can select the File name from the presentation server and the file name can be used for further processing.
Sample Code
Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'*&---------------------------------------------------------------------* *& Report ZVK_CL_RSAN_UT_FILES *&---------------------------------------------------------------------* *& Purpose : Use of Class CL_RSAN_UT_FILES for F4 Help for Presentation & *& Application Server Files *&---------------------------------------------------------------------* ** Text Elements * p_f4pres - Select file from GUI * p_f4appl -Select file from App.Server * p_filenm - File Name REPORT ZVK_CL_RSAN_UT_FILES. DATA : LV_APPLSERV TYPE CHAR01, LV_TITLE TYPE STRING, LV_GUI_EXTENSION TYPE STRING, LV_GUI_EXT_FILTER TYPE STRING, LV_CANCELED TYPE AS4FLAG, LV_APPLSERV_LOGICAL TYPE AS4FLAG, LV_APPLSERV_AL11 TYPE AS4FLAG, LV_LOGICAL_FILE TYPE AS4FLAG, LV_FILE_NAME TYPE STRING. SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME. PARAMETERS : P_F4PRES RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND RADIO. PARAMETERS : P_F4APPL RADIOBUTTON GROUP G1. SELECTION-SCREEN END OF BLOCK B1. SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME. PARAMETERS : P_FILENM LIKE IBIPPARMS-PATH. SELECTION-SCREEN END OF BLOCK B2. AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILENM. CLEAR : LV_CANCELED , LV_FILE_NAME, LV_LOGICAL_FILE. IF P_F4APPL EQ 'X'. MOVE 'X' TO LV_APPLSERV. MOVE 'Select File from Application Server' TO LV_TITLE. MOVE 'X' TO LV_APPLSERV_LOGICAL. MOVE 'X' TO LV_APPLSERV_AL11. ELSE. MOVE ' ' TO LV_APPLSERV. MOVE 'Select File from Presentation Server' TO LV_TITLE. MOVE ' ' TO LV_APPLSERV_LOGICAL. MOVE ' ' TO LV_APPLSERV_AL11. ENDIF. CALL METHOD CL_RSAN_UT_FILES=>F4 EXPORTING I_APPLSERV = LV_APPLSERV I_TITLE = LV_TITLE I_GUI_EXTENSION = LV_GUI_EXTENSION I_GUI_EXT_FILTER = LV_GUI_EXT_FILTER * i_gui_initial_directory = I_APPLSERV_LOGICAL = LV_APPLSERV_LOGICAL I_APPLSERV_AL11 = LV_APPLSERV_AL11 IMPORTING E_CANCELED = LV_CANCELED E_LOGICAL_FILE = LV_LOGICAL_FILE * e_al11_chosen = CHANGING C_FILE_NAME = LV_FILE_NAME EXCEPTIONS FAILED = 1 OTHERS = 2. IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ELSE. IF LV_CANCELED EQ 'X'. MESSAGE 'File Not Selected' TYPE 'I'. ELSE. IF LV_LOGICAL_FILE EQ 'X'. MESSAGE 'Logical File Name Selected' TYPE 'I'. ELSE. MESSAGE 'Physical File Name (AL11) Selected' TYPE 'I'. ENDIF. MOVE LV_FILE_NAME TO P_FILENM. ENDIF. ENDIF.
Useful Information
F4 Help for Application Server & GUI File Selection
1 Comment
Unknown User (105tyrhp3)
Very Helpfull code