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: 

F4_Filename Function Module not in BW?

Former Member
0 Kudos

I usually use this in a selection screen for browsing my drives to select a file, but it does not exist in BW. Anybody know a similar Function Module in BW I could use in its place that uses the same parameters?

Thank-You.

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Do you have the class CL_GUI_FRONTEND_SERVICES . There is a method. Its called FILE_OPEN_DIALOG.

report zrich_0001.

data: ifile type filetable.
data: xfile like line of ifile.
data: rc type i.

parameters: p_file type localfile.

at selection-screen on value-request for p_file.


  call method cl_gui_frontend_services=>file_open_dialog
    exporting
*     WINDOW_TITLE            =
*     DEFAULT_EXTENSION       =
*     DEFAULT_FILENAME        =
*     FILE_FILTER             =
*     WITH_ENCODING           =
      initial_directory       = 'C:'
*     MULTISELECTION          =
    changing
      file_table              = ifile
      rc                      = rc
*     USER_ACTION             =
*     FILE_ENCODING           =
    exceptions
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      others                  = 5
          .

  read table ifile into xfile index 1.
  if sy-subrc = 0.
    p_file = xfile-filename.
  endif.

Regards,

Rich Heilman

0 Kudos

try WS_FILENAME_GET

Regards,

Suresh Datti