Application Development 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: 

How to provide the F4 functionality to the files on application server

Former Member
0 Kudos

Hi,

How to provide the F4 functionality to the files on application server at selection screen.as it is F4_FILENAME for files on desktop , is there any Function module for this purpose also. I did a search in R/3 but didnt get any FM .Please advise.

Regards,

sam.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Also check this thread

4 REPLIES 4

Former Member
0 Kudos

check the FM <b>F4_DXFILENAME_4_DYNP</b>

Former Member
0 Kudos

Also check this thread

Former Member
0 Kudos

Hi,

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.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You can get to it using frontend class CL_GUI_FRONTEND_SERVICES if you know the host name and have the correct permissions, for example, this program works great for me in my system.



report zrich_0001 .

data: ifiletable type filetable.
data: xfiletable like line of ifiletable.
data: rc type i.

parameters: p_file1 type localfile default'\sapprdusr'.

at selection-screen on value-request for p_file1.

call method cl_gui_frontend_services=>file_open_dialog
   EXPORTING
*    WINDOW_TITLE            =
*    DEFAULT_EXTENSION       =
*    DEFAULT_FILENAME        =
*    FILE_FILTER             =
     INITIAL_DIRECTORY       = '\sapprdusr'
*    MULTISELECTION          =
  changing
    file_table              = ifiletable
    rc                      = rc
*    USER_ACTION             =
  EXCEPTIONS
    FILE_OPEN_DIALOG_FAILED = 1
    CNTL_ERROR              = 2
    ERROR_NO_GUI            = 3
    others                  = 4.
        .
 read table ifiletable into xfiletable index 1.
 if sy-subrc = 0.
  p_file1 = xfiletable-FILENAME.
 endif.

Regards,

Rich Heilman