2006 Mar 17 3:32 AM
Hi All,
is there any function module to provide f4 help for the user to get file name of the application server (AL11),
similar to f4_filename.
Regards,
Raghavendra
2006 Mar 17 3:35 AM
Check these FM:
F4_DXFILENAME_TOPRECURSION
TH_SELECT_SERVER
Or check this code:
PARAMETERS: f_app(128).
AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_app.
PERFORM get_fname_app.
FORM get_fname_app.
DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*.*',
search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
file_path LIKE dxfields-longpath.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
i_server = ' '
i_path = search_dir
filemask = c_fnh_mask
fileoperation = 'R'
IMPORTING
o_path = file_path
EXCEPTIONS
rfc_error = 1
OTHERS = 2.
IF sy-subrc EQ 0.
f_app = file_path.
ENDIF.
ENDFORM. "get_fname_app
Check these FM:
F4_DXFILENAME_TOPRECURSION
TH_SELECT_SERVER
Or check this code:
PARAMETERS: f_app(128).
AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_app.
PERFORM get_fname_app.
FORM get_fname_app.
DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*.*',
search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
file_path LIKE dxfields-longpath.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
i_server = ' '
i_path = search_dir
filemask = c_fnh_mask
fileoperation = 'R'
IMPORTING
o_path = file_path
EXCEPTIONS
rfc_error = 1
OTHERS = 2.
IF sy-subrc EQ 0.
f_app = file_path.
ENDIF.
ENDFORM. "get_fname_app
2006 Mar 17 3:35 AM
Check these FM:
F4_DXFILENAME_TOPRECURSION
TH_SELECT_SERVER
Or check this code:
PARAMETERS: f_app(128).
AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_app.
PERFORM get_fname_app.
FORM get_fname_app.
DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*.*',
search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
file_path LIKE dxfields-longpath.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
i_server = ' '
i_path = search_dir
filemask = c_fnh_mask
fileoperation = 'R'
IMPORTING
o_path = file_path
EXCEPTIONS
rfc_error = 1
OTHERS = 2.
IF sy-subrc EQ 0.
f_app = file_path.
ENDIF.
ENDFORM. "get_fname_app
2006 Mar 17 3:58 AM
F4_DXFILENAME_TOPRECURSION
Popup to select one file from the given application server directory (pattern allowed). (Can be used also for selecting file on presentation server: calls WS_FILENAME_GET)
Parameters: I_LOCATION_FLAG={A|P|space}; if I_LOCATION_FLAG is blank then popup to choose Appl./Present.; if I_SERVER='?' then popup to select appl.server.
regards
vinod
2006 Mar 17 4:08 AM
hi Raghav,
Use FM <b>'F4_DXFILENAME_TOPRECURSION'</b>
Thanks,
Santosh
2006 Mar 17 5:07 AM
Hi,
Here is the sample code.Kindly reward points if it helps.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = p_applfile
dyname = sy-cprog
dynumb = sy-dynnr
filetype = 'P'
location = 'A'
server = space.
2006 Mar 17 5:24 AM
Hi raghavendra ,
Here is the code for retrieving list of files contained within specific Application server directory(SAP).
PARAMETER: p_fdir type pfeflnamel DEFAULT '/usr/sap/tmp'.
data: begin of it_filedir occurs 10.
include structure salfldir.
data: end of it_filedir.
START-OF-SELECTION.
Get Current Directory Listing for OUT Dir
call function 'RZL_READ_DIR_LOCAL'
exporting
name = p_fdir
tables
file_tbl = it_filedir.
List of files are contained within table it_filedir
loop at it_filedir.
write: / it_filedir-NAME.
endloop.
Hope this will help you.
Cheers
Sunny
Rewrd points, if found helpful
2006 Mar 17 6:00 AM
Hi Raghavendra,
You can use the following code to get the F4 help for
the appliaction server file name
Data : P_FILE1 TYPE STRING
At selection screen on value request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SY-REPID
DYNPRO_NUMBER = SY-DYNNR
IMPORTING
FILE_NAME = V_FILE
.
IF SY-SUBRC <> 0.
MESSAGE I000(ZI) WITH 'TRY AGAIN'.
ELSE.
P_FILE = V_FILE.
ENDIf.
regards,
krishna
2006 Mar 17 1:48 PM
Use '/SAPDMC/LSM_F4_SERVER_FILE'. Please close the thread if answered.
2006 Mar 17 5:58 AM
data: dsn_logical like filename-fileintern.
select-options s1 for dsn_logical no-extension no intervals.
DATA: DS_PHY_NAME LIKE FILENAME-FILEEXTERN. "VWMK056015
clear ds_phy_name.
CALL FUNCTION 'FILE_GET_NAME' "VWM0K56015
EXPORTING "VWM0K56015
LOGICAL_FILENAME = s1-low "VWM0K56015
IMPORTING "VWM0K56015
FILE_NAME = DS_PHY_NAME "VWM0K56015
EXCEPTIONS "VWM0K56015
FILE_NOT_FOUND = 08. "VWM0K56015
IF NOT SY-SUBRC IS INITIAL. "VWM0K56015
MESSAGE E102(LX) WITH DSn_logical. " VWM0K56015
ENDIF. "VWM0K56015
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |