How to delete .pdf file after viewing in SAP

Hi,
I've a program to show a pdf file within a SAP window using the open document method form the class cl_gui_pdfviewer. Now I want to delete the pdf file once I choose the back button or exit the program. How can I do that.
In the PAI for the screen showing the pdf file, I have a case statement to perform the following
  When 'EXIT'
     call method my_pdf_viewer->close_document.
        .....    <--- some coding to try deleting the pdf file
     leave program.
endcase.
It seems that the pdf file is still in use by the program and cannot be deleted before leaving the program. Please help.
Thanks in advance,
Francis

Hi All,
I have had this issue and have finally resolved it.  Here's how:
you need to destroy your custom container and html viewer control AND flush the front end cache.  This releases the lock on the file and lets you then delete it.
Here's an example code:
When 'EXIT'
call method my_pdf_viewer->close_document.
  CALL METHOD my_pdf_viewer->FREE
    EXCEPTIONS
      CNTL_ERROR        = 1
      CNTL_SYSTEM_ERROR = 2
      others            = 3
  IF SY-SUBRC is initial.
    free my_pdf_viewer.
  ENDIF.
this is the custom control parent container that contains the html control
  CALL METHOD MY_CONTAINER->FREE
     EXCEPTIONS
       CNTL_ERROR        = 1
       CNTL_SYSTEM_ERROR = 2
       others            = 3
  IF SY-SUBRC is initial.
    free my_container.
  ENDIF.
  CALL METHOD cl_gui_cfw=>dispatch.
  CALL METHOD cl_gui_cfw=>flush
        EXCEPTIONS CNTL_SYSTEM_ERROR = 1
        CNTL_ERROR = 2.
... <---- Delete PDF file (Delete Dataset xxxxxx.pdf)
leave program.
endcase.
The other issue brought up is probably a permission issue -- trying to read the file from the presentation server versus a mapped drive that the SAP backend can access.  I read pdf files from a shared drive that the SAP backend can read/write to and it picks it up and displays just fine.
Cheers,
Matt

Similar Messages

  • How to delete pdf files in iBooks on mac?

    Accidently, I added hundreds of pdf files from my dropbox into iBooks.
    I manually tried to delete pdf files, and I found that some of them were deleted, but the rest of them haven't been deleted.
    I tried and tried, but failed.
    I couldn't even open the pdf files at all.
    I accessed the "library folder >>> ..... >>> ibooks" and deleted all the files their, but still the "ghost" pdf files are shown in iBooks.
    Any idea?
    Thanks!!

    I've not long worked out how to do basic things on my iMac but have had some coaching on other forums, as it goes this happened to me this morning.
    Inadvertently, I managed to get all pdfs into ibooks and faced similar "delete" problem, couldn't drag the files out of ibooks either: Accidentally I found all ibooks info in a library through finder, took a while but right clicking "move to trash"  got rid of them but not from pages/documents!
    Re-opening ibooks initially showed the pdfs still in place, except after double clicking one a message appeared telling me the file could not be opened, then immediately the remaining books were shuffled and pdfs disappeared - still in documents though, and able to open.
    Hope this helps, there may well be an easier way...

  • How to delete PDF files?

    I want to delete 3 pdf files I no longer need.  There is no "delete" on the pre for them; no info in the pre handbook.  How can I delete these pfd files?
    Post relates to:

    You need to connect the Pre to your desktop to delete PDF files...at least for now.  This has been previously covered in the thread linked below (and others):
    http://forums.palm.com/palm/board/message?board.id=webossoftware&message.id=3557&query.id=69944#M355...
    smkranz
    I am a volunteer, and not an HP employee.
    Palm OS ∙ webOS ∙ Android

  • How to delete PDF files on an ASUS MemoPad

    On an ASUS MemoPad there are files that the Adobe Reader can open that I want to delete.
    I connected the ASUS up to a computer to look at the ASUS file directory using WindowsExplorer.
    Some of the PDF files on the ASUS were found.
    But not all of them,
    The way I placed some of the PDF files onto the ASUS was by attaching them to e-mails;
    others were downloaded in links that I got to web-sites.
    Could this be the problem?
    Are certain PDf files on the ASUS "hidden" from view in the directory
    because they are attached to an e-mail?

    PDF files that are attached to an email message are not stored separately on your disk, unless you perform 'Save attachments'.  When you open a PDF that is an email attachment, it is temporarily stored in your Temp folders, but deleted from there once you close Adobe Reader.
    The same is true for PDFs that you directly open from a website, unless you explicitly download it.

  • ITunes 11 how to delete PDF files out of the categorie "books"

    I imported some PDF files into the iTunes 11 mediathek under the categorie books!
    How can I delete some of those PDF files?

    got exactly the same problem, can't delete books, backspace key and delete from option from drop menu does not wok....
    Ok, problem solved.
    You have to remove books from the itunes library, not from the iphone library. Just do it when iphone-ipad is disconnected.

  • How to delete pdf files created on server using cfdocument pdf?

    I am using <cfdocument format="pdf" ...
    to create a dynamically named and generated .pdf and it works rather well.  Navy managers can easily email the pdf to ships in the fleet and planning forces in the shipyards. (Planning data changes almost daily). However I have noticed that the pdf file stays on the server.  Over time this could become a problem with numbers.  Is there something I am missing to remove these pdfs over time.  Other than a manual review and delete.  This government server requires 4 logins and your right arm to update, so something auto is needed.

    Thanks for responding:
    I am not using cfmail - I am leaving it up to the user to print save or email.
    Your second option sound good but I really was hoping I was just missing something easy (new to cf).
    I did try giving the pdf the same name but I was having lots of troble with always returning the cached version.

  • How to delete log file after zipping in batch

        
        **please check my code ... and suggest any changes to be made ... i m able to zipp the logs but not able to delete those logs.........
            thanking you...
            this is my code....
            @echo off
            set zip="C:\Program Files\7-Zip\7z.exe"
            rem Findout Month, Year and Date
            FOR /F "tokens=1,2,3,4 delims=/ " %%A in ('Date /t') do set year=%%D
            FOR /F "tokens=1,2,3,4 delims=/ " %%A in ('Date /t') do set month=%%B
            FOR /F "tokens=1,2,3,4 delims=/ " %%A in ('Date /t') do set day=%%C
            rem Solve problem Year start and adding 0 in month
            if %month% EQU 01 (
            set month=12
            set /a year=%year%-1
            ) else (
            set /a month=%month%-1
            if %month% LSS 10 set month=0%month%
            rem Set file names for last month file.
            set lastmonthfiles=server.log.%year%-%month%-
            %zip% -tzip  a -y "%lastmonthfiles%.zip" %lastmonthfiles%*
            if exist %lastmonthfiles%.zip(
            DEL server.log.%year%-%month%-*
            ) else (
                echo file not found
                pause

    Actually it is only the 7Z filemanager that can delete files using the "Move" command and the "Delete after archiving" option.
    if EXIST %lastmonthfiles%.zip ( DEL server.log.%year%-%month%-* ) ELSE echo zip not found
    ¯\_(ツ)_/¯

  • When I open a pdf file, after a few seconds, it hides the toolbar and I don't know how to get it back.  I use multiple monitors and, without being able to grab the toolbar, I am unable to move the pdf file to a different monitor.  How do I stop this?

    When I open a pdf file, after a few seconds, it hides the toolbar and I don't know how to get it back.  I use multiple monitors and, without being able to grab the toolbar, I am unable to move the pdf file to a different monitor.  How do I stop this?

    Does Firefox switch to full screen if you press F11 ?
    You can also try the F10 key to see if that brings up the menu bar.
    * If the above steps didn't help then see http://kb.mozillazine.org/Corrupt_localstore.rdf
    Note: Do not delete localstore.rdf in the program folder (Windows: "C:\Program Files\Mozilla Firefox\defaults\profile\") (Mac: "/Applications/Firefox.app/defaults/profile/")

  • How do you delete .pdf files?

    How do you delete pdf files from android Adobe Reader?  I  can delete the files, how do I
    delete the file name from the Adobe Reader file list, especially duplicate file names.
    someone  please help me. this will have to be done from  within the Reader, I  think. ?

    The full instructions are here: http://learn.adobe.com/wiki/display/readermobile/Android+FAQ.
    Ben

  • How can I delete PDF files from my iMac desktop?

    How can I delete PDF files from my iMac desktop?

    Not on my system,When I try to dump if off in the trash it will not go. I get a message that says this file cannot be removed. I also tried going to File and clicking on Move to Trash. No dice.

  • How do I look at pdf files after installing adobe reader?

    how do I look at pdf files after installing adobe reader?

    Start Adobe Reader
    Use the menu File > Open...
    Select the PDF file

  • How to make pdf file auto open with adobe reader after downloaded

    how to make pdf file auto open with adobe reader after downloaded

    I note from your system details that you have the plugin for adobe pdf s so I would have expected the files should open in firefox '''without''' you needing to explicitly download them.
    Once the files are open in firefox, you will also get the option to save them permanently to a location on your computer. If you wish I suppose you could set the file type pdf to be associated with and be opened by firefox instead of with the Adobe Acrobat Reader, but that would just seem to be an additional complexity.

  • How can I recover an involuntarily  deleted keynote file after trash?

    After 3 days of working in Keynote I moved several files to my new 250gb hard disk. Many files were moved to trash and deleted. My work in keynote was lost and I have tried everything to recover it. Can you help me with this..? Is there a trick to recover a deletd file from trash...? Is there a recover-data file in my computer..? Thanks
    Unease

    How can I recover an involuntarily deleted keynote file after cleaning trash ..?

  • How to open *.pdf files in BOXI r2 inbox

    I am scheduling as  *.pdf file for deski report.After scheduling i am getting *.pdf in my inbox.if the report is deski or webi we can use FC_REPORT_ENGINE or WI_REPORT_ENGINE to open the report's using java code.In same way how to open *.PDF file in Inbox?
    Edited by: ramkishore kishore on Nov 7, 2008 8:31 AM
    Edited by: ramkishore kishore on Nov 7, 2008 8:31 AM

    Hi Ram,
    Following information might help you to resolve the issue.
    After logging into Desktop Intelligence, you may be presented with a message stating:
    u201CYou have received 1 document from users"
    Examining the Inbox from within the Desktop Intelligence client shows no objects visible in your Inbox.
    The object in your Inbox is in a format other than Desktop Intelligence format such as, PDF, XLS or other format. Therefore the object is not recognized by the Desktop Intelligence client inbox browser.
    Log in to Info View or the Central Management Console, browse to your Inbox and verify the file name and format that has been sent to your Inbox. The object may be saved, copied, moved or deleted as necessary.
    Regards,
    Sarbhjeet Kaur

  • Deleting PDF files using Adobe Acrobat Standard XI

    I can't delete PDF files I created myself. I get the error message I don't have access to edit, see snapshot above. I am the administrator of my own laptop. Browsing this forum helps me to locate the same query as mine but no exact answers/steps of how to bloody delete the damn files. *sorry, bit annoyed of the run-around links & not found pages* Any help would be appreciated. Thank you in advance.

    I want to just delete closed PDF files. And I know how to delete using Del button or Right Click > Delete. The problem is I get error message saying the file I want to delete, can't be deleted.
    I tried a number of combinations with Preview enabled & disabled, but still won't let me delete the files. I haven't tried exiting/closing Acrobat AFTER disabling Preview THEN deleting the PDF files, will try this. But if this is how I'm supposed to delete files in Adobe XI from now on, come on, seriously?! I work with a lot of PDF files. I shouldn't have to close down the application (Acrobat) just to delete the closed PDF files using my File Explorer view. It's like having to exit Word each time I want to delete closed .docx files.
    Will try & advise.

Maybe you are looking for

  • File Open Failed?

    H'ello Sometimes when I try to transfer a book I have downloaded to ADE to my ereader I get the error message: File Open Failed.Other times they are successfully transfered. These are all downloaded from my library - so all consistently the same. Hel

  • I'd like to cancel/erase my account, how can I do that?

    see above. I have a test version of In Copy. I just want to get rid of the account. I don't want to use Adope Cloud anymore. Thanks.

  • Only getting an empty file.

    I know that my propertiesSystem object has stuff in it because I can see it on the Eclipse Console, but I cannot figure out why it won't write the information to the SystemProperties.txt file. Properties propertiesSystem = new Properties(); propertie

  • Edge Animate CC June 2014 Update Paste Problem

    When i try copy & paste an object in edge animate, it gives me an error saying "An error occurred. Please save your work and restart Edge Animate" Any solutions ?

  • Antivirus on windows (installed via VMWare Fusion)

    if i will install windows xp home on my macbook (using VMWare Fusion), should i need to install an antivirus software on my macbook for the windows? or should i install the antivirus straight on the windows OS? will my macbook be placed at risk for v