‎2009 Feb 05 7:06 AM
How do we create a F4 Help on the Selection-Screen for the file-path on Application Server? If we use the FM "F4_FILENAME" , We get the Logical File names. But here we do not want the logical file names, but just the path.
We wrote the following piece of code:
DATA: gv_path_name TYPE localfile.
SUBMIT rs_get_f4_dir_from_applserv AND RETURN.
IMPORT path_name TO gv_path_name FROM MEMORY ID 'PATH_NAME_SDL'.
p_apser = gv_path_name.
where p_apser is the parameter on the selection-screen.
But using this the application server file paths in AL11 page does open but when we click on any path instead of copying the path into the selection-screen, it further goes down into the directory where we have to select a file. Then we get the pop-up saying - 'Display the contents of the file or copy the file name'...We say 'Copy Name' and then change the copied name to Whatever name we want.
Now my question is - Is it possible to copy only the path into the selection-screen immediately after selecting any path in selection-screen, instead of all the above process?
Thanks in Advance..
Edited by: Dagny on Feb 5, 2009 8:06 AM
‎2009 Feb 05 7:10 AM
Hi
U can use function module /SAPDMC/LSM_F4_SERVER_FILE for F4 help.
With Regards,
Dwaraka.S
‎2009 Feb 05 7:10 AM
Hello ,
use
fm
FILE_GET_NAME_USING_PATH
FILE_GET_NAME_AND_LOGICAL_PATH
Regards
‎2009 Feb 05 7:12 AM
Hi,
try like this...
DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*.*',
search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
file_path LIKE dxfields-longpath.
parameter p_file like rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
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.
p_file = file_path.
ENDIF.
‎2022 Jul 11 5:36 PM
‎2009 Feb 05 7:13 AM
Hi,,
You can do it,
try the given below code.
PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY,
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
* PROGRAM_NAME = SYST-CPROG
* DYNPRO_NUMBER = SYST-DYNNR
field_name = 'P_FILE'
IMPORTING
file_name = p_file
Thanks
Arun Kayal
‎2009 Feb 05 7:16 AM
Hi Dagny,
You can put f4 help for the file from the above answer,
then you have to use OPEN DATASET CLOSE DATASET statements to save your file into the application server.
Hope it helps you
Regrds
Mansi
‎2009 Feb 05 7:23 AM
Hi..
Please check the sample code below.
parameters: p_fname type localfile.
at selection-screen on value-request for p_fname.
Provide a F4 help for source file
perform sub_serverfile_f4.
form sub_serverfile_f4.
F4 help for application server file
call function '/SAPDMC/LSM_F4_SERVER_FILE'
exporting
directory = c_path
filemask = space
importing
serverfile = p_fname
exceptions
canceled_by_user = 1
others = 2.
if sy-subrc <> 0.
Message 'Unable to find filepath'.
message i000 with 'Unable to find filepath'(003).
endif.
endform. " sub_serverfile_f4
Thanks
Subhankar
‎2009 Feb 05 7:25 AM
‎2009 Feb 05 9:35 AM
Hi,
The following func module might be helpful.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
I_LOCATION_FLAG = ' '
I_SERVER = '?'
I_PATH =
FILEMASK = '.'
FILEOPERATION = 'R'
IMPORTING
O_LOCATION_FLAG =
O_SERVER =
O_PATH =
ABEND_FLAG =
EXCEPTIONS
RFC_ERROR = 1
ERROR_WITH_GUI = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Mdi.Deeba Najam.