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

Problem with GUI_UPLOAD

Former Member
0 Likes
1,125

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

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
1,080

<li>Use the below code exactly before you call GUI_UPLOAD function module. It serves you like popup while UPLOAD function .

DATA: 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
Thanks Venkat.O

9 REPLIES 9
Read only

Former Member
0 Likes
1,080

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,080

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

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,080

You can use FM: F4_Filename for the saem before calling gui_upload.

Read only

Former Member
0 Likes
1,080

Hi,

Give F4 help using the FM F4IF_SELECT_VALUES for that particular field to give file path.

Thanks.

Ramya.

Read only

Former Member
0 Likes
1,080

hi,

use POPUP_IMC_SEND

before GUI_upload.

hope this helps

Regards

Ritesh

Read only

0 Likes
1,080

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

Read only

venkat_o
Active Contributor
0 Likes
1,081

<li>Use the below code exactly before you call GUI_UPLOAD function module. It serves you like popup while UPLOAD function .

DATA: 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
Thanks Venkat.O

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,080

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

Read only

Former Member
0 Likes
1,080

The Problem has been Solved