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

download function module

Former Member
0 Likes
598

Hi all,

My requirement is to replace download function module with cl_gui_frontend_services=>file_save_dialog.

When i give the window title it is not getting reflected in the save dialog box.how am i to get it ?

thanks in advance.

5 REPLIES 5
Read only

Former Member
0 Likes
581

class cl_gui_frontend_services definition load.

<b>data : l_title type string value 'FILE SAVE',</b>

l_fname type string,

l_path type string,

l_fpath type string,

l_enc type abap_bool value 'X',

l_ini type string value 'C:\',

l_usr type i ,

l_dname type string . " value 'C:\abc.xls'.

data :begin of idata_tab occurs 10,

a1 type c value 'A',

b1 type c value 'B',

c1 type c value 'C',

end of idata_tab.

move p_fname to l_dname.

call method cl_gui_frontend_services=>file_save_dialog

exporting

<b>window_title = l_title</b>

default_file_name = l_dname

with_encoding = l_enc

  • INITIAL_DIRECTORY = L_INI

changing

filename = l_fname

path = l_path

fullpath = l_fpath

user_action = l_usr

exceptions

cntl_error = 1

error_no_gui = 2

not_supported_by_gui = 3 .

Read only

0 Likes
581

Hi Prashant,

I even tried executing the class directly from SE24, it is not reflecting the window title,can you please suggest me on this?

Read only

Former Member
0 Likes
581

Hello ,

I tried the method and it is getting reflected.

data : v_file type string ,
       v_file1 type string ,
       v_file2 type string ,
       v_title type string.

v_title = 'Test program'.

CALL METHOD cl_gui_frontend_services=>file_save_dialog
  EXPORTING
    WINDOW_TITLE      = v_title
*    DEFAULT_EXTENSION =
*    DEFAULT_FILE_NAME =
*    FILE_FILTER       =
*    INITIAL_DIRECTORY =
  CHANGING
    filename          = v_file
    path              = v_file1
    fullpath          = v_file2
*    USER_ACTION       =
*  EXCEPTIONS
*    CNTL_ERROR        = 1
*    ERROR_NO_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

Arun

Read only

0 Likes
581

I am still not getting,

do we have customize any thing ?

Read only

0 Likes
581

Hi ,

Could you paste your code here so that we can find the reason for it not getting displayed.

Regards

Arun