‎2010 Feb 22 9:13 AM
Hi Experts,
Can any one help me with this issue.
We are converting our programs to UNICODE during the conversion we changed the Function module "UPLOAD" to
" GUI_UPLOAD" here the problem Previously we used to get a POP for Inputing the FILE but now we are missing the POP up
Can any one kindly suggest me to get that POP UP with this GUI_UPLOAD.
Thanks & Regards
‎2010 Feb 22 9:46 AM
<li>Use the below code exactly before you call GUI_UPLOAD function module. It serves you like popup while UPLOAD function .
Thanks
Venkat.ODATA: wa_pfile TYPE file_table.
DATA: it_file_table TYPE STANDARD TABLE OF file_table,
count TYPE i,
dir TYPE string VALUE 'C:\temp\'.
DATA:file TYPE string.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Get file'
default_extension = '*.*'
CHANGING
file_table = it_file_table
rc = count.
LOOP AT it_file_table INTO wa_pfile.
WRITE wa_pfile-filename.
file = wa_pfile-filename.
ENDLOOP.
"Pass FILE to GUI_IUPLOAD function module
‎2010 Feb 22 9:18 AM
HI,
THE POP UP for selecting the file use METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG.
get the file path and pass that file path to GUI_UPLOAD.
regards,
sakshi
‎2010 Feb 22 9:19 AM
Before the call of the GUI_UPLOAD FM you have to call the method CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG or call the FM GUI_FILE_SAVE_DIALOG.
Further details on usage can be found on SDN.
BR,
Suhas
‎2010 Feb 22 9:19 AM
You can use FM: F4_Filename for the saem before calling gui_upload.
‎2010 Feb 22 9:22 AM
Hi,
Give F4 help using the FM F4IF_SELECT_VALUES for that particular field to give file path.
Thanks.
Ramya.
‎2010 Feb 22 9:23 AM
hi,
use POPUP_IMC_SEND
before GUI_upload.
hope this helps
Regards
Ritesh
‎2010 Feb 22 9:41 AM
hi,
Instead of a pop up u can use a Selection screen input parameter for accepting the file name and can send the same file as an input to the FM - GUI_UPLOAD.
If this serves ur purpose , this will be simple and complete.
Thanks,
Sindhuja
‎2010 Feb 22 9:46 AM
<li>Use the below code exactly before you call GUI_UPLOAD function module. It serves you like popup while UPLOAD function .
Thanks
Venkat.ODATA: wa_pfile TYPE file_table.
DATA: it_file_table TYPE STANDARD TABLE OF file_table,
count TYPE i,
dir TYPE string VALUE 'C:\temp\'.
DATA:file TYPE string.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Get file'
default_extension = '*.*'
CHANGING
file_table = it_file_table
rc = count.
LOOP AT it_file_table INTO wa_pfile.
WRITE wa_pfile-filename.
file = wa_pfile-filename.
ENDLOOP.
"Pass FILE to GUI_IUPLOAD function module
‎2010 Feb 22 9:47 AM
Hi,
Refer the code snippet:-
DATA: lv_filename TYPE string,
lv_path TYPE string,
lv_fullpath TYPE string.
CONSTANTS : lc_txt TYPE string VALUE 'TXT'.
CLEAR : lv_filename, lv_path,
lv_fullpath.
*~~Get fullpath to download the file
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
default_extension = lc_txt "<--for default as TXT files
prompt_on_overwrite = 'X'
CHANGING
filename = lv_filename
path = lv_path
fullpath = lv_fullpath
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.
" and call to download the file on given path
CALL METHOD cl_gui_frontend_services=>gui_download
Hope this helps you.
Regards,
Tarun
‎2010 Feb 22 1:45 PM