CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG

Hi Experts,
I have a customized program with BDC. first My program will convert a .dbf file into .xls file. My second program executes the .xls file.
The .xls file that I get from my first program will be transferred into a textbox in my second program.
But my second program is using CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG to execute a command. If you just enter the directory/path in the textbox it wont execute but if you use f4 the program will successfully be executed.
I have put my method in AT SELECTION-SCREEN. so that when I use the bdc it will automatically read the path BUT the dialogbox still appear.
How can I make the dialog box disappear but still it will execute the method ?
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    exporting
      default_filename        = cv_fname "'C:\USERS\Asd\DESKTOP\RATRA.XLS'
    CHANGING
      FILE_TABLE              = t_files
      RC                      = v_rcode
    EXCEPTIONS
         file_open_dialog_failed = 1
         cntl_error              = 2
         error_no_gui            = 3
         OTHERS                  = 4.

Hi Jepoy,
You can set the result of the save button which is action_ok in a variable. So when u execute the same code again, just pass this below method call.
IF lv_result = cl_gui_frontend_services=>action_OK.
         RETURN.
       ENDIF.
Regards,
Sivaganesh

Similar Messages

  • Error when using the method cl_gui_frontend_services= file_open_dialog

    Hello Experts,
    I am currently practicing BDC and I think the first step is to locate where my text file is. Now based on my code below, after selecting my text file nothing happens.
    Also, what will be my next after getting the file from a specific location? Thanks guys!
    REPORT  z_aris_practice_bdc_0
            NO STANDARD PAGE HEADING
            LINE-SIZE 255
            LINE-COUNT 64
            MESSAGE-ID zz.
    *BDC Data
    DATA: BEGIN OF bdc_tab OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdc_tab.
    *Internal Table
    DATA: BEGIN OF it_input OCCURS 0,
             user     TYPE usr02-bname,
             title    TYPE sza5_d0700-title_medi,
             lname    TYPE addr3_data-name_last,
             fname    TYPE addr3_data-name_first,
             initials TYPE addr3_data-initials,
             nickname TYPE addr3_data-nickname,
             function TYPE addr3_data-function,
          END OF it_input.
    DATA: gt_lines TYPE sy-tabix,
          gt_file  TYPE filetable,
          wa_file  TYPE filetable,
          gt_subrc TYPE i.
    *CONSTANTS
    CONSTANTS: c_mask(60) TYPE c  VALUE ',..'.
    *Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_input LIKE rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_input.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
       WINDOW_TITLE            =
       DEFAULT_EXTENSION       =
       DEFAULT_FILENAME        =
       FILE_FILTER             =
          initial_directory       = 'C:\Temp\'
          multiselection          = 'X'
        CHANGING
          file_table              = gt_file[]
          rc                      = gt_subrc
       USER_ACTION             =
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_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.
    *START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM put_in_itab.
      PERFORM process_records.
    *&      Form  get_files
          text
    FORM put_in_itab.
      DATA: lv_file TYPE string.
      lv_file = p_input.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = lv_file
        FILETYPE                      = 'ASC'
         has_field_separator           = 'X'
        HEADER_LENGTH                 = 0
        READ_BY_LINE                  = 'X'
        DAT_MODE                      = ' '
        CODEPAGE                      = ' '
        IGNORE_CERR                   = ABAP_TRUE
        REPLACEMENT                   = '#'
        CHECK_BOM                     = ' '
        VIRUS_SCAN_PROFILE            =
        NO_AUTH_CHECK                 = ' '
      IMPORTING
        FILELENGTH                    =
        HEADER                        =
        TABLES
          data_tab                      = it_input
       EXCEPTIONS
         file_open_error               = 1
         file_read_error               = 2
         no_batch                      = 3
         gui_refuse_filetransfer       = 4
         invalid_type                  = 5
         no_authority                  = 6
         unknown_error                 = 7
         bad_data_format               = 8
         header_not_allowed            = 9
         separator_not_allowed         = 10
         header_too_long               = 11
         unknown_dp_error              = 12
         access_denied                 = 13
         dp_out_of_memory              = 14
         disk_full                     = 15
         dp_timeout                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        DESCRIBE TABLE it_input LINES gt_lines.
      ENDIF.
    ENDFORM.                    "get_files
    *&      Form  process_records
          text
    FORM process_records.
      LOOP AT it_input.
      ENDLOOP.
    ENDFORM.                    "process_records

    Hii viraylab,
    go throgh this link..This sample code solves ur problem....
    /people/milind.upasani/blog/2007/03/07/step-by-step-approach-to-ceate-simple-bdc-session-program-using-reusable-template
        U are new to BDC it seems...
        first u read the sap help ... then u will come know what to do after wards....
        http://help.sap.com/saphelp_47x200/helpdata/en/fa/097720543b11d1898e0000e8322d00/frameset.htm
    Be familiar with the structure BDCDATA.
    <b>Data transfers</b>  In this page..
    Next u need to know about the <b>transaction RECORDER the tcode is SHDB.</b>
    Nothing is difficult in this ..
    For example When u r creating a data element in SE11 u go through some screens in a flow, by clicking some pushbuttons and by generating some function codes manually, and entering values manually...
    But here u wont do it manually, these values will be populated from file into an internal table...
    Before calling a transaction into which u r going to populate the data is to be filled into a table with structure <b>BDCDATA.</b>
    <b>U need to use CALL TRANSACTION 'SE11' using BDCDATA or
    the session method..</b>
    Reward points for helpful answers...
    sai ramesh

  • Exit CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG once I get the file name

    Hi
    I have where I have a selection screen that finds the file, you can say where to get the file. After that I need to close that window. How do I close it???
    Below is an example of my program. After I choose the file and execute the program, I have a <b>write</b> statement. I don't see that statement on the screen. How do i terminate the input screen and display text.
    Parameters :  AUSZFILE      LIKE RFPDO1-FEBUMSF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR AUSZFILE.          "mo271101
      DATA: L_FILES TYPE FILETABLE,                            
            H_FILES TYPE FILE_TABLE,                           
            L_RC LIKE SY-SUBRC.                                
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG        CHANGING                                               
          FILE_TABLE              = L_FILES                    
          RC                      = L_RC                       
        EXCEPTIONS                                             
          FILE_OPEN_DIALOG_FAILED = 1                          
          CNTL_ERROR              = 2                          
          ERROR_NO_GUI            = 3                          
          NOT_SUPPORTED_BY_GUI    = 4                          
          OTHERS                  = 5.                         
      IF SY-SUBRC <> 0 OR L_RC < 0.                            
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO       "mo271101
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.   
      ELSE.                                                     "mo271101
        READ TABLE L_FILES INDEX 1 INTO H_FILES.              
        AUSZFILE = H_FILES-FILENAME.                           
      ENDIF.
    Write AUSZFILE.
    Thanks in advance

    You must remember the START-OF-SELECTION event here,  after you select the file name and click F8, the START-OF-SELECTION event is triggered, but if it is not there, nothing will happen.
      if sy-subrc <> 0 or l_rc < 0.
        message id sy-msgid type sy-msgty number sy-msgno       "mo271101
        with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.                                                     "mo271101
        read table l_files index 1 into h_files.
        auszfile = h_files-filename.
      endif.
    start-of-selection.            "<--  Add this
      write:/ auszfile.
    Regards,
    RIch Heilman

  • Pop up coming twice while using CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG

    Hello All,
      I am calling the method FILE_OPEN_DIALOG of the class CL_GUI_FRONTEND_SERVICES to display the pop up to select the file from the desktop.After i select the file and execute the program it displays the report and when i clcik the back button it gives me the pop up again.I have used  CALL METHOD CL_GUI_CFW=>FLUSH.Inspite of this it is not working properly.
    Thanks,
    Rakesh.

    Try This.....
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR F_PATH.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      CHANGING
        file_table              = file
        rc                      = rtrncode
      EXCEPTIONS
        file_open_dialog_failed = 1
        cntl_error                   = 2
        error_no_gui               = 3
        not_supported_by_gui = 4
        others                        = 5

  • Upgradtion doubt in calling cl_gui_frontend_services= file_open_dialog

    hi,
        Im upgrading from 4.5b to ecc 6.0 in the following code the export parameter  Default extn parameter in the call method
    cl_gui_frontend_services=>file_open_dialog does not get displayed
    i,e *.xls should be there bydefault it is not there in 6.0 how to get it. check the code once
    ws_filename get fm is in comments
    CALL FUNCTION 'WS_FILENAME_GET'
          EXPORTING
               DEF_FILENAME     =  C_DEFFILE
               DEF_PATH         = L_LOCFILE
               MASK              = C_MASK
               MODE             = C_MODE
          IMPORTING
               FILENAME         = L_FILE
          EXCEPTIONS
               INV_WINSYS       = 1
               NO_BATCH         = 2
               SELECTION_CANCEL = 3
               SELECTION_ERROR  = 4
               OTHERS           = 5.
    IF SY-SUBRC EQ 3.
       MESSAGE I999 WITH 'Action Cancelled by user'(044).
       EXIT.
    ENDIF.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      EXPORTING
        DEFAULT_EXTENSION        = '*.xls,'
        FILE_FILTER              = '.'
      CHANGING
        file_table               = W_FILENAME
        rc                       = w_rc
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5.
    IF W_RC IS NOT INITIAL.
       READ TABLE W_FILENAME INTO W_AREA INDEX 1.
    IF SY-SUBRC = 0.
       L_FILE = W_AREA-FILENAME.
    ENDIF.
    ENDIF.

      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'File Selection'
          default_filename        = '*.xls'
          file_filter             = '(*.xls)|*.XLS|'
        CHANGING
          file_table              = lt_filetable
          rc                      = lv_filecount
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5.

  • Server path not drive CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG

    Hi folks
    When using the CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG or WS_FILENAME_GET we some times have the server path returned.
    And sometimes the drive letter returned.
    See two examples:
    1: \\blrx1\os390out\id1\test.txt
    2: R:\os390out\id1\test.txt
    What to do when we ALWAYS want the server path returned??
    Best regards
    Carsten

    I have used this several times in my own coding and I always get the \\
    in my end result
    method import_the_file_locn.
      data:
        lv_wintitle type string value 'Select Upload File',
        lv_deffile type string value 'asset_data',
        lv_dir type string value 'c\:',
        ls_file type line of filetable,
        lv_rc type i,
        lv_user_action type i.
      free gv_sdir.
      call method cl_gui_frontend_services=>file_open_dialog
        exporting
          window_title            = lv_wintitle
          default_filename        = lv_deffile
          initial_directory       = lv_dir
        changing
          file_table              = gt_file
          rc                      = lv_rc
          user_action             = lv_user_action
        exceptions
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          others                  = 4.
      check lv_user_action is initial.
      read table gt_file into ls_file index 1.
      translate ls_file to lower case.
      gv_sdir = ls_file.
    endmethod.
    I don't know whether it is perhaps a mapping issue / windows setting that results in the path returned with the mapped drive?
    I just debugged one of methods above and I cant recreate the same issue when I pick up a file in a mapped directory, sorry.
    I guess there is also the option for you to do some substring manipulation and path mapping in a look up table - but if you have hundreds of servers rather than a few maybe not the best workaround.

  • Exceptions in  cl_gui_frontend_services= file_open_dialog

    hi when upgrading from 4.5 to 6.o Im getting the following exception
    When the pop up box is cancelled during the download option, a success message is displayed in 6.0 whereas an error message is displayed in 4.5.
    here is the code
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      EXPORTING
        DEFAULT_EXTENSION        = '*.xls,'
        DEFAULT_FILENAME         = '*.xls,'
        FILE_FILTER              = '.'
      CHANGING
        file_table               = W_FILENAME
        rc                       = w_rc
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5.
    IF W_RC IS NOT INITIAL.
       READ TABLE W_FILENAME INTO W_AREA INDEX 1.
    IF SY-SUBRC = 0.
       L_FILE = W_AREA-FILENAME.
    ENDIF.
    ENDIF.
      IF SY-SUBRC EQ 3.
        MESSAGE I999 WITH 'Action Cancelled by user'(044).
        EXIT.
      ENDIF.
    plz tell me where is the eror

    chk the data declearsation data type.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'Import from a local file'
          default_extension       = 'DAT'
         DEFAULT_FILENAME        =
          file_filter             = l_file_filter
          initial_directory       = 'C:\'
         MULTISELECTION          =
         WITH_ENCODING           =
        CHANGING
          file_table              = l_file_table
          rc                      = l_rc
         USER_ACTION             =
         FILE_ENCODING           =
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5
          CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
            EXPORTING
              FILENAME                = V_FILE
              FILETYPE                = 'ASC'
              WRITE_FIELD_SEPARATOR   = 'X'
            CHANGING
              DATA_TAB                = IT_MAIN[]
            EXCEPTIONS
              FILE_WRITE_ERROR        = 1
              NO_BATCH                = 2
              GUI_REFUSE_FILETRANSFER = 3
              INVALID_TYPE            = 4
              NO_AUTHORITY            = 5
              UNKNOWN_ERROR           = 6
              HEADER_NOT_ALLOWED      = 7
              SEPARATOR_NOT_ALLOWED   = 8
              FILESIZE_NOT_ALLOWED    = 9
              HEADER_TOO_LONG         = 10
              DP_ERROR_CREATE         = 11
              DP_ERROR_SEND           = 12
              DP_ERROR_WRITE          = 13
              UNKNOWN_DP_ERROR        = 14
              ACCESS_DENIED           = 15
              DP_OUT_OF_MEMORY        = 16
              DISK_FULL               = 17
              DP_TIMEOUT              = 18
              FILE_NOT_FOUND          = 19
              DATAPROVIDER_EXCEPTION  = 20
              CONTROL_FLUSH_ERROR     = 21
              NOT_SUPPORTED_BY_GUI    = 22
              OTHERS                  = 23.
          IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.

  • Regarding CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG

    I'm using CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG to replace WS_FILENAME_GET which is an obsolete function module in ECC6.
    WS_FILENAME_GET was making use of the file mask -
    ',.csv  ,.csv ,.txt ,.txt.'
    When I use the same string in the file_filter parameter of FILE_OPEN_DIALOG, it doesn't work.
    Can somebody tell me the correct string format? I would like *.csv & *.txt as the file mask in the open dialog.
    Thanks!

    Hi
    U can give like this |.csv| ,|.csv |,|.txt |,|.txt.|'
    i think it will work.
    Thanks

  • File extension for: cl_gui_frontend_services= file_open_dialog

    Hello,
    I would like to set the file extension for cl_gui_frontend_services=>file_open_dialog such that my default extension in the file open dialogue is the .csv (comma-separated value) file. May I know how can I do that?
    Thanks!
    Regards,
    Anyi

    Hello,
    Thanks for the quick reply.
    Howeer, I tried to use the extension of CSV and the file dialogue opened up with .RTF (which is the default extension) instead.
    Any comment on that?
    Thanks!
    Anyi
    > HI,
    >
    > Here is the code
    >
      DATA:  l_title TYPE string,
    >          l_dfext TYPE string,
    > l_dfinm TYPE string,
    >          l_file  TYPE string,
    > l_path  TYPE string,
    >          l_fpath TYPE string.
    > le = 'SAVE FILE PATH'.
    >   l_dfext = 'csv'.
    > l_dfinm = 'Error_Idoc'.
    >
    > CONCATENATE l_dfinm sy-datum sy-uzeit INTO l_dfinm
    >  SEPARATED BY '_'.
    >
    > CONCATENATE  l_dfinm l_dfext INTO l_dfinm SEPARATED
    >  BY '.'.
    >
    > CALL METHOD
    >  cl_gui_frontend_services=>file_save_dialog
    >    EXPORTING
    >    window_title      = l_title
    >    default_extension = l_dfext
    >    default_file_name = l_dfinm
    >     INITIAL_DIRECTORY = L_DIR
    > CHANGING
    >       filename          =  l_file
    > path              =  l_path
    >       fullpath          =  l_fpath
    > CEPTIONS
    >       cntl_error        = 1
    > error_no_gui      = 2
    >       OTHERS            = 3.
    > s,
    > Richa

  • CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG causes SAPGUI to crash

    Hi,
    When I try to select a file to download or upload an LSMW project my SAP GUI freezes completely, and the only way out is to kill it via Windows task manager.
    After quite some research I found out that:
    - This happens only on some PC's (but all PC's have the same SAP GUI version, i.e . 7.10)
    - When I debug this I see that the issue happens somewhere within CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    - The default folder passed to that method is C:\. If I change it to something else (in debug change mode), everything goes well
    Anybody experienced this before?
    Thanks
    Patrick

    Hi Jepoy,
    You can set the result of the save button which is action_ok in a variable. So when u execute the same code again, just pass this below method call.
    IF lv_result = cl_gui_frontend_services=>action_OK.
             RETURN.
           ENDIF.
    Regards,
    Sivaganesh

  • CL_gui_frontend_services-To read data by selecting file from file dialog

    Hi I have a requirement in which -
    I have to selct the file using file open dialog . Cl_gui_open_frontendservices . From this I have to read the data into internal table .
    How can I get the data  after getting the file name .
    Does any one have idea on this .

    data: begin of itab_string occurs 0,
          record type char255,
          end of itab_string.
    data:  L_FILETABLE TYPE FILETABLE,
    L_FILETAB_H TYPE FILETABLE WITH HEADER LINE.
    data: p_file1 type string.
    selection screen .
    PARAMETERS: P_FILE TYPE LOCALFILE.
    at selection-screen on value-request for P_FILE.
    IF THE USER SELECT EXTENTION BUTTON IT WILL OPEN THE LOCAL DIRECTORY FOR SELECTING THE FILE LOCATION.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
       WINDOW_TITLE            =
       DEFAULT_EXTENSION       = 'CSV'
       DEFAULT_FILENAME        = 'C:\Documents and Settings\kiran\Desktop\STATUS.csv'
       FILE_FILTER             =
       INITIAL_DIRECTORY        = 'C:\Documents and Settings\kiran\Desktop\'
       MULTISELECTION          =
       WITH_ENCODING           =
      CHANGING
        FILE_TABLE              = L_FILETABLE
        RC                      = RC
       USER_ACTION             =
       FILE_ENCODING           =
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5
    IF SY-SUBRC <> 0.
    ELSE.
    LOOP AT l_filetable INTO L_FILETAB_H.
    P_FILE = L_FILETAB_H-FILENAME.
    move p_file to p_file1.
    EXIT.
    ENDLOOP.
    ENDIF.
    passing the selected file name to gui_upload for loading the data
    into internal table
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = p_file1
      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = itab_string
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE I000(Z00) WITH 'PLEASE PROVIDE CORRECT FILE NAME'.
    ENDIF.
    Reward points for all helpful answers,
    kiran.M
    Reward points if helpful and close this thread
    Message was edited by:
            KIRAN KUMAR

  • Diff between GUI_UPLOAD and CL_GUI_FRONTEND_SERVICES= GUI_UPLOAD

    i want to upload some records from the flat file to internal table. when i use GUI_UPLOAD function module in tables parameter i have given the work area. but when i use CL_GUI_FRONTEND_SERVICES-=>FILE_OPEN_DIALOG and then CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD i have given the internal table body in the changing parameters. my doubt is we have used GUI_UPLOAD in both occassions but when we use GUI_UPLOAD alone we are giving the internal table workarea but when we use it along with class CL_GUI_FRONTEND_SERVICES we are giving the internal table body. whats is the reason or logic behind this?.

    Hi guys -- the answers you've given are correct but an example IMO is 100% better
    go_guiobj type ref to cl_gui_frontend_services.,  "For Windows file dialog
    form load_data using    e_file type string
                            e_table.
      field-symbols <int_table> type standard table.
      assign e_table to <int_table>.
      if go_guiobj is initial.
        create object go_guiobj.
      endif.
      call method go_guiobj->gui_download
        exporting
          filename              = e_file
          filetype              = 'ASC'
          write_field_separator = 'X'
        changing
          data_tab              = <int_table>.
    endform
    * For Directory look up service (Windows)
    at selection-screen
      on  value-request for p_direct.
        search_path = p_direct.
        perform directory_lookup using search_path.
        if not gv_folder is initial.
          p_direct = gv_folder.
        endif.
    form directory_lookup using directory type string.
      if go_guiobj is initial.
        create object go_guiobj.
      endif.
      call method go_guiobj->directory_browse
        exporting
          window_title    = 'Select Directory'
          initial_folder  = directory
        changing
          selected_folder = gv_folder.
    endform.                    "directory_lookup
    Cheers
    jimbo

  • Equivalent WD method for file_open_dialog

    Hello,
    What is the equivalent method in WD ABAP for cl_gui_frontend_services=>file_open_dialog (to specify the path of a file in a pop-up)?
    I have a requirement wherein i want to specify the path in which a file will be saved in the local system. I call the method ATTACH_FILE_TO_RESPONSE to save a file, but it doest gives me a path as such.
    Best Regards,
    Seshadri

    Both ATTACH_FILE_TO_RESPONSE  and fileDownload are the recommended methods to trigger download to the frontend.  They work a little differently than the old CL_GUI_FRONTEND_SERVICES becuase they are running within a browser and have to deal with a different security and interaction model for file downloads. With the ATTACH_FILE_TO_RESPONSE, the MIME type and the corresponding configuration on the client workstation control if the file gets the save dialog box or if it opens immediately.
    The fileDownload UI element has a behaviour property that helps you to influence the way the download is handled on the client side.
    The ACFUpDownload UI element is new in 7.01.  However on that release level it won't help you with this requirement because it doesn't support a file dialog yet.  That option won't be added until 7.02.

  • How to replace ws_filename_get function module to file_open_dialog

    how to replace ws_filename_get function module to file_open_dialog

    Here it is,
    DATA: i_file_name TYPE FILETABLE,
          w_file_name TYPE FILE_TABLE,
          v_rc TYPE i.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      EXPORTING
        INITIAL_DIRECTORY       = 'C:\'
      CHANGING
        file_table              = i_file_name
        rc                      = v_rc
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_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.
    READ TABLE i_file_name INTO w_file_name INDEX 1.
    No wthe w_file_name will contain the file name.
    Regards
    Kathirvel

  • FILE_OPEN_DIALOG doesn't work on ECC 6.0

    Hi all,
    i'm trying to use the open file dialog in a report selection screen
    I've tried all the method's and FM's that i know but it's not working.
    cl_gui_frontend_services=>file_open_dialog
    F4_FILENAME
    WS_FILENAME_GET
    My SAP system is ECC 6.0 and the sap gui is the 620.
    Do you have any idea on what could be the problem on this.
    Thanks in advance.

    Check the below link:
    File open dialogue
    Thanks
    Seshu
    Message was edited by:
            Seshu Maramreddy

Maybe you are looking for

  • How do I arrange the order of icons on the printer's touch screen panel? (Office Jet Pro 8600)

    There has to be a way to remove apps from the screen and to re arrange.  The only one I use is scan to email and it is buried 7 screens deep. Does anybody know how to do this?  This is really annoying and I would not have bought the rpinter if you ca

  • Migrate from G5 Dual 2.5 to 24in Intel iMac

    Hi all, could any of the Guru's here give me some advice. I am migrating my set up from a Power Mac G5 Dual 2.5 to an Intel iMac 24in 2.3. What's the best way of bringing my apps, fonts and settings across to the new machine?

  • Process execution engine execution error. from the latest HF in BPM Ent.

    Hi All, After applying the latest hotfix, I'm now getting this error when trying to launch any of the application. My setup is AquaLogic BPM Enterprise 6.0.4 for Weblogic. I've tried redeploying all the deployments within Weblogic and also the Admin

  • Time to be mature about it creative... tsk tsk tsk

    i recently bought an apple ibook only to discover that my zen micro is not compatible with it! well, i thought, creative will have a mac os x driver for download but not only they don't have it for the zen micro because after some research i haven't

  • Screen exits - Urgent.

    Hi, I am working on screen exits for VA01. Can someone tell me how to add table control in a sub screeen at item level in additional data B ?