08-04-2008 10:10 AM
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
09-23-2008 10:35 AM
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.
09-22-2008 7:52 AM
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.
09-23-2008 10:35 AM
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.
02-16-2009 12:20 PM
Hi mohd,
cool.
if you are facing problem with the class, try to use GUI_*.
any way before using gui_*,
use file_*_dialog.