BSP & DMS Document Download

Hi All,
I'm developing a BSP which can download a folder with documents present in SAP's DMS, to c:\temp.
At the moment I use the EasyDMS function "Z_EASYDMS_FOLDER_EXPORT".
During development, it worked fine because I was going through the program in debug mode. Therefor, the SAPHTTP can connect with the SAP gui.
But when running "normallly" (not in debug), the program runs in error. It turns out that the SAPHTTP (nor SAPFTP) cannot connect and thus the documents cannot be downloaded.
I also tried to use call functions: CVAPI_DOC_CHECKOUTVIEW, SCMS_HTTP_GET_FILE and HTTP_GET_FILE, but all with no result. I also tried to call SAPFTP & SAPHTTP directly via "SYSTEM_START_REG_SERVER" and via the build of a command and the function "RFC_START_PROGRAM".
Again, with no result. The BSP runs in an error (HTTP 500 internal server error).
As this is an urgent development, help would be very much appreciated!!!
Regards,
Sander

Hi,
Please follow the steps to Download a file from DMS or Display in Browser.
1. Call BAPI  'BAPI_DOCUMENT_GETDETAIL2'
  call function 'BAPI_DOCUMENT_GETDETAIL2'
    exporting
      documenttype         = document_key-doctype
      documentnumber       = document_key-docnumber
      documentpart         = document_key-docpart
      documentversion      = document_key-docversion
      getcomponents        = 'X'
      getdocdescriptions   = 'X'
      getdocfiles          = 'X'
      getclassification    = 'X'
    importing
      documentdata         = documentdata
      return               = lv_return
    tables
      documentdescriptions = it_documentdescriptions
      documentfiles        = it_documentfiles
      characteristicvalues = it_characteristicvalues
      classallocations     = it_classallocations.
2. Then call BAPI_DOCUMENT_CHECKOUTVIEW2
documentfile-wsapplication = it_documentfiles-wsapplication.
call function 'BAPI_DOCUMENT_CHECKOUTVIEW2'
      exporting
        documenttype    = document_key-doctype
        documentnumber  = document_key-docnumber
        documentpart    = document_key-docpart
        documentversion = document_key-docversion
        documentfile    = documentfile
        getstructure    = '1'
        getheader       = 'X'
        pf_ftp_dest     = 'SAPFTPA'
      importing
        return          = lv_return
      tables
        documentfiles   = it_co_documentfiles.
You need to pass PF_FTP_DEST as SAPFTPA as we are calling this FM from Browser not SAP GUI and if you dont pass this value then the FM errors out because it doesn't find SAP GUI.
3. Now call SCMS_DOC_READ to get the Binary Data of the File.
call function 'SCMS_DOC_READ'
    exporting
      mandt                 = sy-mandt
      stor_cat              = c_storage
      doc_id                = it_co_documentfiles-file_id
    tables
      access_info           = lt_access
      content_bin           = lt_sdokcntbin.
IT_SDOKCNTBIN is the Binary Data Table of the file you want to download.
Now you have the binary file data which you can write on Application Server or Convert it to XSTRING and show in a web dynpro application. I am not sure how to display in BSP.

Similar Messages

  • Print a dms document from BSP Page

    Hi,
    I need to send a DMS Document to the local printer directly with out opening it in SAP BSP.
    I was able to download it to Desktop. but requirement is to send it directly to the printer.
    Please help..
    Thanks..

    Hi,
    I need to send a DMS Document to the local printer directly with out opening it in SAP BSP.
    I was able to download it to Desktop. but requirement is to send it directly to the printer.
    Please help..
    Thanks..

  • DMS Document upload: does it pass through sap DMS ?

    Dear All,
    We have a question concerning the transmission of documents from the client to DMS and the Content Server: does the document need to pass through the sap server ?
    Document upload (create document CV01N)
    Does the document go directly from the client to the Content server OR does it pass through the sap DMS before to be stored in the CS ?
    Document download (read document CV03N)
    Does the document go directly from the CS to the client OR does it pass through the sap DMS server ?
    This could be interesting to know for network performances.
    best regards,

    Hi Gurus
    is the cache server a default funtionality from the content server or any configuration is required from our part.
    is that the cache server acts as the RAM of our system?
    please explain the partitioning or biferfication of the Content server, as you told
    content server is divided into storage catagories and  this in turn in to content repositories,
    please  clarify below points,
    1)any server or PC can be made as Content server by insatalling the content server CD if iam right ?
    2) Practical and funtional benifits of partitioning content server into content repositories is it for authorization and storing data by naming convection or can it also help in copiying data from a specific content repository if needed, ( is content repositories a logical partition or practical partition like B,C,D, F drives of our PC hard disk)
    3) can /should there be multiple content server installation for a particular (production) client.
    4) Can Archiving  be done say by creating a separate content repository inside the same Content server, or is it mandatory to have a separate archiving server itself,
    please give some idea with examples
    Thanks and regards
    Kumar

  • DMS (document management) integrate document in product

    Hello,
    I want to integrate documents in my products (crm) in background. My documents are located in my server sap. ( so I have a URL of my document : file://server/folder/test.doc)
    I have found only one mean. I try to use DMS (document management service) programming interface with the FM
    1 - SDOK_LOIO_CREATE : I create a logical document
    2 - SDOK_PHIO_CREATE : I create a physical document
    but after..?
    when do I download my document? when do I create the link with my product?
    There is a documention here
    http://help.sap.com/saphelp_crm31/helpdata/fr/15/aea9375d79fb7de10000009b38f8cf/frameset.htm
    but it is not enough for me.
    Can you help me, please?
    Say me it's possible with DMS...
    an example of coding is helpfull..
    which FM uses..
    Many thanks in advance for anything help,
    Servane,
    nb: I have tried to use BDS services but it use only in foreground.

    no idea?

  • DMS document in Portal UWL

    Hello,
    I have the following requirement:
    1 - Workflow is created after the invoice image is attached to the FI document (the imagem is stored in a DMS document linked to the FI Document).
    2 - The workitem is created in the UWL. This workitem has a link to the image. When the user double clicks, the image (jpg for example) appears in the windows viewer.
    This is all. Is there any way I can do this? I see several theoritical solutions:
    1 - Retrieve the image URL (I don't know how to do this)
    2 - Attach the DMS document to the workitem. This is not good because a WebGUI windows would open with the DMS object, not the image.
    3 - ?
    Suggestions?

    Thanks Manasa.
    But my question is how to get a document from SAP - DMS (say CV03N).  If I get a document then I can convert and make it display on the BSP screen. 
    Thanks,
    Krish

  • Block deleting DMS Document from user that is not initiator

    Hi All
    Hello
    I Want to Block deleting DMS Document ((CV02N)
    form all users that are not the initiators of the Document or
    Bolcking for all user
    for that I created new user authrization for CV01N,CV02N
    without authorization for delete
    I created a DOC in SPS (production) No 3001591
    but I successed to delete the doc through cv02n
    in the buttom icon for delete original
    There is an option to block any user or specific form delete document ?
    If there is no option for that there is an user exit that I can used ?
    Thanks in advanse for your help

    Hello,
    it is possible to extract DMS's file to application server directory:
    FUNCTION Z_DMS_VIEW.
    ""Interfase local
    *"  IMPORTING
    *"     VALUE(DOC_NUMBER) LIKE  BAPI_DOC_DRAW2-DOCUMENTNUMBER OPTIONAL
    *"     VALUE(DOC_PART) LIKE  BAPI_DOC_DRAW2-DOCUMENTPART OPTIONAL
    *"     VALUE(DOC_TYPE) LIKE  BAPI_DOC_DRAW2-DOCUMENTTYPE OPTIONAL
    *"     VALUE(DOC_VERS) LIKE  BAPI_DOC_DRAW2-DOCUMENTVERSION OPTIONAL
    *"     VALUE(ORIGINAL_PATH) LIKE  BAPI_DOC_AUX-FILENAME OPTIONAL
    *"  EXPORTING
    *"     VALUE(P_RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
    *"  TABLES
    *"      DOC_FILES STRUCTURE  BAPI_DOC_FILES2 OPTIONAL
      CLEAR:   doc_files.
      REFRESH: doc_files.
      DATA: i_doc_files like bapi_doc_files2.
    DATA: i  type i.
    i = 2.
    while i = 2.
       i = 2.
    endwhile.
      CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEW2'
        EXPORTING
          DOCUMENTTYPE    = DOC_TYPE
          DOCUMENTNUMBER  = DOC_NUMBER
          DOCUMENTPART    = DOC_PART
          DOCUMENTVERSION = DOC_VERS
          DOCUMENTFILE    = i_doc_files
          GETSTRUCTURE    = '0'
          GETCOMPONENTS   = 'X'
          ORIGINALPATH    = ORIGINAL_PATH
          HOSTNAME        = ' '
          GETHEADER       = 'X'
          PF_HTTP_DEST    = 'SAPHTTPA'
          PF_FTP_DEST     = 'SAPFTPA'
        IMPORTING
          RETURN          = P_RETURN
        TABLES
          DOCUMENTFILES   = DOC_FILES.
    ENDFUNCTION.
    ORIGINAL_PATH must be a directory of application server.
    By background is not possible (I don't know how can we do that) download thsi file to PC.
    Then with the file in application server we can :
    - to map application server directory in a drive unit of Pc
    - to transfer with a ftp client from Pc
    - rfcexec
    But always the bapi can not download the file: it must be a process in Pc who transfer the file.

  • Print DMS Document from Material master

    Hello All,
    Can you advice on how to Print the DMS Document as a smartforms  from Material master ?

    Hi Arvind,
    You have mentioned two different terminologies here.
    DMS
    Material Master
    From DMS, you need to download the attachment and the same attachment can be converted using the FM CONVERT_TO_OTF then try displaying the same into your smartform.
    I'm not aware of Material Master Document attachment.
    Will reply soon with that solution also.
    Regards,
    -Wahid Hussain.

  • Problem with Excel hiperlinks in DMS Documents

    Hi. I have a very strange problem. I add several excel files to a DMS document and I archive them in a server.
    These files contain several sheets and a lot of hiperlinks to different parts of excel file. When I open these excel files to see them, Excel open them but the hiperlinks don't run. Excel shows me next message: "Unexpected error".
    I have analyzed the excel documents and I've seen SAP is protecting all cells and sheets (before I archive them, they are unprotected) and, if I download them to local disk, they are "only reading".
    I hope somebody can help me.
    Best regards, Iván.

    so you're links are also working when you move you're excel files to a different folder ?? and when you move the files to different folders ?
    even when you link between files it is still imperative that the file knows where it links to and can find the location. when you upload the files to SAP they get a new location in the vault. which doesn't necessary has to mean that they will be placed alltogether in the same folder in the vault.
    I'm nog very familiar with the DMS customizing but perhaps there are a few options over there you can check.
    we use dms only to store the location of our files. so the excel files remain on the same location as they are now. only in dms the link towards the file is maintained with all the additional info.
    first question in customizing dms is whether you want the files accesible from outside SAP or want to use a SAP fault. we choice the first since other applications also need to access the files directly.

  • DMS document output in SOP report

    Hi all,
    I want to OUTPUT a DMS document in SOP Report template. But it is not reflecting in my SOP report  though I have fullfilled the prerequisites.Here are my steps that i carried out
    1)  I have linked the DMS doc. in a value assignment in user defined text.
    2) The DMS document type is SBV.
    3) The required document indicator tick is alos ensured in specify user defined text types in BASIC DATA & TOOLS in customizing.
    3)It is also ensured that the EHS <> DMS doc types are linked in customizing.
    4) I put the symbol in wwi report template under GESTDHEADE HEADER User-defined text .
    But when I run the preview (cg42) the space where I have assigned the symbol is blank.
    I even tried to put my required data in Long text in user defined text tab assigning REMARKS as user defined text type but there is no output in  REPORT when i carry out preview.
    Requesting your  comment what shall be the cause of this .
    Regards,
    Ashish pradhan

    Hello all
    the document type SBV should not be used or used only carefully regarding this. I recommend to use a customer specific document type. SBV is related to WWI report templates. Furthermore make sure that generation variant fits usage of data record in which you have set up the document which is located in the user defined text (Active indicator of usage must be set). I know cases in the area of access problemes so that the WWI could not retrieve the user defined document. PLease make sure that you have "checked" WWI layout without error (WWI Check).
    PLease check this:
    if you have uploaded e.g. an rtf file and created a value assignment and you have uploaded the document to be stored in the user defined text than the document is "there". That means: in this process the SAP EH&S process generate a new unique id which should show up in the user defined text (there somthing like this should show up: SBV WWI 0000111223 numbers...)
    Using this unique ID you can check if the document is really in DMS available. Furthermore depending on the EH&S release (support package etc.) you could check this. If you "click" with the mouse key on the unique id (refer above) the SAP EH&S system should upload directly to your client computer the document and start immediatly the corresponding application (e.g. word etc.) . In doing so you can check if the document is "really" there
    May be you need to check further DMS customizing. E.g. depending on the document you have used in upload there is a missing link to the "type" of document. .E.g. the EXCEL macro regarding standard SAP output variant links to I believe a seperate document type
    Hope that helps
    With best regards
    CB

  • DMS Document Type - Repository

    Hi Experts,
    Need a help.
    Is this possible to link DMS document type (created with help of DC20) with dedicated content repository (OAC0)?
    Regards
    Adam

    Hi Adam,
    If you do not select the "KPRO" indicator then your original files will get uploaded on SAP database with different storage category.
    You can have different category for different document type...provided while uploading the document/file from CV01N/CV02N you should select the correct category from the pop up.
    Thanks
    Pravin

  • DMS document attachment to Service Entry sheet

    Hi All,
    One requirement, need to attach DMS document with Service entry sheet (t-code ML81N), any possibilites with object linking as in standard there is no object linking (ESSR object) available.
    Thank You,
    Manoj

    hi,
    1. I think u could use services for objects is the best way to fulfil requirement.
    note: a. If u want to use ESSR as business document. u need to go for Archive linking and store document as business
                  document in Services for objects.
    2. If u going to use standard object linking from DMS for 'ESSR' object so for not exist.
        Note:reason is not required any DMS object linking here as i guess. Coz u will be creating Entry sheet agianst Purchase
                orders and vendors too.
                 IN PLM, u can maintain DIR in purchase order or u can maintain in vendor masters. any how u r filling WBS nor also in
                 basic data sheeet of ML81N.
                 So datacan be easily tracable due to all are interconnected each other.
    3. If u want to use ESSR as object link from DMS u need go for development. but this is not required as i guess.
    Benakaraj
    ??P

  • DMS document attachment with Incoming Invoice

    Hi All,
    We are creating one DMS document and want to attach it to an Incoming Invoice (MIRO).
    We are using the bapi BAPI_DOCUMENT_CREATE.  What are the fields to pass in Objectlink.
    Please help us to achieving it.
    Thanks

    We have created an Incoming Invoice already using 'BAPI_INCOMINGINVOICE_CREATE'. We are now creating a DMS document using 'BAPI_DOCUMENT_CREATE' and want it to be linked to the existing Invoice. For this we are trying to use the 'OBJECTLINKS' table.
    The linked document should be visible in T-Code FBL1N. Can you please throw some light on how to do this?
    Edited by: Himansu.P on Jun 14, 2011 3:06 PM

  • DMS document from Cache server!

    We are able to retrieve DMS document(PDF) from Content server but not from Cache Server using URL generated from
    CALL FUNCTION 'SCMS_URL_GENERATE'.I even tried Pushing the Doc to cache using DMS_KPRO_FILL_CACHE, Doc exists in Cache when i check operation=statGet2 but my URL does not give me the document
    *-Cache server
    SELECT SINGLE * INTO S_SCMSCACHE
    FROM SCMSCACHE
    WHERE HOST = 'TSTCS2'.
    CALL FUNCTION 'SCMS_URL_GENERATE'
    EXPORTING
    COMMAND = 'get'
    CONTREP = CREP_ID
    DOCID = P_DMS_DOC2LOIO_LO_OBJID
    COMPID = 'data'
    ACCESSMODE = 'r'
    SIGNATURE = 'X'
    SECURITY = 'F'
    *USE_LOCATION = 'A'
    *LOCATION = 'TSTCS2'
    *CACHE_TO_USE = S_SCMSCACHE
    IMPORTING
    ABSOLUTE_URI = URI_STRING
    HTTP_URI = HTTP_URI
    HTTPS_URI = HTTPS_URI
    CACHE = S_SCMSCACHE_O
    ENDIF.
    ELSE."Content Server
    CALL FUNCTION 'SCMS_URL_GENERATE'
    EXPORTING
    COMMAND = 'docGet'
    CONTREP = CREP_ID "'Z_DLS_DOC_DU1'
    DOCID = P_DMS_DOC2LOIO_LO_OBJID
    ACCESSMODE = 'r'
    SECURITY = 'F'
    ENDIF.
    Edited by: Madhu Gudur on Oct 24, 2009 3:59 AM

    I'm not expert in this area, but I don't understand why you try to read directly the cache as by definition, a cache is managed by the application itself. Why don't you read the document as usually, and let the system read the cache by itself?

  • DMS document attached to PO

    Hi,
    DMS document is attached to PO .The requirement is that the attachment should be outputted with PO to the vendor.
    Also ,I am able to see the attachment in ME 22/ME 23 but unable to see in ME22N/ ME23N.
    Please advice.
    Regards,
    Pratap

    Hello,
    In standard system, It is not possible to print attachment via the message output. Please refer Question 30 of attached
    note 457497.
    457497 FAQ: Message processing in purchasing
    "Can documents that are linked to a purchase order also be output in the message output? " And the answer is: No."
    There is no posibility to print attached documents from ME9F. Printing the PO from ME9F and print the document from ME22N by
    selecting the document and pressing print button. You will only be able to see the screen linked documents when an item in the po (or position) has been selected.
    Regards,

  • DMS Document stored in SAP DB: Not shown in SAP PLM Web UI

    Dear Team,
    Is it by design that DMS documents which are stored in SAP DB are not shown in WEB UI...
    I get and error on the display document that " KPRO unchecked "
    how ever in ECC i can see the document with originals and thumbnails and complete DIR..
    Thanks for advice...!
    Best regards,
    Shashikumar BS

    Hi,
    Please check if a storage category is maintained in your system. You can use the Content Server (KPRO) storage type. Launch transaction DC10 and choose the
    relevant document type which you use. Display its details and you will find a flag called ‘Use KPRO’. Flag it to use the KPRO storage type which is recommended by SAP. You can manage your storage categories and KPRO settings by transaction CSADMIN
    Best regards
    Tamas

Maybe you are looking for