How to update characteristics of DMS document

Hello, I have a requirement to update characteristics right after document creation.
I use BAPI_DOCUMENT_CREATE2 to create the document:
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
     EXPORTING
       documentdata    = ls_doc
     IMPORTING
       documenttype    = lv_document_type
       documentnumber  = lv_document_number
       documentpart    = lv_document_part
       documentversion = lv_document_version
       return          = ls_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
         EXPORTING
wait = abap_true.
And then when I try to change it:
CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
     EXPORTING
       documenttype         = iv_document_type
       documentnumber       = cv_document_number
       documentpart         = iv_document_part
       documentversion      = iv_document_version
       documentdata         = ls_document_data
       documentdatax        = ls_document_data_x
     IMPORTING
       return               = ls_return
     TABLES
       classallocations     = lt_cl_alloc
       characteristicvalues = lt_char.
The following error is raised: Object TYPE/NUMBER/PART/VERSION does not exist.
I pass the type, number, part and version right from BAPI_DOCUMENT_CREATE into corresponding arguments for the second call, and into documentdata fields as well. ClassAllocations table contains a single row with class type and name for characteristics in CharacteristicValues table.
Could you suggest me, what can be wrong here?

I found a solution for my problem. In a short, everything is OK except one thing:
Field STATUS=1 should be also filled in CLASSALLOCATIONS table in addition to CLASSTYPE and CLASSNAME.
In total I had to make my call conform to the following points:
Document type, number, version and part must be filled into DOCUMENTDATA structure and not only in direct parameters of the BAPI
CHARACTERISTICSVALUES must include class name and class type, these can be found from tcode CL03
CLASSALLOCATIONS must include the same CLASSNAME and CLASSTYPE as from previous point, plus STATUS field set to «1»

Similar Messages

  • How to update UDF from marketing documents to Journal Entry UDF

    Hi Experts,
    I have a UDF in the marketing documents and I want to save the value to Journal Entry UDF.
    Regards,
    Jummie

    Hello Jummie,
    If I understand correctly, the scenario is that copy the value of UDF from marketing document to the UDF its target JE from when the marketing document is created.
    if so, just listen to FormDataAdd Event for the marketing document, copy the value of udf when document is created.
    Here is the sample code.
    Private Sub FormDataEventHandler( _
        ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, _
        ByRef BubbleEvent As Boolean) Handles oApp.FormDataEvent
            'You may add the target documents, 133 - A/R invoice.
            'Before action = true, start the transation
            If BusinessObjectInfo.FormTypeEx = "133" _
                    And BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD _
                    And BusinessObjectInfo.BeforeAction = True Then
                oCompany.StartTransaction()
                'BubbleEvent = False
            End If
            'Before Action = false,
            'Update product item tree
            'Succeed, commit, otherwise rollback
            If BusinessObjectInfo.FormTypeEx = "133" _
            And (BusinessObjectInfo.EventType = SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD) Then
                If BusinessObjectInfo.BeforeAction = False And BusinessObjectInfo.ActionSuccess Then
                    Dim objectKey As String = String.Empty
                    oCompany.GetNewObjectCode(objectKey)
                    MsgBox(BusinessObjectInfo.Type)
                    Dim oInvoice As SAPbobsCOM.Documents = Nothing
                    oInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
                    If oInvoice.GetByKey(CInt(objectKey)) Then
                        'Retrieve the UDF value in documents
                        Dim udfValueInDoc As String = oInvoice.UserFields.Fields.Item("***").Value
                        Dim oJE As SAPbobsCOM.JournalEntries = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
                        'Retrieve the JE for the document
                        oJE.GetByKey(CInt(oInvoice.JournalMemo))
                        Dim succeeded = True
                        'add you code to copy the UDF from document into JE
                        If succeeded Then
                            'update the production tree succesfully,
                            oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
                        Else
                            oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                        End If
                    End If
                End If
            End If
        End Sub
    Regards, Yatsea

  • How to update a template(word document)  dynamically.

    Hi guys,
    I am having an requirement to store details in a template,which is in word document dynamically and save it on the desktop.
    I can able to open a new word document dynamically.
    please give ur suggestions.
    Reagrds,
    Rajesh

    If you can use Word 2003 files, you can create WordML to create documents dynamically.
    Look here for a brief introduction: http://www.xmlw.ie/aboutxml/wordml.htm
    I've used WordML in combination with XMLBeans in one project.
    It's a very nice combination since you don't have to parse the full XML, just the part you are intrested in.
    If you use XMLBeans for instance, you can base your template on an existing word-file, saving some struggle to write all entries inside the template file.
    Combine this with the filedownload uicontroller in webdynpro to let the user download a template on the desktop.

  • How to Update Business Area Field in Posted Document?

    Dear All,
    Pls tell me how to update Business Area in documents which are posted without entering Business Area field. Pls tell me how to achieve this without using Validations & Substitutions. Any table entries can be maintained for this? Kindly guide.
    Regards
    Abhijeet

    Hi,
    I think, you need to post mannually if you have the list of documents posted with out business area.
    ex:
    1.Before posting of accounting entry as below, you should deactivate business area component in OB65 againest your co.code
    2.Post accounting entry as below
    40   123456    without business area     100
    50   123456    with business area ABC  100
    3. Goto T.Code: OB65 activate the business area component.
    4. After posting of accounting entry like above you should run transaction F.5D and F.5E again, make sure that above entry not come again while executing F.5D.
    First you can try this process in dev client, if you are comfort with this process then follow the same in quality and production.
    Note: You can do this transactions in production client, only when there were no users working on the system.
    all the best
    Regards,
    Prasad

  • Can't seem to change the Document Properties Advanced Reading Options in a Form that was created in Adobe LiveCycle. This option has been "greyed" out - anyone know how to update this to English so I can pass Accessibility Testing?

    Can't seem to change the Document Properties > Advanced > Reading Options in a Form that was created in Adobe LiveCycle. This option has been "greyed" out - anyone know how to update this to English so I can pass Accessibility Testing?

    LiveCycle forms use a very different approach to create a PDF form than Acrobat and that approach makes many features for processing PDFs non-functional.
    You might want to ask this question in one of the LiveCycle product forums.

  • How to update managed metadata column for all file in document library using powershell

    Hi,
    How to update managed metadata column for all file in document library using powershell?
    Any help on it.
    Thanks & REgards
    Poomani Sankaran

    Hi TanPart,
    I have changed the code which you have give in order to get the files from SharePoint 2010 Foundation  Document Library.But i am getting below error in powershell.
    Property 'ListItemCollectionPosition' cannot be found on this object; make sure it exists and is settable.
    Could you tell me which is the issues in it?
    See the code below.
    $web = Get-SPWeb http://ntmoss2010:9090/Site
    $list = $web.Lists["DocLib"]
    $query = New-Object Microsoft.SharePoint.SPQuery
    $query.ViewAttributes = "Scope='Recursive'";
    $query.RowLimit = 2000
    $caml = '<Where><Contains><FieldRef Name="Title" /><Value Type="Text">Process Documents/Delivery</Value></Contains></Where>' +
            '<OrderBy Override="TRUE"><FieldRef Name="ID"/></OrderBy>'
    $query.Query = $caml
    do
        $listItems = $list.GetItems($query)
        $spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
        foreach($item in $listItems)
            #Cast to SPListItem to avoid ambiguous overload error
            $spItem = [Microsoft.SharePoint.SPListItem]$item;
            Write-Host $spItem.Title       
    while ($spQuery.ListItemCollectionPosition -ne $null)
    Thanks & Regards
    Poomani Sankaran

  • How to update profit center in posted document without profit center ?

    HI,
    I want to know,
    How to update profit center in posted document without profit center ?
    So that i can get my profit center accouting report proper.
    Thanks
    Nilesh

    There is a long story about profit center accounting. I assume you are using Classic PCA, this means you can see the PCA documents.  And the solutions is below:
         For P/L account, even you don't maintain cost element for it, if you maintain the profit center in the application (Frontend transaction), then PCA line items will be generated for this account.
        For B/S account,  if you maintain the default Profit Center with transaction 3KEH/3KEI, the PCA line items will generated for this account also.
      Hints, don't maintain default profit center for AR/AP accounts, these accounts to be treated in periodic processing.
      First, calculate the distribution/adjust by F.5D, then transfer it by 1KEK. for others account rather than AR/AP, use F.5E
    For you case, if this account is P/L account, but you don't maintain profit center in the transaction, you can maintain default profit center as B/S account in 3KEH and 3KEI, then transfer it subsequently by transaction 1KE8.
    Good Lucky!
    Flex Yang

  • How to see the DMS document number in PO / PR?

    Dear experts,
    I am using DMS. I have created a document in DMS and I have linked it to the PR & PO line items. Till it is fine.
    But I am not able to find out this document in PR / PO. Can some one help me how can I find the document number in PR / PO??
    Thanks in advance.
    Regards,
    Praveen

    In the ME23N screen , there is icon which likes a pin on paper between the Item over screen and the Item screen . If you click this icon , a new window with all the DMS documents linked to the PO would appear.
    This is in the same line of the delete , lock , copy etc ..sequence .
    -Hari.

  • How to upload the data to SAP-DMS(Document Management System)

    Dear sir,
    How to upload the data to SAP-DMS (Document Management System) please give me the code for this .ex for (excel format or tab  deliminated) to sap system through BAPI i have to pass.
    regards
    R M Patil

    Hi,
    May be following link may help you.
    /thread/315373 [original link is broken]
    /message/205534#205534 [original link is broken]
    Thanks,
    Sree.

  • How to use XI to retreive document  files from SAP DMS?

    Hello XI experts,
    We have external application php that runs on separate non-sap server.
    I am willing to retrieve document from SAP DMS (documents management system) via XI and forward them to this application. The files are usually ms office format when you display them ( but I am not sure how they are stored in database)
    Anyone can tell me please if I can use XI for this purpose?
    How is going to be the connection and the retrieval done on DMS side ?
    What adapter will be used and how the file will be transferred via XI?
    Also I will appreciate any directions in connecting the php application side. What Adapters will be used , how doc file can be send (I guess as an attachments )?
    Appreciate any help!

    hi check
    FG : CVBAPI
    U have Standard BAPI to communicate with DMS system meeting your requrment
    some bapis
    BAPI_DOCUMENT_CHECKOUTVIEW     Check out document for display
    BAPI_DOCUMENT_CHECKOUTVIEW2    Check out document for display
    BAPI_DOCUMENT_CHECKOUTVIEWX    Check out document for display
    BAPI_DOCUMENT_CREATE                   Create Document
    rgds
    srini

  • How to update Reference field in the clearing document

    Hi Friends,
    While accounitng for billing document for sales Reference Key 2 is used for a data.
    Now when the payment is recieved from customer and accounted, how to update the Ref 2 automatically from the primary document.
    Pl, suggest.
    Thanks
    NNS

    Hi Robert,
    Thanks for answering.
    I am looking at Ref 2 should flow automatically to clearing document from the accounitng document for billing.
    Ex: Billing document is created and accounted. Ref 2 is AB
    Now when receipt is accounted for this biling document this AB should flow automatically to Ref 2 field.
    Thanks
    NNS.

  • How to update the posted documents with Business Area wise

    Dear experts
    Please suggest me how to update the posted documents with Business Area wise
    Ajeesh.s
    Moderator message: please do more research before asking, show what you have done yourself when asking.
    Edited by: Thomas Zloch on Nov 2, 2011 2:26 PM

    Hi,
    Select all your folders in Disco Administrator,ALT+ENTER to go to properties, then change the database from the default database to the remote database.
    Hope that helps,
    Rod West

  • How To send DMS(Documents cv01,cv03n,cv04n) from one sap system to othersap

    Hello Experts,
    I am working Document management system(CV01,cv02n,cv03n,cv04n)...
    I want to send the documents from one SAP system to Other SAP system
    Using ALE/Idocs....
    Please Help on this any sample programs....or function module....
    Thanks
    Preethi

    Hello,
    Please refer to the thread:
    How To send DMS(Documents cv01,cv03n,cv04n) from one sap system to othersap
    Best Regards, Murugesh AS

  • How to update Business place & Section Code for posted Documents

    Hi,
    I want to update business place and section code in existing documents, How to update business place and section code in the posted Documents. Is there any validation to check business place and section code while posting Document.
    Thanks in advance
    Best Regards
    Raj

    Hi Raynaju,
    Business place is an organizational unit and  it below company code level that is primarily used for reporting taxes on sales/purchases.
    For that no need to go for validation.Go to the field status and give the Business place & Section Code as required fields.
    There is a option in SAP as Document change rules.There give the company code,field name and account type
    Now you can change the fileds in posted document itself.
    May be this information is useful to you
    If you have any doubt feel free to ask
    Regards
    Aneesh
    Edited by: Aneesh kumarA on Jul 22, 2009 12:45 PM

  • How to Update Business Place & Sec.Code Field in Posted Document

    Dear All,
    Pls suggest how to update Business Place & Section Code field in documents which are posted without entering Business Place & Section Code. Pls tell me how to achieve this without using Validations & Substitutions. Any table entries can be maintained for this? Kindly guide.
    Regards
    Abhijeet

    Hi,
         Thanks for sending the replay,
         I had already update the Material document through the J1INPP T. code. but it not use for update FI
         Document and i want to update Business Place & Section Code in FI document.
         Please suggest,
    Regards
    Abhijeet

Maybe you are looking for