Filter in the Dialog box for selection

I have report that contains a file selection dialog using the following code
at selection-screen on value-request for p_file.
  perform f_get_file using cl_gui_frontend_services=>filetype_excel.
form f_get_file using p_filetype type string.
  data: lt_filetable  type filetable,
        ls_file       type line of filetable,
        lv_filename   type string,
        lv_path       type string,
        lv_fullname   type string,
        lv_title      type string,
        lv_desktop    type string,
        lv_rc         type i,
        lv_action     type i.
  call method cl_gui_frontend_services=>get_desktop_directory
    changing
      desktop_directory    = lv_desktop
    exceptions
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      others               = 4.
  if sy-subrc <> 0.
    message e007(zspx) with 'Desktop not found'.
  endif.
* Update View
  call method cl_gui_cfw=>update_view
    exceptions
      cntl_system_error = 1
      cntl_error        = 2
      others            = 3.
  lv_title = text-003.
  call method cl_gui_frontend_services=>file_open_dialog
    exporting
      window_title            = lv_title
      file_filter             = p_filetype
      initial_directory       = lv_desktop
    changing
      file_table              = lt_filetable
      rc                      = lv_rc
      user_action             = lv_action
    exceptions
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      others                  = 4.
  if sy-subrc = 0 and lv_action ne cl_gui_frontend_services=>action_cancel.
    read table lt_filetable into ls_file index 1.
    if sy-subrc = 0.
      p_file = ls_file-filename.
    else.
      clear p_file.
    endif.
  else.
    clear p_file.
  endif.
endform.                    " f_get_file
Currently while opening the dialog for file selection its showing the desktop directory. But user can select file from any other directory.
My question is how to restrict this dialog box from which user can select only from desktop directory.
PS : Please don't suggest  to validate the file after getting the file that its from desktop or not

Hi,
Like the bellow ?
Replace following code
if sy-subrc = 0 and lv_action ne cl_gui_frontend_services=>action_cancel.
    read table lt_filetable into ls_file index 1.
    if sy-subrc = 0.
      p_file = ls_file-filename.
    else.
      clear p_file.
    endif.
  else.
    clear p_file.
  endif.
with the bellow
IF sy-subrc = 0 AND lv_action NE cl_gui_frontend_services=>action_cancel.
    READ TABLE lt_filetable INTO ls_file INDEX 1.
    IF sy-subrc = 0.
      FIND FIRST OCCURRENCE OF lv_desktop IN ls_file-filename.
      IF sy-subrc = 0.
        p_file = ls_file-filename.
      ELSE.
        MESSAGE: 'Sorry! you can select file only from Desktop' TYPE 'I'.
        PERFORM f_get_file USING cl_gui_frontend_services=>filetype_excel.
      ENDIF.
    ELSE.
      CLEAR p_file.
    ENDIF.
  ELSE.
    CLEAR p_file.
  ENDIF.
Regards,
Faisal

Similar Messages

  • Why is the dialog box for storing a bookmark so small and not resizeable??

    I have about two dozen folders full of bookmarks, and some of them have sub-folders. When I go to bookmark a page, the dialog box is ridiculously small, for n apparent reason. If it started out much larger, or if I could resize it to the full height of my screen, it would be so much easier to use.
    Also, it would be so much easier to provide feedback if you just had a "Suggestion Box" conspicuously located on your website.

    '''Help > Submit Feedback ....''' right in Firefox.
    https://addons.mozilla.org/en-US/firefox/addon/add-bookmark-here-2/ <br />
    Has a resizable view port for the folders.

  • Using ExcelExport without opening the dialog box to select all the channels in portal by default

    Hi,
        I need to export all the data in the Data portal to an Excel file without opening the Dialog for channels selection. In the ExcelExport command, it asks for a Config (*.stp) file as one of the parameters. Is there need to create a new stp file for selecting all channels or can the same file (Example_ASC.stp ) be reused ? If so, do I need to change any content in the system stp file ?
    Thanks
    Venkatesh Murthy

    http://forums.ni.com/ni/board/message?board.id=60&message.id=8565&query.id=128811#M8565

  • Secure printing problems with the dialog box

    Hi!
    Some one which has problem with the scure dialog box then using secure printing?
    then we print in Adobe acrobat reader X 10.0.1 the dialog box for entring your pin nummer appearing under acrobat, causeing the program to locking until you go to the dialog box and clicking on it and enter the pin. The problem is that adobe not showing the dialog box in front of the printing overall dialog.
    had nog problem with the old 9, it started then we uppgraded. Haw tride a nother driver but haw same issue. And all other programs works greate, word, notepat etc so it is just Adobe that has the problem.. ?
    /J

    Hi!
    Its´s XP sp3 and the printer is a network printer(Toshiba e-studio 4520c)  running a PCL6 driver.
    Screen capture is not so much to see i think, running Swedish interface to. The ordinary dialogbox för printing is the first thing thats pops up, and then adobe reader frezes because the secund box pops up under adobe, you can click on it in the "toolbar" to continue. One thing that is diffrent when you print in adobe is that you can se on the "toolbar" for the popup box for the pin/password box is a Adobe icon on it. It is not so in example when printing in word, ie8 etc.
    The problem is that many users dont see it and thinks the program has stopt working.
    Im now going to try the PS driver from toshibas homepage..
    thanks for help!

  • How to customize the Save as dialog Box for saving Web Query???

    Hello,
       we are usnging SAP NW Portal and BI 7.0 (SP14).
       We have published BI web queries in the Portal and it works just fine, now when the User select the Button "Save As" in the Context Menu of any web query, this will open a new Dialog Box name "Save As Dialog Box", so from this dialog box the user can select where to save the query, he/she have 3 options* to save qureies: My Favorites, Bex Portfolio and MyPortfolio, this also works fine.
      My Quetsion is: How can i customize the View of this "Save As" dialog box, so at the end the User can only select 2 Options:  My Favorites + MyPortfolio. So how to hide the Tab:  Bex Portfolio in the Dialog Box.
    Points for any good answer.
    Many Thanks and Regards,
    Nazih
    Edited by: Nazih Kayyali on Feb 3, 2009 4:04 AM

    In what you have posted, there is no reason it shouldn't work the same way in Acrobat 9. I would recommend that you submit your complete application to developer support.

  • I need the dialog box (which contains page selection etC) HOW TO MAKE IT?

    hi
    i have done an requirement in smartforms.
    i need the dialog box (which contains output device name, page selection etc) when i take the print (smartforms).
    And now i already can see a dialog box .but still it doesn't have the page selection.
    I mean if the smartforms which have 5 pages,and what i need is just print the page 1 and page 3 . so I need the page selection
    which can help me on this issue. 
    Would anyone know something about it  and give me some advice . I will be appericate it.

    Hi,
    Just check with the control parameters of the function module, if you have changed any of it.
    If you have changed it then try to give the no-dialog field of the control parameter table as space.
    If the dialog box which gives you the Output device name and others appears then just below the output device name you have the column for the page selection.Just pass the values of the pages separating them with comma(like 2, 5 will print second and fifth pages) and it prints only those pages.
    Regards
    Sarves

  • How to access the Document Options dialog box to select display properties?

    How to access the Document Options dialog box to select display properties (e.g. smartcut ) for a selected document to
    be viewed in the Workspace.
    regards

    Preferences --> General --> Reset all warnings.
    Mylenium

  • Upgraded to Mountain Lion and CS3, I am no longer able to access the correct dialog box for fine printing with Epson Stylus Photo 1400.

    I have recently upgraded my Mac OS to Mountain Lion, and am using Photoshop CS3 together with Lightroom 5. To my absolute horror, in either Adobe program I am no longer able to access the dialog box which allows me to choose paper type, size, and print quality when attempting to print on my Epson Stylus Photo 1400. An excruciating hour on the phone with largely unintelligible folks at Epson seemed to prove the problem lies with Adobe instead of Epson. I'd greatly appreciate whatever advice might be forthcoming from the Community.

    Well, this seemed to work.. can't believe it! After a year of messing with this!
    from Stevejones5
    "I found a way around this problem. GO to HD/Library/Printers/Epson/InkjetPrinter/ICCProfiles and you will find a file labeled Pro38.profiles. This is a package file. Control click on it and reveal contents. Then you can copy all the profiles and paste them into your Colorsync folder either in the HD/Library folder or your own Home folder/Library. Then the profiles will show up in Photoshop and Lightroom."
    Key, is to Control click on the printer to "Open contents". Then open Resource folder. Copy everything in it and then paste it into the "Colorsync" folder in your Library.  (Remember, to get to Library you have to hold the command key down for it to appear in "Go" Menu for Finder.
    Then I reinstalled printer driver from Apple, then rebooted computer, then plugged in printer. And VOILA-- I can now select Epson Premium Photo Paper Luster!

  • I am attempting to update a page onmy website and the dialog box asks for a password for "50.63.96.1  I have no password and never needed one before. Please advise. Thanks, Regina

    I am attempting to update a page onmy website and the dialog box asks for a password for "50.63.96.1  I have no password and never needed one before. Please advise. Thanks, Regina

    That would be the password for your FTP server. You can only get this from your web hosting company. You should contact your web hosting company and ask them for your FTP Publishing details.
    Then select your web site name at the top of the list of web pages in iWeb. You'll see input fieldd for your FTP details. Enter what you get from your web hosting provider in those fields.

  • I have multiple itunes libraries. why can't i switch between them (i can see them in the dialog box but they are not select-able)?

    i have a numbe of libraries; i have never had any problems switching between them.  now, when i press alt button and click through to 'choose library...', i am seeing all of my libraries in the dialog box but they are 'greyed' out and i cannot select them.
    any help would be appreciated.
    thanks,
    ohad.

    You can see which dictionary is selected if you right-click in a text area and open the Languages submenu.
    * http://kb.mozillazine.org/Spell_checking
    * http://kb.mozillazine.org/Dictionaries
    * https://support.mozilla.org/kb/Using+the+spell+checker

  • Change File Name In The "File Download" Dialog Box For Web Reports

    Hi All ,
    I followed the below note to change the "File Download" name.
    How To Change The File Name In The "File Download" Dialog Box For Web Reports? Doc ID: Note:418366.1
    However its not working. Has anyone tried this and works fine ?
    Basically I wanted to change the name "rwservlet" when a report is run in an
    excel format.
    Rajesh Alex
    Rajesh Alex

    Hello,
    Have you checked if a HTTP header "Content-disposition" is returned ?
    You can use ieHTTPHEaders for IE
    http://www.blunck.se/iehttpheaders/iehttpheaders.html
    and
    Live HTTP Headers for FireFox
    https://addons.mozilla.org/en-US/firefox/addon/3829
    Regards

  • How to handle the button "cancel" in a dialog box for displaying views?

    Hello!
    I ve a question about handling the cancel button in a dialog box for displaying views.
    I ve already implemented the dialog box by using the following code:
    METHOD eh_onnewqact.
      DATA stitle TYPE string.
      IF m_popup IS BOUND.
        stitle = cl_bsp_runtime=>get_otr_text( alias = 'ZCC_ICRM/NEW_TASK' )."cl_wd_utilities=>get_otr_text_by_alias( 'ZCC_ICRM/NEW_TASK' ).
        m_popup = comp_controller->window_manager->create_popup(
          iv_interface_view_name = 'ZCC_POPUP_NEWBT/NewQActWindow'
          iv_usage_name = 'CUNewQAct'
          iv_title = stitle
        CALL METHOD m_popup->set_on_close_event
          EXPORTING
            iv_view       = me
            iv_event_name = 'NEWQACT_POPUP_CLOSED'.
      ENDIF.
      m_popup->open( ).
    ENDMETHOD.
    My dialog box consists two buttons - cancel and create.
    The cancel buttons should close the popup and the create button should create an entity of a specified object. but let us come to the cancel button. I did´nt find any information about implementing an cancel button. So, how should I implement it? I thougt
    me->close( ). But that didnt works!
    Could u give me further information about that, because my cancel event-handler is empty?
    method EH_ONCANCEL_QACT.
    endmethod.
    After that I would know how my calling view could know that the user pushes the Create Button and how the data of 2 inputfields of the dialog box finds their way to the calling view in order to process this data there?
    Thank you very much!

    Hi Michael,
    thank you for your advice! This problem is solved...
    ...but I have another issue. Ive implemented 2 editable fields in my popup. The user should fill that fields with context and that context should be processed in the calling view of my popup.
    My question is how to transfer these information from my popup to my calling view or method?
    I tried the following...
          lv_context_node ?= m_popup->get_context_node( 'QUICKACT' ).
          IF lv_context_node IS NOT INITIAL.
            lv_text = lv_context_node->get_date( attribute_path = '' ).
          ENDIF.
    But it doesnt work! The context node object is always empty/initial.
    Thank you!
    PS: Another possibility could be that the object / node of the calling view is transferred to the pop-up in order to process it there.
    Edited by: Marcus Findeisen on Feb 22, 2011 12:13 PM

  • What is the "Extract" button at the bottom the DNG converter dialog box for ?

    Does anyone know ....
    What is the "Extract" button at the bottom the DNG converter dialog box for ?
    THANK YOU

    In DNG Converter you have an option to embed the original RAW files (CR2, NEF etc) into the DNG file (see screenshot). Later you might want to extract them back, for example, for converting in camera-maker's own software.
    So, if you have any DNGs with original RAWs embedded, Extract button will get them back.

  • Is it possible for someone to print a completed form with all the dialog box entries also printing?

    We have a grant application form that applicants will complete. We have tested it by completing the form and noticed that if it is printed, all of the dialog box entries don't print, just what is visible on the form. Any fix for this?

    Hi czigrand,
    Thanks for visiting Apple Support Communities.
    Currently, you can gift dollar amounts or individual items (EG. songs) on the iTunes Store. See this article for more information:
    In the iTunes Store, you can gift a dollar amount or specific music, movies, TV shows, or apps from your iPhone, iPod touch, iPad, Mac, or PC. Follow these steps to send a gift from the iTunes Store.
    iTunes: Sending iTunes Gifts
    http://support.apple.com/kb/HT2736
    Best Regards,
    Jeremy

  • HT3211 new, how do i turn off the dialog box at bottom left that is giving commands for macbook air?

    new, how do i turn off the dialog box at bottom left that is giving commands for macbook air?

    try "command+F5"

Maybe you are looking for

  • A message at beginning of start up that says my hard drive has an error and could fail soon.

    At startup error message says error with hard drive could fail anytime please contact www.hp.com/go/techcenter/startup. How do I correct this? HP Pavilion Entertainment PC. Windows 7.

  • Red square with circle, grey exclamation point AND iTunes won't sinc new songs?

    I have just upgraded my iPhone 4 to iOS 7.0.3 and for some reason my music on my phone will not play. Every song comes up with a red square with a red circle around it and simply will not play. Looking on iTunes now - every time I try to play a song

  • How to end a process from cmd.exe?

    I need to open and close a word file(Test.doc) from my java program. I managed to open the file using cmd shell, but I don't know how to close the opened file. Does anybody have a suggestion? Below is my code. Thanks.     Runtime r = Runtime.getRunti

  • TDS exemption based on amount

    Hi, I have a situation wherein TDS for a vendor needs to be deducted after a particular amount. A Vendor has obtained an exemption certificate which states, say until 1lakh rupees he would be exepmted and anything beyond that needs to be deducted. Sc

  • Can I access all dates that a website has been visited?

    I have been utilizing the History function to see when a page was last visited and how many times it has been visited. I would like to see every instance of when I have visited a page. For example, I have visited google.com 27 times in the last month