Using a dialog window to select a name and directory to save the file

Hi there
I have a problem with the FILE_SAVE_DIALOG method or better with the windows that will be shown.
Before I save a file (e.g. PDF file) on the presentation server (the PC), I want to open a dialog window to have the option to give another directory and file name, under which I will save the file.
Therefore I use the method CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG. I found many information about this FILE_SAVE_DIALOG in this forum, but these tips didn't satisfy me.
The main problem is the FILE_FILTER. How to use this filter (is it a STRING?) properly, when I want to have a list in the dialog window? Nothing worked till now.
I use ERP 2005 with JAVA 1.4.1-07.
My Code:
DATA: fileName         TYPE  STRING,
      path             TYPE  STRING,
      workdir          TYPE  STRING,
      user_action      TYPE  I,
      encoding         TYPE  ABAP_ENCODING.
    fileName = I_FILENAME.
    path = I_PATH.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
       EXPORTING
         WINDOW_TITLE         = 'Save Adobe PDF file'
*         WITH_ENCODING        = 'X'
         INITIAL_DIRECTORY    = workdir
*         DEFAULT_EXTENSION    = '*.pdf'
         DEFAULT_FILE_NAME    = fileName
         FILE_FILTER          = '*.pdf'
         PROMPT_ON_OVERWRITE  = 'X'
      CHANGING
         FILENAME             = fileName
         PATH                 = path
         FULLPATH             = fullpath
         USER_ACTION          = user_action
         FILE_ENCODING        = encoding
      EXCEPTIONS
         CNTL_ERROR           = 1
         ERROR_NO_GUI         = 2
         NOT_SUPPORTED_BY_GUI = 3
         others               = 4.
    IF SY-SUBRC <> 0.
      EXIT.
    ENDIF.
    IF user_action <> CL_GUI_FRONTEND_SERVICES=>ACTION_OK.
      EXIT.
    ENDIF.
When I call this method with these parameters, I get the dialog window, but there is no filtering for PDFs.
I also tried the ideas with:
  FILE_FILTER = 'Adobe files (*.pdf)|(*.pdf)'
and so on. But nothing made the dialog window work properly, even the selection list didn't show the right content to select.
Who can help with this method SAVE_FILE_DIALOG?
Thanks
Frowin

HI,
check this program.
<b>
report ZTEST2.
data:  file type string,
       path type string,
       file_path type string.
data: itab type standard table of cskt.
start-of-selection.
  SELECT * FROM cskt INTO TABLE itab.
  call method cl_gui_frontend_services=>file_save_dialog
      exporting
                FILE_FILTER = '*.PDF'
      changing FILENAME = file
               path     = path
               fullpath = file_path.
  check not file_path is initial.
  call method cl_gui_frontend_services=>gui_download
    exporting    filename                = file_Path
                  WRITE_FIELD_SEPARATOR = 'X'
     changing    data_tab                = itab.
</b>
REgards,

Similar Messages

  • Just downloaded CC 2014 trial. I cannot select any images and it's ruining the files

    Just downloaded CC 2014 trial. I cannot select any images and it's ruining the files

    Before reloading, I would try deleting the preferences. It may not help in this case, but it is worth a try.
    In case you need help with that:
    Reset Preferences
    1) Close the program and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (not reversible)
    or
    2) Move the Folder. See:
    http://www.bugge.com/Family-and-friends/Illy/illy.html
    --OB

  • HR - dynamic selections field name and field value in the program

    HI all,
       I am using dynamic selections for a HR report.
    I have created a view with 20 fields and added it to HR report category ___00003(All fields suppressed).
    I need to check these fields in the program. But i am not able to get the field name and value in the program for dynamic selections fields.
    Please let me know how to get the field names and values in the program for dynamic selections .
    Thanks,
    Kranthi.

    You have to read the itab <i>pnpdynse</i> in your Program to obtain the Dynamic Selection values. This itab has a deep structure.. you can set a break point in one of the events before <b>get pernr</b> & in the debug mode, you will able to display the itab <i>pnpdynse</i>.. you can then identify how to get the values into your code..
    ~Suresh

  • When I download a PDF file using Adobe I get a black screen when attempting to print and if I save the file I get a corrupted response when opening it.

    This does not always happen, for example if I get a PDF file by email, it appears to be primarilly when I download from the internet.
    I use Adobe Reader X1. Can you assist please. Thanks

    Thanks Eric, no it does not help the matter. I opened the file using preview and the same message appeared. Thanks.

  • Dynamic File Name and Directory File Sender Adapter

    Hello gurus,
    I have a question: Is there any way to make the File Name, and Directory Dynamic of a File Sender Communication Channel ?
    For example, taking it as a parameter from a Web Service Request.. (I mean, the only way with this would be a ccBPM). I don't exactly know if there is a way, I just thought about this.
    Please tell me if someone could make Dynamic these 2 parameters while picking a file.
    Regards,
      Juan

    oops,thought i was replying to the PgP question:)
    I think you should be able to achieve this via adapter module but i m not really sure how exactly it will be done .
    Thanks
    Aamir
    Edited by: Aamir Suhail on Jul 28, 2009 1:42 PM

  • I need to create an action or script to save the file with the name of the selected layer

    I need to create an action or script to save the file with the name of the selected layer (not including the hidden layers, but including those visible).
    How could modify the script: 'Layer Comps To Files.jsx' to get the result?
    Warning: I do not need to export all layers as files.
    Who can help me?
    THX in advance

    Versione in Italiano (Further down the English version)
    NB - Nella versione inglese ho messo tutte le immagini dei menu in italiano.
    Versione per Mac, ma credo sia identico per Windows.
    Spiego passo passo cosa ho fatto:
    - Ho creato un file esempio con tre Livelli, salvato sulla scrivania e ho chiuso il file.
    - Ho aperto il file e selezionato il Livello al centro per iniziare a registrare una azione che ho chiamato: Save with Name of Selected Layer
    - Nuova azione
    - Dare il nome e premere Registra
    Ora salva…
    - Menu --> Livello --> Nuovo --> Livello... e premi -ok-, (lascia il nome che viene mostrato)
    - Ancora una volta Menu --> Livello... --> Nuovo --> Livello... e premi -ok-, (lascia il nome che viene mostrato)
    - Menu --> Livello --> Ordina --> Dietro
    - Menu --> Livello --> Unisci sotto
    - Menu --> Livello --> Unisci visibili
    - Menu --> Livello --> Nuovo --> Livello... e premi -ok-, (lascia il nome che viene mostrato)
    - Menu --> Livello - Nascondi Livello
    - Menu --> Elimina --> Elimina livelli nascosti (press -Yes-)
    - Menu --> Livello --> Nuovo --> Livello... Inserisci questo: 'Move this to the trash' e premi ok
    - Menu --> File --> Script --> Esporta Livelli in File... (Nella finestra che si apre scegliere l’opzione che si desidera, ma togliere il prefisso del nome) e premere -Esegui-
    - Selezionare il pannello Storia cliccare su Elimina premendo -Si- ogni volta che si apre la finestra di dialogo (Ripetere 8 volte questa operazione sino ad arrivare nella storia alla condizione di partenza. Ho visto che è meglio di Ripristina -F12-)
    - Fermare la registrazione.
    A questo punto, mandando in esecuzione questa Azione, ho raggiunto parzialmente l’obiettivo perché i file così creati mantengono, purtroppo, dei prefissi numerici per evitare probabilmente la sovrascrizione di file (credo senza avviso) nel posto dove vengono creati.
    Per ottenere l’obiettivo occorre un nuovo passo ed a proposito di questo riferisco quanto segue:
    ATTENZIONE - L’operazione descritta qui di seguito deve essere fatta su di una copia del file, per cui:
    - Duplicare il file,
    - Spostare l’originale in altra cartella
    - Lavorare sul file duplicato.
    mi riferisco a questo...
    ATTENZIONE - Questa modifica è effettuata a proprio rischio e pericolo ed il sottoscritto non si assume alcuna responsabilità su quanto venga fatto soprattutto da mani inesperte.
    ATTENZIONE - Questa modifica sovrascrive qualsiasi file che abbia nome uguale al layer che viene selezionato più l’estensione del file naturalmente.
    Comunque la modifica è banalissima e a portata di chiunque.
    Procedere così:
    - Chiudere Photoshop
    - Aprire (nel percorso specificato dall’immagine) il file “Export Layers to Files.jsx” (Export Layers To Files.jsx 1.0.0.16) con un editor di testo puro.
    - cercare la stringa (dovrebbe essere in riga 1029)
    var fileNameBody = fileNamePrefix;
    fileNameBody += "_" + zeroSuppress(i, 4);
    fileNameBody += "_" + layerName;
    - sostituirla con:
    var fileNameBody = fileNamePrefix;
    fileNameBody += layerName;
    - cercare la stringa (dovrebbe essere in riga 1047-46)
    var fileNameBody = fileNamePrefix;
    fileNameBody += "_" + zeroSuppress(i, 4) + "s";
    - sostituirla con:
    var fileNameBody = fileNamePrefix;
    fileNameBody += "";
    - salvare e uscire.
    - riavviare Photoshop
    - provare l’azione registrata facendo attenzione che il nome del layer non sia identico al nome di un file già presente altrimenti questo verrà sovrascritto.
    Domanda:
    Perché ho creato livelli che poi ho eliminato ecc.
    Risposta:
    Semplice per evitare errori di esecuzione delle azioni nel caso di operazioni con livelli mancanti o altro.
    Semplice... no?
    English version
    Mac version, but I think it's the same for Windows.
    First of all, I'm translating the actions that I made using the Italian version of Photoshop, you look at the position of the menu that I have chosen to do the work with other languages.
    I explain step by step what I did:
    - I created a sample file with three layers, saved to the desktop and I closed the file.
    - I opened the file and select the layer at the center to start recording an action that I called: Save with Name of the Selected Layer
    - New action
    - Give the name and press Save ( I think it is so in English )
    Now save ...
    - Menu -> Layer - > New —> Layer… and press -ok- , (leave the name that is shown)
    - Once again Menu -> Layer - > New —> Layer… and press -ok- , (leave the name that is shown)
    - Menu -> Layer - > Arrange (order) -> Behind
    - Menu -> Layer - > Merge Down
    - Menu -> Layer - > Merge Visible
    - Menu -> Layer - > New —> Layer… and press -ok- , (leave the name that is shown)
    - Menu -> Layer - Hide Layer
    - Menu - > Delete - > Delete hidden layers (press -Yes- )
    - Menu -> Layer - > New —> Layer… Enter this: ' Move this to the trash ' and press ok
    - Menu -> File - > Scripts -> Export Layers To Files... (In the window that opens select the option you want, but take away the name prefix) and press - Run -
    - Select the History panel and click Delete (on menu opened) pressing -Yes- every time when open the dialog box (8 times Repeat this step until you get into the story to the starting condition. Not use Restore -F12-).
    - Stop recording.
    At this point, by executing this action, I have reached the goal partly because the files created in this way remain, unfortunately, the numerical prefixes to avoid possibly overwriting of files (I think without notice) in the place where they are created.
    To achieve the goal we need a new step and thinking about this as follows:
    WARNING - The operation described below should be made on a copy of the file, so :
    - Duplicate the file
    - Move the original folder to another
    - Work on the duplicate file.
    WARNING - This modification is performed at your own risk and the undersigned assumes no responsibility on what is done mostly by inexperienced hands.
    WARNING - This change will overwrite any files with the same name as the selected layer plus the file extension of course.
    However, the change is trivial and within reach of anyone.
    Proceed as follows:
    - Close Photoshop
    - Open (in the specified path from the image ) file " Export Layers to Files.jsx " (Export Layers To Files.jsx 1.0.0.16) with a pure text editor.
    - Search for the string (should be in line 1029 )
    var = fileNameBody fileNamePrefix ;
    fileNameBody = + "_" + zeroSuppress (i, 4 ) ;
    fileNameBody + = "_ " + layerName ;
    - Replace it with :
    var = fileNameBody fileNamePrefix ;
    fileNameBody + = layerName ;
    - Search for the string (should be in line 1047-46 )
    var = fileNameBody fileNamePrefix ;
    fileNameBody + = "_ " + zeroSuppress (i, 4) + "s" ;
    - Replace it with :
    var = fileNameBody fileNamePrefix ;
    fileNameBody + = "";
    - Save and exit.
    - Restart Photoshop
    - Try the recorded Action, making sure that the layer name is not identical to the name of an existing file otherwise it will be overwritten.
    Question:
    Why I created levels which I then deleted etc..
    Answer:
    Simple to avoid errors of execution of the actions in the case of transactions with missing levels and other.
    Simple ... is not it?
    Sorry for my bad English...
    Thanks in advance for any hint.
    --->>> Please think about this... Adobe <<<---

  • Changing file name and directory structure for use outside of iPhoto

    Hi,
    I was wondering if its possible to get iPhoto to name the files from my library to reflect the names that I've given the files in iPhoto. I'm thinking along the lines of iTunes, where its possible to chose in the preferences how the files are named, and there is some logical directory structure, such as "Artist/Album/01 - Track 1.mp3". These file names are updated to reflect any changes made in iTunes.
    I've heard the argument that I shouldn't ever want to do anything with the files themselves because iPhoto can do everything I would ever want to do, but I want to organize the files so that not all of my organizational work is lost if I decide to stop using iPhoto and transition to a different system. Any suggestions would be appreciated.
    Thanks,
    Adrian

    Adrian
    No it's not possible.
    You can rename the files before bringing them into iPhoto, you can rename them with the titles on Export (Use the File -> Export command, it gives you the option to use the title and filename) but when it's inside iPhoto you cannot rename the files.
    However, all is not entirely lost. Using Film Rolls (View -> Film Rolls) you can move pics between rolls, name rolls, create rolls and so on, as long as you do this in the iPhoto Window, and these changes will be reflected in the iPhoto Library Folder.
    If at some point you decide to chuck iPhoto then (if the new app won't read iPhoto database files) you can simply export each album you've created to a Folder (using the File -> Export command as I suggest above), this, along with exporting slideshows will preserve your organisational efforts.
    The iTunes database has a rather simple job to do: track a file and it's assorted metadata. iPhoto, on the other hand, tracks a file and it's assorted metadata, plus a Modified version, plus a thumbnail. If you consider what happens when you edit a pic, for instance - Copy Original, perform edit, save modified version, remove Original Thumbnail and then create new one - you can see it's a rather more complex job.
    Finally, the standard warning: It is strongly advised that you do not move, change or in anyway alter things in the iPhoto Library Folder as this can cause the application to fail and even lead to data loss. Any changes you make must be made in the iPhoto Window.
    Need more info? by all means post again.
    Regards
    TD

  • I have used Image Capture to scan images/documents and then saved them as either PDFs or PNG files.  For some reason, just this past week Image Capture will no longer save the file.  It scans, and the Scan Results window pops up, but it won't save file.

    I have used Image Capture to scan images/documents and then saved them as either PDFs or PNG files.  For some reason, just this past week, Image Capture will no longer save the file.  It scans, and the Scan Results window pops up, but it won't save file.
    The file name has no special character in it, just letters and no spaces.
    I have done this in the past and it has worked, but now it will not.
    I have not upgraded any software, that I am aware of.
    After scanning, the Image Capture pops up the Scan Results with the file name in the window, but neither the Scan Results nor the Image Capture window responds to inputs.  The Image Capture window is frozen, with only the "Overview" and "Cancel" buttons active (but non-responsive).
    Is this a software issue or a scanner hardware issue?  I am using a HP Photosmart C6200 series printer/scanner on a network using a Time Capsule airport.
    Thanks.

    I had the same problem.
    Got a 90% fix.  Apparently the Mavericks preferences won't work with Yosemite, so I just deleted the Image Capture preferences.
    Unfortunately, the "Scan to" folder seems to be permanently set to the Pictures folder.
    1.  Quit Image Capture
    2.  Go to Finder > Go > Home, which opens up your home folder (named after your user name)
    3.  Open Library > Preferences > com.apple.ImageCapture.plist - Drag this file to the Trash
    4.  Start "Image Capture", click "Details" and change all your settings as you prefer
    5.  Quit and restart "Image Capture".   Notice it remembers all your settings except "Scan to" folder.  It insists on saving to "Pictures".
    That's as far as I was successful.  I tried changing the "Scan to" folder to "Desktop", but on launch, Image Capture always sets it back to "Pictures".
    This is what I tried:
    6.  Download and install "Pref Setter" from http://www.nightproductions.net/prefsetter.html
    7.  Quit "Image Capture".  Right-click on "com.apple.ImageCapture.plist" and open with Pref Setter.
    8.  Search for "Pictures", which finds "~/Pictures" (the tilde character at the start means your home directory).
    9.  Double-click on "~/Pictures" and change it to the folder you prefer.  I like "~/Desktop"
    10. Choose File > Save then Quit from Pref Setter.  Note that re-opening the plist file still shows "~/Desktop"
    11. Start up "Image Capture" -- on startup, "Image Capture" sets "Scan to" folder to "Pictures"
    I consider this a bug.

  • Open dialog window closes suddenly on Illustrator and Photoshop

    Hello,
    open dialog window closes suddenly on Illustrator and Photoshop

    PPI is the correct word for an image's resolution.
    As for printing: ask the service provider what's best for their workflow. It totally depends on the process, on the hardware, on the paper and on the size of the print.
    For video: use screen resolution unless you want to enlarge the footage in the video.
    Additionally:
    read the manual of the video software in use
    read about printing:
    Search for the "Creative Suite® 6 Printing Guide" in your preferred search engine.

  • I used to be able to copy or drag and drop links from the address window. Now with the update, only the address is copied or dragged not the link. (Says something about not giving site information). I want to be able to drag and drop or copy links.

    Question
    I used to be able to copy or drag and drop links from the address window. Now with the update, only the address is copied or dragged not the link. (Says something about not giving site information). I want to be able to drag and drop or copy links.

    To be more precise, you can setup a JComponent or JPanel on top of your JavaFX nodes that has a TransferHandler that can convert the (AWT/Swing) images dragged to the app to JavaFX image and then insert it into the underlying node.
    As for the file chooser itselft: ListView and the JavaFX composer can allow you to create one quite easily. TreeView can aslso be used to a lesser extend (still a big buggy). For both of these, there are small bugs in the Cell API that may (or may not) prevent from displaying a proper thumbnail in the cells.
    You can also use a regular JFileChooser if you do not mind the dialog box having a different LnF from the rest of your application.

  • How can I get a pdf. to open in Safari, all i'm getting is a new window with a black, blank page, instead of the pdf., and I don't want to save the file to the desktop, Safari didn't use to do that, and I don't have Adobe in the internet plug in folder.

    How can I get a pdf. to open in Safari, all i'm getting is a new window with a black, blank page, instead of the pdf., and I don't want to save the file to the desktop, Safari didn't use to do that, and I don't have Adobe in the internet plug in folder.

    Hi
    Please take a look to this thread Re: Can I refresh the browser rather than open a new tab?

  • My computer is saying it can't find the file 'iTunes64.msi' when I try to update or redownload iTunes how do I fix this? I've tried just about everything I can think of. I am using a dell laptop running windows 7 and have tried changing the file loca

    My computer is saying it can't find the file 'iTunes64.msi' when I try to update or redownload iTunes how do I fix this? I've tried just about everything I can think of. I am using a dell laptop running windows 7 and have tried changing the file location to run the update in all of my iTunes files as well as when I've tried reinstalling it.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
    Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
    tt2

  • I'm having trouble formatting a book I'm writing using Pages. I need to put my name and book title in the upper left hand corner of EACH page- opposite the page number. How do I do this?

    I'm having trouble formatting a book I'm writing using Pages. I need to put my name and book title in the upper left hand corner of EACH page- opposite the page number. How do I do this?

    And if this is the new IOS Pages v2 (or the older IOS Pages 1.7.2), you click the wrench icon and then Document Setup. Tap the document header to edit it, and apply the same instructions that I gave previously for OS X Pages v5.
    The process for Pages ’09 v4.3 is slightly different. You click the Header, and enter your document title and your name as previously described. You will need Menu > View > Show Ruler. Click once in the ruler at the first or second mark after the 7 inch (roughly 18cm). This will set a tab. Now position the insertion mark behind your title and tab once to the mark you set. Now you can Menu > Insert > Auto Page Numbers ...

  • I have backed up my iPad  using iTunes to windows 8 Lenora laptop but I could not find my files and play video files  in my laptop.

    I have backed up my iPad  using iTunes to windows 8 Lenora laptop but I could not find my files and play video files  in my laptop

    You cannot access files in the backup on your computer.
    Do you mean that you synced with iTunes and transferred your purchased videos and app documents? If that is what you mean, what videos are you talking about? If they are videos that you took with the iPad, they do not sync to iTunes. What files?
    What exactly are you trying to do? Details please.

  • Brand new user I have plugged in my external Hard which I was using for my windows laptop into my IMAC and it now appears I have lost all of my files is there any way I can recover these ?

    Brand new user I have plugged in my external Hard which I was using for my windows laptop into my IMAC and it now appears I have lost all of my files is there any way I can recover these  I didn't know that you should reformat

    only if you have a backup can you recover

Maybe you are looking for

  • Duplicate apps launching

    In Mavericks 10.9.5 I've been having duplicate copies of apps launching. I've noticed it w/Mail & Acrobat Pro. Don't know what causes it - can't duplicate it intentionally, just noticed that it's been happening lately.

  • Calling .ejb from .ejb

    I am using Weblogic Workshop WLS8.1. I have one .ejb calling another .ejb. Appearenlty, MyBeanHome.java MyBean.java resolve in the workshop. But they are not resolving when I use ant build. Any suggestions. Thanks

  • Using names instead of codes in our forms.

    I have two tables: 1. Table A which has next 3 fields: Code: CHAR 2 Name: VARCHAR2 40 Code_B: CHAR 1 2. Table B which has next 2 fields: Code: CHAR 1 Primary key Name: VARCHAR2 40 Between the table A and the table B there is a relationship which is m

  • HD Input from Blackmagic Intensity Shuttle for USB 3.0 to FMLE 3.2

    hey guys.. I am using backmagic intensity shuttle usb 3.0 capture card to capture the 1080p video. Now the problem is when I am taking video input in FMLE 3.2. It only shows the video in 720X482 Resolution and at 59.92 fps only. while selecting other

  • I have to pay per month for using airport express?

    I have to pay per month for using airport express?