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: 

cl_gui_frontend_services=>file_save_dialog?

Former Member
0 Kudos

Hi All,

Im trying to use the below method, what are all the parameters need to fill and hw to declare those parameters.

CALL METHOD cl_gui_frontend_services=>file_save_dialog

  • EXPORTING

  • WINDOW_TITLE =

  • DEFAULT_EXTENSION =

  • DEFAULT_FILE_NAME =

  • FILE_FILTER =

  • INITIAL_DIRECTORY =

  • WITH_ENCODING =

  • PROMPT_ON_OVERWRITE = 'X'

CHANGING

filename =

path =

fullpath =

  • USER_ACTION =

  • FILE_ENCODING =

  • EXCEPTIONS

  • CNTL_ERROR = 1

  • ERROR_NO_GUI = 2

  • NOT_SUPPORTED_BY_GUI = 3

  • others = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Puppy.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
data:
    lws_filename     type string,    
    lws_filepath     type string,
    lws_tot_filename type string.

  call method
    cl_gui_frontend_services=>file_save_dialog
   EXPORTING
      WINDOW_TITLE = 'TITLE'
    changing
      filename             = lws_filename
      path                 = lws_filepath
      fullpath             = lws_tot_filename
    exceptions
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      others               = 4.

  if sy-subrc ne 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.

Regards,

Gurpreet

4 REPLIES 4

Former Member
0 Kudos

Hi,

What is your requirement.

In my case i had to replace obsolete FM Download with new FM GUI_DOWNLOAD.

So i used this file_save_dialog method.

CALL METHOD cl_gui_frontend_services=>file_save_dialog

EXPORTING

default_file_name = l_p_out1_new

CHANGING

filename = l_filename

path = l_path

fullpath = l_fullpath.

IF sy-subrc <> 0.

ENDIF.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = l_fullpath

filetype = 'ASC'

append = 'X'

TABLES

data_tab = t_output

EXCEPTIONS

OTHERS = 1.

Hope this helps.

Former Member
0 Kudos

CALL METHOD cl_gui_frontend_services=>file_save_dialog

CHANGING

filename = file_name

path = file_path

fullpath = full_path

user_action = act

EXCEPTIONS

cntl_error = 1

error_no_gui = 2

OTHERS = 3

Former Member
0 Kudos
data:
    lws_filename     type string,    
    lws_filepath     type string,
    lws_tot_filename type string.

  call method
    cl_gui_frontend_services=>file_save_dialog
   EXPORTING
      WINDOW_TITLE = 'TITLE'
    changing
      filename             = lws_filename
      path                 = lws_filepath
      fullpath             = lws_tot_filename
    exceptions
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      others               = 4.

  if sy-subrc ne 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.

Regards,

Gurpreet

Former Member
0 Kudos

Hi ,

copy this code and try this , after executing this code ypu will get the path into " lv_fullpath " .

and then pass this lv_fullpath to next function module like gui_download .


  DATA:   v_name  TYPE string,
          v_file  TYPE rlgrap-filename,
          lv_filename    TYPE string,
          lv_filen       TYPE string,
          lv_path        TYPE string,
          lv_fullpath    TYPE string.

*  MOVE v_name TO lv_filename.

  CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
*     WINDOW_TITLE         =
*     DEFAULT_EXTENSION    =
*    default_file_name    = lv_filename
*     WITH_ENCODING        =
*     FILE_FILTER          =
*     INITIAL_DIRECTORY    =
*     PROMPT_ON_OVERWRITE  = 'X'
    CHANGING
      filename             = lv_filen
      path                 = lv_path
      fullpath             = lv_fullpath
*     USER_ACTION          =
*     FILE_ENCODING        =
    EXCEPTIONS
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      OTHERS               = 4
          .

  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,

Aby.