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: 

Download function module is obsolute

Former Member
0 Kudos

How to handle importing parameters of Download Function module in unicode conversion.

If i am converting my SAP from Non unicode to unicode environment how should i handle the importing parameters od download Function module in Cl_gui_frontend_services=> gui_download because there is only one importing paramter in that , where as in download function module i have 3 importing parameters

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Please see the below code .

Function module u2018DOWNLOADu2019

CALL FUNCTION 'DOWNLOAD'

EXPORTING

filename = p_file

filetype = 'WK1'

TABLES

data_tab = i_table.

..

would be replaced with:

data: gd_file type string.

DATA: ld_filename TYPE string,

ld_path TYPE string,

ld_fullpath TYPE string,

ld_result TYPE i.

types: t_uctable like line of i_table.

data: it_uctable type standard table of t_uctable.

gd_file = p_file.

shift gd_file RIGHT DELETING TRAILING '\'.

shift gd_file RIGHT DELETING TRAILING '/'.

shift gd_file left DELETING LEADING space.

CALL METHOD cl_gui_frontend_services=>file_save_dialog

EXPORTING

DEFAULT_EXTENSION = 'WK1'

default_file_name = gd_file

INITIAL_DIRECTORY = gd_file

CHANGING

filename = ld_filename

path = ld_path

fullpath = ld_fullpath

user_action = ld_result.

check ld_result eq 0.

gd_file = ld_fullpath.

gd_file = p_file.

it_uctable[] = i_table[].

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = gd_file

filetype = 'ASC' " DAT,WK1

Append = ' ' "if mode = A then this would be X

CHANGING

data_tab = it_uctable

EXCEPTIONS

OTHERS = 1.

3 REPLIES 3

Former Member
0 Kudos

Before your call to class CL_GUI_FRONTEND_SERVICES -> GUI_DOWNLOAD, the following additional code is required:

DATA: ld_filename TYPE string,

ld_path TYPE string,

ld_fullpath TYPE string,

ld_result TYPE i.

CALL METHOD cl_gui_frontend_services=>file_save_dialog

EXPORTING

default_file_name = str_filename

initial_directory = str_filename

CHANGING

filename = ld_filename

path = ld_path

fullpath = ld_fullpath

user_action = ld_result.

CHECK ld_result EQ '0'.

The filename exported to GUI_DOWNLOAD must be changed to ld_fullpath.

Former Member
0 Kudos

Hi,

Please see the below code .

Function module u2018DOWNLOADu2019

CALL FUNCTION 'DOWNLOAD'

EXPORTING

filename = p_file

filetype = 'WK1'

TABLES

data_tab = i_table.

..

would be replaced with:

data: gd_file type string.

DATA: ld_filename TYPE string,

ld_path TYPE string,

ld_fullpath TYPE string,

ld_result TYPE i.

types: t_uctable like line of i_table.

data: it_uctable type standard table of t_uctable.

gd_file = p_file.

shift gd_file RIGHT DELETING TRAILING '\'.

shift gd_file RIGHT DELETING TRAILING '/'.

shift gd_file left DELETING LEADING space.

CALL METHOD cl_gui_frontend_services=>file_save_dialog

EXPORTING

DEFAULT_EXTENSION = 'WK1'

default_file_name = gd_file

INITIAL_DIRECTORY = gd_file

CHANGING

filename = ld_filename

path = ld_path

fullpath = ld_fullpath

user_action = ld_result.

check ld_result eq 0.

gd_file = ld_fullpath.

gd_file = p_file.

it_uctable[] = i_table[].

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = gd_file

filetype = 'ASC' " DAT,WK1

Append = ' ' "if mode = A then this would be X

CHANGING

data_tab = it_uctable

EXCEPTIONS

OTHERS = 1.

Former Member
0 Kudos

Hi mohd,

cool.

if you are facing problem with the class, try to use GUI_*.

any way before using gui_*,

use file_*_dialog.