How to set default file type for Open dialog

Dear my friends,
I am using "At selection-screen ON VALUE-REQUEST FOR filepath" to display open dialog and i want to set default file type for open dialog = *.txt.
Thank your times !

Hello,
U can make use of this code:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SP_FILE.
  PERFORM SAVE_DIALOG CHANGING SP_FILE G_F_RC.
FORM SAVE_DIALOG CHANGING PO_FILE PO_RC.
  DATA: L_VA_BOXTITLE     TYPE STRING,
        L_VA_DEFAULTFILE  TYPE STRING,
        L_VA_DEFAULTNAME  TYPE STRING,
        L_VA_DEFAULTPATH  TYPE STRING,
        L_VA_DEFAULTFULL  TYPE STRING,
        L_VA_FILTERTEXT   TYPE STRING,
        L_VA_CODE         TYPE I.
  CLEAR: PO_RC, G_F_CONF.
  L_VA_BOXTITLE   = TEXT-B01.
  L_VA_FILTERTEXT = TEXT-B02.
  IF PO_FILE IS INITIAL.
    CLEAR L_VA_DEFAULTFILE.
  ELSE.
    L_VA_DEFAULTFILE = PO_FILE.
  ENDIF.
  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
    EXPORTING
      WINDOW_TITLE            = L_VA_BOXTITLE
      DEFAULT_EXTENSION       = 'TXT'
      DEFAULT_FILE_NAME       = L_VA_DEFAULTFILE
      FILE_FILTER             = L_VA_FILTERTEXT
      INITIAL_DIRECTORY       = 'C:SAPWorkdir'
    CHANGING
      FILENAME                = L_VA_DEFAULTNAME
      PATH                    = L_VA_DEFAULTPATH
      FULLPATH                = L_VA_DEFAULTFULL
      USER_ACTION             = L_VA_CODE
    EXCEPTIONS
      CNTL_ERROR              = 1
      ERROR_NO_GUI            = 2
      OTHERS                  = 3.
  IF SY-SUBRC <> 0.
    PERFORM CHECK_ERRORTYPE(Z48M_MATDATA_UP) CHANGING SY-MSGTY.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    CLEAR PO_FILE.
    EXIT.
  ENDIF.
  IF L_VA_CODE NE 0.
    MESSAGE S818(3F) WITH TEXT-011.
    CLEAR: PO_FILE, PO_RC.
    EXIT.
  ELSE.
    WRITE L_VA_DEFAULTFULL TO PO_FILE.
    G_F_CONF = G_C_XFELD.
  ENDIF.
ENDFORM.                    " save_dialog
If useful reward.
Vasanth

Similar Messages

  • How to set default file type for screen capture?

    I want to change the default from .jpg2 to .jpg when doing a screen selection
    capture (cmd-shft-4). Where is the place to do this?
    Thank you,
    todd

    Todd,
    OnyX has 10 screen shot options available in Parameters>General>Screen Capture format:
    ;~)

  • Will EC support setting default file type and Open With from file menu?

    The default file types I can live without, but at least allow for Open With on right click from Windows Explorer.
    I currently have EC set in the Open With programs list, but EC does not comply for any files I opt to open it with (.css, .php, .html etc).
    EC open but not the file I choose.
    Also, even though the above use case is not ideal when if I do attempt an Open With when EC is already open, a new application session starts instead of attempting to open in the currently active app frame. It would be ideal to allow for single app frame, multiple files when Open With is employed.
    Darrell

    Hey Darrell,
    Thanks for the feedback. How Edge Code treats files is definitely something we know isn't ideal and it's something we're looking at fixing soon. There's currently a story on the Brackets backlog that adresses the Open With issue - https://trello.com/c/GhF1Bgf9
    And it based on howit ranks in that priority it looks like we could potentially take that into Edge Code over the next couple of months.
    This is definitely a feature that we think is important before we consider ourselves 1.0 so it's high priority.
    =Ryan
    [email protected]

  • How to set default file path for save

    Hello all,
    I'm currently blocked on the below issue and is hoping to gain your help and insights.
    We have recently upgraded to InDesign CS6. Now when an INDD file created in an older version of INDD is opened in CS6, all the save dialogs would not default to the location of the original INDD file. Though if the same file is opened in the version of InDesign that created it, the save dialog goes to the proper location by default.
    Debugged using our custom plugin as a gate way, and found out that after InDesign CS6 performed the document upgrade/convert, the database for the converted document loses file information. i.e.  IDataBase::GetSysFile() returns nil. I think we can figure out some way to get the original file path. For example, we can intercept "kAfterOpenDocSignalResponderService", and get the original file path of the opened file from IDocumentSignalData. Though I haven't yet able to figure out a safe way to set this file path to the document, so that the save dialogs would by default point at this path.
    Utils<Facade::IWorkgroupFacade>()->InitDocumentAssetManagement(docRef, filePath) seems to do the right thing, but it seems to be quite intruding, and I'm afraid that it is overkilling and will cause bad side effect for the use case I'm looking for.
    So I'm wondering if anyone has any suggestions to achieve this without implementing/overriding the file save dialog.
    Thanks.
    -Jeff

    You should be able to avoid writing your own open-doc trap by using kDocBoss's IOpenedFileInfo to obtain the original file's path. It seems fairly reliable; the only time I've seen it come up empty is for an opened QuarkXPress document.
    I'm afraid I don't know of a sanctioned way to change IDataBase::GetSysFile() without going through the database's SaveAs machinery. Overriding this behavior might only be possible by replacing the regular Save dialog with your own.
    But if InitDocumentAssetManagement() is helping, maybe the workgroup/asset management approach is worth pursuing. Have you tried spying on that call in the debug app? You might be able to isolate and use one of the commands that it's invoking (IAMSPManager::BindAsset() / kSetAssetAttributesCmdBoss?) without all of the side-effects of the higher-level call.

  • How to set default file permissions for applicatio...

    I have the nokia n86 and was wondering if there was any way of setting the file permissions of a program via the phone. To put it in context, i downloaded a program that edits photos but everytime i try to load a picture from my phone it asks me (for every single folder in my phone, not just the photo ones) if the program can open it. I can be there clicking yes all day as i there is a lot of folders and subfolders on the phone. I know sony ericssons had an option where you could select the programs permissions to always ask or never ask but i cant seem to find a similar option on the nokia.
    Does anyone have any ideas?

    Same issue here. Everything I put on the drive is set to Read-only for the group.

  • Default File Type for New Forms - How to change?

    Hi,
    How can I change propperty: Default File Type for New Forms?
    It is enabled! Do I have to be Administrator to change it? I have SAP ALL..
    SFP -> Layout -> Tools --> Options -> Document Handling
    tnx, Adibo.

    There is no authorisation required for changing the file type. You are saying its enabled, then you can change it.
    Edited by: Nikhil Poojari on Aug 28, 2009 6:50 AM

  • How to set default file location in Illustrator?

    I'm using Creative Suite CS5 in Windows Pro 64, and would like to set a default location for files in Illustrator and Photoshop when I execute the File > Open or File > Save commands.
    Yes, the program defaults to the location of the last file opened, but sometimes that file is gone, or I'm creating a new one from scratch, and the program looks for files in a distant place in my file structure.
    ** Is it possible to set a default file location for opening and saving in Illustrator CS5 (and in Photoshop CS5)?
    Thanks.

    Not that I know of. It simply reverts to the global "My Documents"/ "Documents" folder as provided by your operating system. these can of course be changed using variables and editing the Windows Registry/ Group Policies, but that affects all programs...
    Mylenium

  • How to set default file path while downloading alv output

    Hi,
    Can anyone tell me that how to set default file path while downloading the ALV output to system using Local file button on tool bar.
    Please look below screenshots:
    Kindly help me resolve it.
    Thanks in advance.
    Regards,
    Ashutosh Katara

    This information initial value is (maybe) stored in Windows Register (register.exe) at Software\SAP\SAPGUI Front\SAP Frontend Server\Filetransfer -> PathDownload, you can read it thru class CL_GUI_FRONTEND_SERVICES method GET_UPLOAD_DOWNLOAD_PATH and update it thru method REGISTRY_SET_VALUE. (Else there may be some parameter ID to force data, but I'm no longer sure)
    Regards,
    Raymond

  • Can I change the default 'File Type' for PL/SQL Source File to '*.prc' ?

    Want to change the 'default' extension for PL/SQL source to '*.prc'
    When navigating 'File' / 'Save As', and selecting the 'File Type' list box,
    The default 'File Type' for PL/SQL Source File is '*.pls'.
    Can I change the default 'File Type' for PL/SQL Source File to '*.prc' ?
    I have followed , 'Tools', 'Preferences' , 'File Types' and added '.prc' as 'Sql Script' file type, because (PL/SQL Source) is not present in the list.

    You can certainly overwrite the 'Save As' extension as you are saving the file. I have added an ER for more control over this functionality.
    sue

  • How to define "byte stream type" for "open file"?

    Hello,
    I created some numbers (type "double") in Matlab and stored in a file. What value should I use to specify the "byte stream type" for "open file" in Labview? Should I put something like "DBL" or "I32". I don't know where to find the list of legal "types" in Labiew help.
    Thanks so much!
    Felicia

    Looks like 7.1:
    The Matlab "double" is 64 bits (8 bytes). It doesn't make much sense to use an integer datatype to read a floating point value, so you would use DBL in LabVIEW. The numeric data types table can be found here.
    By the way, this assumes you saved the file as raw binary, as opposed to a .mat file, which is something different.
    Message Edited by smercurio_fc on 08-08-2008 11:21 AM
    Attachments:
    read file 7.png ‏13 KB

  • CS4 Set default file type when placing file

    The File->Place dialog box has a default file type of 'Importable files.'  Is it possible to set the default to All files (or anything else)?  Making the change manually does not seem to stick.  I have the same general question regarding File->Open.  A search of the forums returned one hit (unanswered) in the Dreamweaver forum.
    Thank you.
    Dick Conrad

    Peter:
    Good question.  One of our editors made this request, and I believe that he works with files that lack extensions.  But controlling the default would also let us go in the other direction: quickly see only .rtf or .txt files, for example.
    Any trick would be impractical if it lived in InDesign Defaults.  All ID users get the same copy, and no two editors would want the same filter.
    Thanks for your response.
    Dick Conrad

  • How to set default file extension in the FileChooser?

    We are trying to use the FileChooser but for some reason, it doesn't have any file extensions in the drop down menu (like in windows). Does anyone know how to put this in?
    Also, how do we set the file name for the saving file, rather than typing the name in ourself?
    Also, how do we position the file chooser dialog in the middle of the screen? Right now, it's in the top left corner of the screen.
    Here's our piece of code, used for saving file.
    FileChooser fileChooser = new FileChooser();
            File file = fileChooser.showSaveDialog(stage);
            /*User might clicked on the cancel button*/
            if (file != null) {
                try {
                    Writer output = new BufferedWriter(new FileWriter(file));
                    output.write(text);
                    output.close();
                } catch (IOException ex) {
                    logger.error("save file error", ex);
            }Any help would be appreciated! Thanks!

    867511 wrote:
    We are trying to use the FileChooser but for some reason, it doesn't have any file extensions in the drop down menu (like in windows). Does anyone know how to put this in?Have you read the API? What's the nested class of FileChooser that's listed immediately after it in the classes list?
    Also, how do we set the file name for the saving file, rather than typing the name in ourself?I don't see any API for that. You could file a RFE on kenai.
    Also, how do we position the file chooser dialog in the middle of the screen? Right now, it's in the top left corner of the screen.I don't see any API for that either.
    db

  • Default file type for photosmart 7525

    I am trying to find the default file type that is saved to a USB drive when scanning on the HP Photosmart 7525.  This is not my printer, I am just trying to help my sister who lives in another city and is not computer literate.  She scanned some pictures (or so she said, after I sent her the instructions from the manual after I downloaded it) to a memory card.  She is not sure what she is looking at from what she is telling me, it appears as the pictures were all saved to one PDF document. Does any one know if PDF is the default file type that scans are saved to on a memory card?  I cannot find the default file type mentioned in the manual.
    Thanks
    David

    Hi,
    You can check from its software on your computer. For documents it's pdf and for photos it's jpg. But you have to select first.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to set the size of an open dialog

    HI Everyone:
    I cannot set the size of the open dialog.
    I create a menu and menu item called "open"
    The menu item "open" will call OpenFile().
    However, I cannot set the size of the open dialog
    Everytime when the open dialog pops up
    the size isn't 500 x 500.
    Does anyone know what's wrong with this program ?
    Thanks a lot,
    Rodger
    ================================================================
    public void OpenFile(){
    JFileChooser fc = new JFileChooser();
    fc.setSize(new Dimension(500,500));
    fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    fc.showOpenDialog(this);
    ================================================================

    Try this and then tell us if it worked:
    JFileChooser fc = new JFileChooser();
    fc.setPreferredSize(new Dimension(500,500));
    fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    JDialog d = new JDialog(new JFrame());
    d.setSize(500, 500);
    d.getContentPane().setLayout(new FlowLayout());
    d.getContentPane().add(fc);
    d.setVisible(true);

  • Setting Default GUI Properties for Opened Files?

    OK, so you can set up a template for AIs you create yourself, to include things like Layer Panel thumbnail size etc, but can this be done for opened files?
    I work on a very large screen and always want to increase the layers panel thumbnail size, but it's a few clicks to do it, and I'd like to be able to set this value for all opened files, if this is possible. The default thumb. size is way to small and always needs bumped up.
    Are these values stored in the AI (since templates are simply AI files) or can a default value be set? if so, how can I do this?
    Thanks
    Richard

    You cannot change this for all opened files, as this is a per document setting unfortunately.
    To make a new document profile as per Monika open one fo the profiles here:
    Users/ Username/ Library/Application Support/Adobe/Adobe Illustrator CS4/en_US/New Document Profiles
    Change your thumbnail size to larger, then save over that profile
    When you make a new document choose that profile.

Maybe you are looking for

  • I cant get Ical to quit.  help

    I can not get ICal to quit.  It reads "the server responded with an error." I have force quit and still comes back...spinning

  • HR module issue

    hi i am using BAPI_HELPVALUES_GET function module, through this i get employee group and employee subgroups separately, therefore my issue is how to find employee subgroup is of which employee group in bapi function module itself???? i am executing b

  • ABAP code for wrting a file to application server

    <Moderator Message: We are not here to do your job for you> Hi All, i have a requirement to get the data from some other ABAP program and this data has to be written in one of the files present in application server. please provide me the exact ABAP

  • Unity 7.x support antivirus symantec 10.1??

    Unity 7.x support antivirus symantec 10.1??

  • Basic MDB Question

    Using WLS 7.0 and JBuilder 7 I've created a MDB in JBuilder 7 and auto deployed it into an already running instance of WLS 7.0. The MDB simply has a System.out in the onMessage() method. From within the WLS 7.0 Console i've configured the following s