Application Development and Automation 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: 
Read only

'F4_FILENAME'. USER FILE PATH

Former Member
0 Likes
2,322

when I used the following function module for user defined file path selection

parameters: p_file like rlgrap-filename.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL FUNCTION 'F4_FILENAME'

  • EXPORTING

  • PROGRAM_NAME = SYST-CPROG

  • DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

IMPORTING

FILE_NAME = P_FILE.

I am getting the follwing Dump error.

Exception condition "NO_FIELDCATALOG_AVAILABLE" raised.

Could any one help me correcting problem ?

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,644

Try this.


report zrich_0001.

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

parameters: p_file1 type localfile default'C:test.txt'.

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       = 'C:'
*    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

5 REPLIES 5
Read only

Former Member
0 Likes
1,644

Try this.....

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

DEF_PATH = DEF_PATH " c:\

MASK = TMP_MASK "*.txt

MODE = MODE "0

TITLE = ' '

IMPORTING

FILENAME = TMP_FILENAME

EXCEPTIONS

INV_WINSYS = 01

NO_BATCH = 02

SELECTION_CANCEL = 03

SELECTION_ERROR = 04.

Thanks,

Pavan

Read only

Former Member
0 Likes
1,644

Hi,

You can use CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG

Check this link for a sample code..

Thanks,

Naren

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,645

Try this.


report zrich_0001.

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

parameters: p_file1 type localfile default'C:test.txt'.

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       = 'C:'
*    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

Read only

0 Likes
1,644

I am getting the following dump error with ur code. Kindly help me.

ShrtText

Screen: Illegal message

What happened?

The current screen processing was terminated, since a situation

occurred from which it could not continue processing.

This is probably due to an error in the current screen of the ABAP

program.

Error analysis

During "F4" processing, the program tried to send a " " message.

This is not allowed at this point in processing.

The program had to be terminated.

Read only

0 Likes
1,644

Problem solved. Thanks