BAPI_DOCUMENT_CREATE2 - DMS upload

Hi,
    I using BAPI_DOCUMENT_CREATE2 to upload a document in DMS server.
It is giving me error while uploading ' Error while checking in and storing: C:\file1.pdf '. I am upload files from front end.
   I am using the DOCUMENTFILES   parameter DOCPATH,DOCFILE and STORAGECATEGORY. I have also given the full file name in header documentdata DOCFILE1.
Regards,
Karthik.k

Hello,
I have the problem : I want to upload a file on my frontend in the server DMS.
The info record is ok and the file is attached but when i want to display the file PDF i have the error 26 254.
I'm using the BAPI "BAPI_DOCUMENT_CREATE2" with parameters :
    documentdata-documenttype =  'ZBE'.
    documentdata-documentnumber = 'TEST DMS14'.
    documentdata-documentversion = '00'.
    documentdata-documentpart  = '000'.
    documentdata-description = 'Document DMS Besace'.
    documentdata-docfile1 = 'C:\test.pdf'.
    documentdata-wsapplication1 = 'PDF'.
    documentdata-datacarrier1 = 'SAP-SYSTEM'.
Thanks for your help.

Similar Messages

  • DMS Uploading of password protected DOCS

    I'm using BAPI_DOCUMENT_CREATE2 to upload documents into DMS.  When a document is password protected or read-only, the BAPI fails saying it cannot access the document.
    Via CV01N I can attach these documents, but not programatically.  Any ideas how I can remedy the program to load these?
    Thanks,
    -=Rob=-

    artpetrosemolo wrote:
    ...an iweb problem specific to my computer but I don't think so...
    Art ~ I'm inclined to agree with you — MobileMe isn't so reliable.
    artpetrosemolo wrote:
    ...any other thoughts?
    Try the suggestions in the "Fix iWeb" section here:
    http://www.iwebformusicians.com/WebMusic/iWebTips.html

  • BAPI_DOCUMENT_CREATE2 - Document upload to DMS - Back ground

    Hi,
    We are trying to uploda a file into DMS(CV01N) from SAP R/3, BAPI 'BAPI_DOCUMENT_CREATE2'. This works fine in foregroung but when we ececute it in background, we get an error saying 'Error while checking in and storing'.
    Could anyone please suggest me if we can sucessfully execute in back ground mode?
    Thanks,
    Ranjith Singh.

    it is not possible to download in background to a presentation server (your local PC) hence it is not possbile to upload either.
    when you submit the program to the background thenthe session is no longer attached to the PC that created it.
    Because of this you have to go via the application server.
    compare hundred of threads by searcing the ABAP forum with keywords +download +background
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0901cba-f49e-2910-748c-d7ce4c0c4c1c

  • 2.DMS uploading from Development server to Production server[GO LIVE]

    Hi All
    Is it all document type [dms] which r created in development server, these will transefer from development to production server by [uploading]transport request.
    Or is It needs Basiss Help.
    Rgds
    Ben.

    hi,
    I think for moving customization request to production, u dont need help of basis, if u have authorization then u can transport the request.
    Before moving first identify which are the request number u want to transport and release them using t code SE10 in development server.
    Go to production server, execute STMS t code for importing the request from devp server.
    Once ur request moved to production successfully then all customization will be available in production system except number ranges and class and characterstics.
    If ur using classification system, then create class and characterstics in production system it self.
    award points if useful
    regards
    Sham

  • DMS uploading from Development server to Production server[GO LIVE].

    Hi, All,
    I have configured DMS at client palce. Here they don't have quality server.
    What we configured will be tested in development it self. So in the unit test there is no errors at all and
    uploaded some documents in the development also.
    So i want to know how i could tranfer request and full DMS configuration to production server[Go Live].
    1.Wheather I could need Basiss Help.
    2.What are all precautions i could take before and after 'go live'
    3.What are all requirement needs to 'go live'.
    plz give procedure i details
    Rgds
    Ben

    hi,
    there no mandatory of quality server to test , if ur confident, u can directly transport to production
    For request transporattion its better to have basis person, if u know the procedure, u can also import from production server.
    Before that release all transport request in devp server.
    After transporting to prod server check wheather all customising setting imported or not, wherever necessary u create master data in production system it self(Class and characterstics, and number ranges).
    For going live u need to create all roles and autorization and need to assign to respective user ids.
    award points if useful
    regards
    sham

  • DMS-Upload Template

    Hi guys,
    Iam actually in the process of preparing DMS template,I have some 25 document types for which i have status maintenance,apart from which in the object links as of now i have currently maintained material master & i also want to attach the documents to the BOM item overview,is it possible to add it as object link from the CV01N screen itself?I tried doing so by adding the object link " STPO_DOC" & in CV01N screen it is appearing in Grey mode,Why is it so?If possible please send me the template to the following [email protected]
    Regards,
    Vijai

    Hi,
       Certain object links cannot be added from Documents. (Like STKO_DOC, STPO_DOC...). These object links can be added the other way.
    For example, we will take BOM Header:
    1. BOM Header-Document link can be maintained from BOM Header.
    2. Go to BOM Header screen. In Document assignment Tab, add the required DIR details. Go to DIR and open Object link tab and open BOM Header (STKO_DOC), you can see the object link.
    Similarly, the other object link also will be updated, if you update the other side.
    Template should be based on your recording and the configuration settings. Common template will not suffice your reqt.
    Prasanna
    <b>Reward points if useful</b>

  • Upload PDF to DMS using FTP server in WD abap

    Hi Friends,
        I want to upload PDF file from presentation server to DMS. As I dont want application server in this regards , so am using FTP server instead. But the problem am facing is in WD abap the filepath is in  XSTRING format. So how to upload Xstring pdf file in FTP server and how can i pull the same data to DMS server.
        My problem is just how to upload PDF in FTP server using web dynpro abap. The FM 'BAPI_DOCUMENT_CREATE2'  will upload the same PDF file from FTP to DMS server.
    Regards,
    Santosh

    Hi Santosh,
    Are you using FILE UPLOAD UI Element or not?
    Please go through this.. it might helps
    Re: File Upload Using BAPI
    /people/shruti.rathour/blog/2008/02/07/uploading-sap-interactive-form-on-the-abap-webdynpro-view
    Re: FTP_CONNECT failed for SAPFTP from WD4A to external Server
    Cheers,
    Kris.
    Edited by: kissnas on May 3, 2011 7:15 AM

  • LSMW in DMS

    Hi friends,
    Is it possible to use LSMW to upload files in DMS. How to upload files  through LSMW as file name stores in different table. Or the better option is to go for z development? Kindly suggest.
    Regards,
    Punam Modi

    hi poonam,
    you can use BAPI_DOCUMENT_CREATE2 to upload the document in dms.
    Develop BDC using this bapi  BAPI_DOCUMENT_CREATE2 , you can upload the docuement in dms.
    consult your abaper for this.
    regards,
    nitin
    award point if useful

  • Attaching document in CREATE mode on Purchase Requisition?

    Hi,
    I am running ECC5.00.
    If using the document management system (DMS), is there any way to configure DMS such that a user can attach a document (e.g. a PDF file) to the requisition in CREATE mode, i.e. during ME51N?  Is there anyway to configure the DMS system such that the attachment is required prior to saving the requisition?
    Cheers.

    Hi,
    Yes. It is possible through Object Linking from DMS. You need to follow the below stated steps to achive Object linking.
    1.Goto SPRO->CA Components->Document Management->Control Data--->Define Document Types.
    2.Select the desired Document type which you need to make it available in your Purchase requisition. for ex: Contracts e.t.c.
       & Click on "Define Object Links" from the left hand Panel.
    3.Goto New Entries and Object as EBAN & Screen No as 247 & Save the entries.
    4.Now go to DMS & Upload your documents.
    5. To access Documents at Purchase Requisition Level first you need to maintain the Item level Details. Then Select an item and Click on the Icon "DOCUMENTS"  just above the Item level. you can access only those document types which have been defined through Object linking.
    with regards,
    S. Dayananda Murthy

  • Not able to upload Documents using  BAPI_DOCUMENT_CREATE2 (From SE37)

    Hi
    Not able to upload and created Document in SAP DMS Repository using Function BAPI_DOCUMENT_CREATE2.
    I'm using this BAPI directly from SE37.
    Alwasy it is giving Error - E26 253 Error while checking in and storing:c:\ZANALYSIS_PATTERN.XLS
    Inputs I have given -
    In Document Data -
    Document Type - SDC
    Document Version- 00
    Document Part - 000
    Description - TEST
    In Document Files -
    Document Type - SDC
    Document Version- 00
    Document Part - 000
    Storage Category - ZHCL_CS
    WS Application - XLS
    DocPath - C:\
    DocFile - C:\ZANALYSIS_PATTERN.XLS
    Language - EN
    CheckedIn - X
    PF_FTP_DEST - SAPFTPA
    PF_HTTP_DEST - SAPHTTPA
    DEFAULTCLASS - X
    Please advice if I had skipped something and mentioned anything wrong.
    Thanks
    Prashant

    HI,
    I am also uploading a pdf file to dms through bapi_document_checkin.
    I am getting error E26 253 Error while checking in and storing:C:\DOCUMENTS AND SETTINGS\AGARW01S\DESKTOP\10 2_VIEW 1.PDF
    Inputs I have given -
    In Document Data -
    Document Type - SPE
    Document Version- A
    Document Part - 000
    Description - UPLOAD
    In Document Files -
    Document Type - SPE
    Document Version- A
    Document Part - 000
    Storage Category - DMS_C1_ST
    WS Application - PDF
    DocPath - C:\DOCUMENTS AND SETTINGS\AGARW01S\DESKTOP\10 2_VIEW 1.PDF
    DocFile - 10 2_VIEW 1.PDF
    Language - EN
    CheckedIn - X
    PF_FTP_DEST - SAPFTPA
    PF_HTTP_DEST - SAPHTTPA
    can u please help me as it is urgent.
    Shilpa

  • Upload document from Portal to SAP R.3 DMS

    Hi Experts,
    We are trying to get the attachemnts from enterpriseportal to SAP R/3 DMS Server using <B>BAPI_Document_Create2.</B>
    1)We use the method upload file to application sever from portal it is working but by attaching to DMS Server it not attaching.
    2) BAPI export params we are passing pf_http_dest = 'SAPHTTPA'.
    Developing in Webdynpro java application by using the above RFC function module and when I try to run the application it will show the size sent to R/3 system but it is not uploaded to R/3.
    Can any one suggest in this we are struckup to do this.
    Waiting your replies.
    Thanks & Regards,
    Lohitha.

    Hi,
    The documents are uploaded from WDJ to Portal Server  / Portal Content Directory / Some Shared Drive .
    So that they can also be programmed such a way that they can be fetched whenever needed .
    The requirement is interesting but before you take step think how far it is feasible .
    Regards,
    Srini

  • Unable to upload File to DMS (Document Managemt Sys) Via web Dynpro App

    Hi .
    I want add file to DMS i,e, SAP Document Management System .
    I first tried calling BAPI : BAPI_CREATE_DOCUMENT2 in Report and I was successfull.
    I am trying out same thing via Web Dynpro Application but I am getting error in Return of BAPI .Error is Error while checking in and storing: C:\Documents and Settings\Desktop\Hi.doc.
    I am pasting code I have written on click of Upload .
    method ONACTIONON_UPLOAD .
    implicitly available data objects
    wd_Context type ref to if_wd_context_node.
    wd_This type ref to if_FileUpload.
    DATA: gv_documento TYPE draw-doknr ,
    gv_clase TYPE draw-dokar VALUE 'Z99' ,
    gv_version TYPE draw-dokvr VALUE '00',
    gv_part TYPE draw-doktl VALUE '000',
    gv_descripcion TYPE drat-dktxt VALUE 'Description111',
    gv_return TYPE bapiret2,
    filename(60) type c ,
    lt_documentdata TYPE STANDARD TABLE OF bapi_doc_draw2,
    ls_documentdata LIKE LINE OF lt_documentdata,
    lt_characteristicvalues TYPE STANDARD TABLE OF bapi_characteristic_values ,
    lt_classallocations TYPE STANDARD TABLE OF bapi_class_allocation ,
    lt_documentfiles TYPE STANDARD TABLE OF bapi_doc_files2 ,
    ls_documentfiles LIKE LINE OF lt_documentfiles ,
    lv_content type xstring ,
    size type i.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
    DATA ls_context TYPE wd_this->element_context.
    DATA lv_filename LIKE ls_context-filename.
    get element via lead selection
    lo_el_context = wd_context->get_element( ).
    get single attribute
    lo_el_context->get_attribute(
    EXPORTING
    name = `FILENAME`
    IMPORTING
    value = lv_filename ).
    ls_documentdata-documenttype = 'Z99'.
    ls_documentdata-documentversion = '000'.
    ls_documentdata-documentpart = '00'.
    ls_documentdata-description = 'Test Document Created Parag'.
    ls_documentdata-STATUSEXTERN = 'WR'.
    ls_documentdata-USERNAME = 'I046361'.
    ls_documentdata-WSAPPLICATION1 = 'DOC'.
    ls_documentdata-DOCFILE1 = lv_filename.
    ls_documentdata-DATACARRIER1 = 'DEFAULT'.
    ls_documentfiles-wsapplication = 'DOC'.
    ls_documentfiles-docfile = lv_filename.
    ls_documentfiles-storagecategory = 'DMS_C1_ST'.
    ls_documentfiles-checkedin = 'X'.
    APPEND ls_documentfiles to lt_documentfiles.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
    EXPORTING
    documentdata = ls_documentdata
    pf_http_dest = 'SAPHTTP'
    IMPORTING
    return = gv_return
    TABLES
    documentfiles = lt_documentfiles.
    IF gv_return-type CA 'AE'.
    WRITE gv_return-message.
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    ENDIF .
    endmethod.
    Now Can anyone tell
    In case of Web Dynpro what Is this code right ?
    Do I need to change value of Parameters I have Set ?
    Do i need to some change as I am trying to Upload file Via WebApplication ?
    Do I have to change data Carrier ?
    Please let me know urgently .Points will be surely Given ...
    Regards ,
    Parag

    Hi ,
    Finally I was successfull in Uploading Docs.It seems I was not getting right Parameters ..anyways correct code is as follows ...
    method ONACTIONON_UPLOAD .
      implicitly available data objects
      wd_Context type ref to if_wd_context_node.
      wd_This    type ref to if_FileUpload.
    DATA:     gv_documento    TYPE draw-doknr            ,
              gv_clase        TYPE draw-dokar   VALUE 'Z99'  ,
              gv_version      TYPE draw-dokvr              VALUE '00',
              gv_part         TYPE draw-doktl VALUE '000',
              gv_descripcion  TYPE drat-dktxt VALUE 'Description111',
             gv_return       TYPE  BAPIRETURN ,
              gv_return       TYPE  BAPIRET2 ,
              gv_ruta         TYPE bapi_doc_files2-docfile VALUE 'C:\BAPI_DMS.doc' ,
              filename(60) type c ,
              lt_documentdata         TYPE STANDARD TABLE OF bapi_doc_draw2,
              ls_documentdata         LIKE LINE OF  lt_documentdata,
              lt_characteristicvalues TYPE STANDARD TABLE OF bapi_characteristic_values ,
              lt_classallocations     TYPE STANDARD TABLE OF bapi_class_allocation ,
              lt_documentfiles        TYPE STANDARD TABLE OF bapi_doc_files2 ,
              ls_documentfiles        LIKE LINE OF lt_documentfiles ,
              lv_content type xstring ,
              size type i ,
              lt_binary              TYPE TABLE OF sdokcntbin ,
              ls_binary              LIKE LINE OF lt_binary ,
              lv_size                TYPE I  ,
              ls_doc_status          TYPE  CVAPI_DOC_STATUS ,
              ls_API_ctrl            TYPE  CVAPI_API_CONTROL ,
              l_MSG                  TYPE  MESSAGES ,
              lt_files type STANDARD TABLE OF CVAPI_DOC_FILE  ,
              lt_drao  TYPE STANDARD TABLE OF DRAO  ,
              ls_drao  LIKE LINE OF lt_drao ,
              lv_documenttype      TYPE  DRAW-DOKAR ,
              lv_documentnumber TYPE  DRAW-DOKNR ,
              lv_documentversion TYPE  DRAW-DOKVR ,
              lv_documentpart  TYPE  DRAW-DOKTL ,
              lv_text          TYPE string .
          FIELD-SYMBOLS <fs> TYPE ANY.
      DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_filename LIKE ls_context-filename   .
    get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    get single attribute
      lo_el_context->get_attribute(     EXPORTING       name =  `FILENAME`     IMPORTING       value = lv_filename ).
      lo_el_context->get_attribute(     EXPORTING       name =  `FILECONTENT`     IMPORTING       value = lv_content ).
    CONCATENATE lv_text 'by' sy-uname 'cretaed at ' sy-uzeit INTO lv_text .
      ls_documentdata-documenttype    = 'Z99'.
      ls_documentdata-documentversion = '00'.
      ls_documentdata-documentpart    = '000'.
      ls_documentdata-description     = 'Test Document Created in Web Dynpro ABAP '.
      ls_documentdata-STATUSEXTERN    = 'WR'.
      ls_documentdata-USERNAME        = 'I046361'.
      ls_documentdata-WSAPPLICATION1 = 'DOC'.
      ls_documentdata-DOCFILE1        = lv_filename.
      ls_documentdata-DATACARRIER1    = 'DEFAULT'.
      ls_documentfiles-DOCUMENTTYPE       = 'Z99'.
      ls_documentfiles-WSAPPLICATION      = 'DOC'.
      ls_documentfiles-DOCUMENTVERSION    = '00'.
      ls_documentfiles-DOCUMENTPART       = '000'.
      ls_documentfiles-DOCFILE            = lv_filename.
      ls_documentfiles-description        = 'Test Document Created in Web Dynpro ABAP  '.
      ls_documentfiles-CREATED_BY         = sy-uname.
      ls_documentfiles-CHECKEDIN          = 'X'.
      ls_documentfiles-DOCFILE            = lv_filename.
      APPEND ls_documentfiles  to lt_documentfiles .
        CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
        EXPORTING
            documentdata    = ls_documentdata
            pf_http_dest    = 'SAPHTTPA'
        IMPORTING
            DOCUMENTNUMBER  = lv_DOCUMENTNUMBER
            return          = gv_return
        TABLES
          documentfiles = lt_documentfiles.
    IF gv_return-type CA 'AE'.
      WRITE gv_return-message.
    ELSE.
       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING     wait = 'X'.
       get message manager
       data lo_api_controller     type ref to if_wd_controller.
       data lo_message_manager    type ref to if_wd_message_manager.
       lo_api_controller ?= wd_This->Wd_Get_Api( ).
       CALL METHOD lo_api_controller->GET_MESSAGE_MANAGER
         RECEIVING
           MESSAGE_MANAGER = lo_message_manager
    CLEAR lv_text .
    CONCATENATE 'Dcoument ' lv_filename 'Successfully stored with Document No. ' lv_DOCUMENTNUMBER INTO lv_text .
       report message
       CALL METHOD lo_message_manager->REPORT_SUCCESS
         EXPORTING
           MESSAGE_TEXT             = lv_text
          PARAMS                   =
          MSG_USER_DATA            =
          IS_PERMANENT             = ABAP_FALSE
          SCOPE_PERMANENT_MSG      = CO_MSG_SCOPE_CONTROLLER
          VIEW                     =
          SHOW_AS_POPUP            =
          CONTROLLER_PERMANENT_MSG =
          MSG_INDEX                =
          CANCEL_NAVIGATION        =
    ENDIF .
    endmethod.

  • File not uploaded in DMS

    Hi , I am Trying to upload file into DMS Through my module pool application Using BAPI_DOCUMENT_CREATE2 i am getting no Error message and the document number is also getting genrated but my files are not being uploded in DMS.
    I am writing code below that i m using to upload file.
    LOOP AT IT_FILES INTO WA_FILES.
    DATA : P_FILE TYPE FILEP,
               P_FILEEXT TYPE DAPPL.
    DATA IT_DOCUMENT TYPE BAPI_DOC_DRAW.
    DATA  MESG TYPE STRING.
    DATA  WA_DOCUMENTDATA TYPE BAPI_DOC_DRAW2.
    DATA  WA_RETURN TYPE BAPIRET2.
    DATA  IT_DOC_FILES TYPE STANDARD TABLE OF BAPI_DOC_FILES2.
    DATA  WA_DOC_FILES TYPE BAPI_DOC_FILES2.
        P_FILE = WA_FILES-TAB_FILE.
        CALL FUNCTION 'CV120_DOC_GET_APPL'
          EXPORTING
    *     PF_DIALOG        =
    *     PF_DISPLAY       =
            PF_FILE          = P_FILE
    *     PF_TYPDT         =
         IMPORTING
           PFX_DAPPL        = P_FILEEXT
    *   TABLES
    *     PTX_TDWP         =
        WA_DOC_FILES-WSAPPLICATION = P_FILEEXT.
        WA_DOC_FILES-DOCFILE = WA_FILES-TAB_FILE.
        APPEND WA_DOC_FILES TO IT_DOC_FILES.
        CLEAR  WA_DOC_FILES.
      ENDLOOP.
      WA_DOCUMENTDATA-DOCUMENTTYPE = 'OHD'.
      WA_DOCUMENTDATA-DOCUMENTVERSION = '00'.
      WA_DOCUMENTDATA-DOCUMENTPART = '000'.
      WA_DOCUMENTDATA-STATUSEXTERN = 'RL'.
      CONCATENATE TEXT-001 WA_ZAPPNOTE-APP_NOTE_NO INTO WA_DOCUMENTDATA-DESCRIPTION.
      CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
        EXPORTING
          DOCUMENTDATA               = WA_DOCUMENTDATA
    *   HOSTNAME                   =
    *   DOCBOMCHANGENUMBER         =
    *   DOCBOMVALIDFROM            =
    *   DOCBOMREVISIONLEVEL        =
    *   CAD_MODE                   = ' '
    *   PF_FTP_DEST                = ' '
    *   PF_HTTP_DEST               = ' '
    *   DEFAULTCLASS               = 'X'
       IMPORTING
    *   DOCUMENTTYPE               =
         DOCUMENTNUMBER             = WA_ZAPPNOTE-ATTACHMENT
    *   DOCUMENTPART               =
    *   DOCUMENTVERSION            =
         RETURN                     = WA_RETURN
       TABLES
    *   CHARACTERISTICVALUES       =
    *   CLASSALLOCATIONS           =
    *   DOCUMENTDESCRIPTIONS       =
    *   OBJECTLINKS                =
    *   DOCUMENTSTRUCTURE          =
         DOCUMENTFILES              = IT_DOC_FILES
    *   LONGTEXTS                  =
    *   COMPONENTS                 =
      MODIFY ZAPPNOTE FROM WA_ZAPPNOTE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
         WAIT          = 'X'
    * IMPORTING
    *   RETURN        =

    It was some configuration problem.

  • Not able to upload file in DMS(Document Mang. system) using Web dynpro ABAP

    Hi All,
    I am facing a problem while uploading the file into the DMS ( Document Management System ) from Webdnrpo .
    I am using the BAPI - BAPI_DOCUMENT_CREATE2 to create the document .
    CASE - 1
    when i am providing the storage category mention below and no data carrier1
    ls_documentfiles-storagecategory = 'ZHMEL_CS'.  it is not able to upload the document in the DMS system and when i check
    in the debugg mode it giving error as  ""Error while checking in and storing: C:\TEST.TXT "" .
    CASE - 2
    When i am not using the storage category and providing the the data carrier as default
    ls_documentdata-DATACARRIER1 = 'DEFAULT'. It is able to create the document in the DMS but i am not able to read that document .
    I checked with DMS Consultant that DMS is configured for  ZOL ( documenttype) with a storage category  as 'ZHMEL_CS'.
    The code which i have used is below :
    ls_documentdata-documenttype = 'ZOL'.
    ls_documentdata-documentversion = '00'.
    ls_documentdata-documentpart = '000'.
    ls_documentdata-description = 'Test Document'.
    ls_documentdata-laboratory = '001'.
    ls_documentdata-WSAPPLICATION1 = 'TXT'.
    ls_documentdata-DOCFILE1 = 'C:\TEST.TXT'.
    ls_documentdata-SAVEDOCFILE1 = 'C:\TEST.TXT'.
    *ls_documentdata-FILESIZE1 = 000000000000.
    *ls_documentdata-FILESIZE2 = 000000000000.
    ls_documentdata-WSAPPLICATION1 = 'TXT'.
    ls_documentfiles-DOCUMENTTYPE = 'ZOL'.
    ls_documentfiles-DOCUMENTPART = '000'.
    ls_documentfiles-DOCUMENTVERSION = '00'.
    ls_documentfiles-storagecategory = 'ZHMEL_CS'.
    ls_documentfiles-WSAPPLICATION = 'TXT'.
    ls_documentfiles-DOCPATH = 'C:\'.""lv_filename.
    ls_documentfiles-DOCFILE = 'TEST.TXT'."lv_filename.
    ls_documentfiles-description = 'Test Document'.
    ls_documentfiles-language = 'EN'.
    ls_documentfiles-CHECKEDIN = 'X'.
    APPEND ls_documentfiles to lt_documentfiles .
    *&----Fill Descriptions
    w_descr-language = 'EN'.
    w_descr-language_iso = 'EN'.
    w_descr-description = 'Test'.
    append w_descr to lt_descr.
    clear w_descr.
    **w_hostname = 'HMEL-DV1R3_DR3_00'.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
    EXPORTING
    documentdata = ls_documentdata
    *hostname = 'content-srv'
    *pf_http_dest = 'SAPHTTPA'
    *pf_ftp_dest  = 'SAPFTPA'
    IMPORTING
    DOCUMENTNUMBER = lv_DOCUMENTNUMBER
    return = gv_return
    TABLES
    documentdescriptions       = lt_descr
    documentfiles              = lt_documentfiles.
    Please let me know your valuable inputs on the same ..
    Edited by: Omm Awasthi on Dec 30, 2010 12:22 AM
    Edited by: Omm Awasthi on Dec 30, 2010 12:25 AM

    Hi omm , from functional side your require a document type and content repository
    I have used below code in a function module to create document , we have create object link as PO to the doc.
    FUNCTION ZFM_SR_CREATE_FROM_EXTERNAL .
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(IV_DOCUMENTNUMBER) TYPE  DOKNR OPTIONAL
    *"     VALUE(IV_DOCUMENTTYPE) TYPE  DOKAR OPTIONAL
    *"     VALUE(IV_DOCUMENTVERSION) TYPE  DOKVR OPTIONAL
    *"     VALUE(IV_DOCUMENTPART) TYPE  DOKTL_D OPTIONAL
    *"     VALUE(IV_STORAGE_CAT) TYPE  CV_STORAGE_CAT OPTIONAL
    *"     VALUE(IV_DOKST) TYPE  DOKST OPTIONAL
    *"     VALUE(IT_DM_FILES) TYPE  ZDM_TT_FILES OPTIONAL
    *"     VALUE(IV_EBELN) TYPE  EBELN
    *"  EXPORTING
    *"     VALUE(EV_DOCUMENTNUMBER) TYPE  DOKNR
    *"     VALUE(ES_RETURN) TYPE  BAPIRET2
    V00.00  DD.MM.YYYY                                                   *
    *********************New Method of Uploading File*********************************
      CONSTANTS path_name    TYPE dms_path
               VALUE '/tmp/'.
      CONSTANTS log TYPE dms_path VALUE '/tmp/logFO.txt'.
      DATA: ls_draw TYPE bapi_doc_draw2,
            lt_documentfiles TYPE TABLE OF bapi_doc_files2,
            ls_documentfiles TYPE bapi_doc_files2,
            ls_dm_files TYPE zdm_files,
            lv_filename TYPE string,
            lv_ext TYPE string,
            lv_file_type TYPE draw-dappl,
            lv_file_name TYPE dms_path,
            lv_msg(80) TYPE c,
            lt_objectlinks TYPE TABLE OF bapi_doc_drad,
            ls_objectlinks TYPE bapi_doc_drad,
            lv_ebelp   TYPE ebelp
    Prepare Data
      MOVE iv_documentnumber TO ls_draw-documentnumber.
      MOVE iv_documenttype TO ls_draw-documenttype.
      MOVE iv_documentversion TO ls_draw-documentversion.
      MOVE iv_documentpart TO ls_draw-documentpart.
      ls_draw-statusextern = iv_dokst.
      ls_draw-statusintern = iv_dokst.
      ls_draw-username = sy-uname.
      LOOP AT it_dm_files INTO ls_dm_files.
        SPLIT ls_dm_files-filepath AT '.' INTO lv_filename lv_ext.
        CALL FUNCTION 'CV120_DOC_GET_APPL'
          EXPORTING
            pf_file   = ls_dm_files-filepath
          IMPORTING
            pfx_dappl = lv_file_type.
        TRANSLATE lv_file_type TO UPPER CASE.
        OPEN DATASET log FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        TRANSFER lv_ext TO log.
        ls_documentfiles-wsapplication = lv_file_type.
        TRANSLATE ls_documentfiles-wsapplication TO UPPER CASE.
        CONCATENATE path_name
                           lv_filename
                            lv_ext
                            INTO lv_file_name.
        CONDENSE lv_file_name  NO-GAPS.
        TRANSFER lv_file_name TO log.
        OPEN DATASET lv_file_name FOR OUTPUT IN BINARY MODE MESSAGE lv_msg.
    *Transfer Attachment Content to Application Server
        TRANSFER ls_dm_files-content TO lv_file_name.
        CLOSE DATASET lv_file_name.
        TRANSFER 'move data to lt_files' TO log.
        ls_documentfiles-storagecategory = iv_storage_cat.
        ls_documentfiles-docfile = lv_file_name.
        ls_documentfiles-DOCUMENTVERSION = IV_DOCUMENTVERSION.
        APPEND ls_documentfiles TO lt_documentfiles.
        CLEAR lv_file_name.
        CLOSE DATASET log.
      ENDLOOP.
      IF iv_ebeln IS NOT INITIAL.
        ls_objectlinks-objecttype = 'EKPO'.
        SELECT SINGLE ebelp INTO lv_ebelp FROM ekpo WHERE
                                          ebeln = iv_ebeln
                                          AND loekz eq space.
        CONCATENATE iv_ebeln lv_ebelp INTO ls_objectlinks-objectkey.
        APPEND ls_objectlinks TO lt_objectlinks.
      ENDIF.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
       EXPORTING
         documentdata   = ls_draw
         pf_ftp_dest    = 'SAPFTPA'
         pf_http_dest   = 'SAPHTTPA'
       IMPORTING
         documentnumber = ev_documentnumber
         return         = es_return
       TABLES
         objectlinks          = lt_objectlinks
         documentfiles  = lt_documentfiles.
    DATA:   ls_doc_data  type bapi_doc_draw2,
       ls_doc_datax type bapi_doc_drawx2,
       ls_return type bapiret2.
    Set value for document data
      ls_doc_data-statusextern  = 'IW'.
      ls_doc_data-statusintern  = 'IW'.
    Set value for document data check
    ls_doc_datax-statusextern = 'X'.
    ls_doc_datax-statusintern = 'X'.
    CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
      EXPORTING
        DOCUMENTTYPE               = 'ROS'
        DOCUMENTNUMBER             = IV_DOCUMENTNUMBER
        DOCUMENTPART               = IV_DOCUMENTPART
        DOCUMENTVERSION            = IV_DOCUMENTVERSION
        DOCUMENTDATA               = ls_doc_data
        DOCUMENTDATAX              = ls_doc_datax
      HOSTNAME                   =
      DOCBOMCHANGENUMBER         =
      DOCBOMVALIDFROM            =
      DOCBOMREVISIONLEVEL        =
      SENDCOMPLETEBOM            = ' '
          pf_ftp_dest    = 'SAPFTPA'
          pf_http_dest   = 'SAPHTTPA'
      CAD_MODE                   = ' '
      ACCEPT_EMPTY_BOM           = ' '
    IMPORTING
       RETURN                     =  ls_return
    TABLES
      CHARACTERISTICVALUES       =
      CLASSALLOCATIONS           =
      DOCUMENTDESCRIPTIONS       =
      OBJECTLINKS                =
      DOCUMENTSTRUCTURE          =
       DOCUMENTFILES              = lt_documentfiles.
      LONGTEXTS                  =
      COMPONENTS                 =
      move es_return to ES_RETURN.
      IF es_return-type CA 'EA' ."NE 'E' AND es_return-type NE 'A'.
        "do nothing
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
      ENDIF.
      LOOP AT lt_documentfiles INTO ls_documentfiles.
        DELETE DATASET ls_documentfiles-docfile.
      ENDLOOP.
    ENDFUNCTION.

  • Mass upload into DMS

    Hi all,
            using tcode cv01n we can upload a file to a document. But the requirement is to load multiple files at a time that is mass upload.
    pls help
    regards
    kshitij

    Hi Kshitij,
    for uploading more than one original I would recommend you to use one of the
    DMS BAPIs
    - 'BAPI_DOCUMENT_CREATE2'
    - 'BAPI_DOCUMENT_CHANGE2' or
    - 'BAPI_DOCUMENT_LOAD'
    Please see the SAP Note 766277 which contains a complete documentation on all existing DMS BAPIs. In the documentation you will also find sample coding for each BAPI.
    If you try to do this in the background API function modules would be more flexible. Therefore please see SAP note 504692. This note includes some samples for special checkin cases.
    I hope this information is usefull for you.
    Best regards,
    Christoph

Maybe you are looking for

  • Office Web App 2013

    Hi guys, Quick question... Do I have to install OWA over HTTPS for SharePoint 2013? my farm is HTTP... Many thanks,

  • MM - Purchase Pricing Procedure

    Requirement In One company there are 7 purchase organisation 1) Imports are done from 5 purchase organisation and our costing has got following manner - Basic + Commission + Custom duty 2) Local procurement which is done by 3 purchase organisation an

  • Why i can't sync music to my iPhone 5?

    I tried syncing music from iTunes on Mac to my iPhone 5 so many times, but it didn't work out. guess what? it worked out to my old iPhone 4, not with my i5, help me?!

  • Connecting Ipod Touch to Wi-Fi from your home.

    im having so much trouble trying to connect my ipod to my wireless dsl. could anyone help?

  • No beep sound and No signal

    I tried to start my k450e, but there was no beep sound and no signal on my monitor. How can I fix this? I don't know what is the problem.... and should I visit the local warranty service providers??