Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Use

More and more customers complain about the creation of a local copy, if you display an original in a DMS transaction. This copy is put on the user's PC and normally remains there also after closing the display. As this is causing a loss of space a lot of customer want to avoid this creation process.

Solution 

 To achieve this there exists the BAdI method DOCUMENT_FILES01~AFTER_START_APPL, where you can have an implementation like the following, which might help to solve your problem. This deletes the file even when the user is viewing the file. So no copy will be left on the PC of the user.

method IF_EX_DOCUMENT_FILES01~AFTER_START_APPL .
  DATA :
         l_str_file  TYPE string,
         l_i_retval      TYPE i.

  l_str_file = TARGET_FILE-FILENAME.

  CALL METHOD cl_gui_frontend_services=>file_delete
        EXPORTING
          filename             = l_str_file
        CHANGING
          rc                   = l_i_retval
        EXCEPTIONS
          file_delete_failed   = 1
          cntl_error           = 2
          error_no_gui         = 3
          file_not_found       = 4
          access_denied        = 5
          unknown_error        = 6
          not_supported_by_gui = 7
          wrong_parameter      = 8.
endmethod.

Back

4 Comments

  1. Former Member

    When this is implemented, is it still possible to do redlining with the ECL viewer?

  2. Guest

    I find this doesnt work as the application is still open and the file cant be deleted because its being used by the application, is this correct?

  3. This works with files opened within the SAP GUI using "%SAP-OFFICE-INTEGRATION.INPLACE%" but as John mentioned earlier when the GUI passes the filename to another application it either cannot be deleted by this BAdi (due to the file lock) or with slow loading applications (e.g. powerpoint) the BAdi deletes it before the application loads and opens it.

    We have multiple viewers (ECL & AutoVue) so I plan to add a method that checks the Application Types config to decide if this file_delete method should be called.

  4. Guest

    Did anybody find solution for this? The files are not deleted since its still being used, just like John said.

    Sorry, my Basis guy put a trace log on the SAP RFCHTTP, thus the issue.Once he removed the trace, no more files!! (big grin)