Duplicate a BO via DI API

Hello,
as far as I know the only possible way to duplicate a document (for example a Sales Order) via DI API is to save it as xml and then to open it again. but it doesn't work properly, because I get a message "bad value RDR1.BaseLine line: 1". And if I change the property to one manually, the new document can be saved, but it can't be changed any more. I get a message "table rdr1 was changed by another user". What shall I do, so that it works properly?
Best Regards,
Alexander

Hi,
anfortunatly there is nothing I could omit. I need the same Document and also links to the base documents. There is a code below I used to duplicate a document.
Private Function CopyDocument(ByVal oDoc As SAPbobsCOM.Documents) As SAPbobsCOM.Documents
        Dim oXmlDoc As New XmlDocument()
        oXmlDoc.LoadXml(oDoc.GetAsXML())
        For Each oNode As XmlNode In oXmlDoc.SelectNodes("//DocEntry")
            oNode.InnerText = ""
        Next
        oXmlDoc.SelectSingleNode("//DocNum").InnerText = ""
        oXmlDoc.SelectSingleNode("//JrnlMemo").InnerText = ""
        oXmlDoc.Save(Application.StartupPath & "\Document_" & oDoc.DocEntry.ToString() & ".xml")
        CopyDocument = moSBOCompany.GetBusinessObjectFromXML(Application.StartupPath & "\Document_" & oDoc.DocEntry.ToString() & ".xml", 0)
    End Function
Can somebody help me?
Best Regards,
Alexander

Similar Messages

  • Corrupt Credit Note created via DI API

    Hello,
    when i try to create a credit note via di api i get the error message "one of the base documents has been closed", even if the source document is not closed. But this is not the main problem. After this i have a corrupt credit memo in my system, that means a credit memo with out any detail lines. The error occurs only on one customer systems, on a lot of other systems the creation of credit notes works fine. Had anybody the same effect or clue what causes this problem.
    Regards

    Hello we found the problem, i can reproduce it on a belgium database.
    I want you to inform about a critical error in the SBO_SP_TransactionNotification.
    If you check the line data of a document and send an error for this data the front end works fine. But if you use the DI-API the header data of document will be saved and the lines will be not saved.
    if @object_type in ('14','19') and @transaction_type = 'A'
    begin
    declare @corrCRD as varchar(8)
    if @object_type = '14'
    set @corrCRD = (select distinct(correction) from ovtg where code in (select vatgroup from RIN1 where docentry = @list_of_cols_val_tab_del) and correction = 'N')
    else if @object_type = '19'
    set @corrCRD = (select distinct(correction) from ovtg where code in (select vatgroup from RPC1 where docentry = @list_of_cols_val_tab_del) and correction = 'N')
    if @corrCRD = 'N'
    begin
    set @error = 1
    set @error_message = 'You have entered a regular VAT Code on the document, this is not allowed'
    end
    end

  • PO from SO via DI API:Base document card and target document card do not ..

    HI All,
    I am trying to create Purchase Order from Sales Order. This is possible by GUI (on Sales Order on logistics tabs Click On Purcase Orders CheckBox.
    I got the error message: -5002-Base document card and target document card do not match.
    The message itself can be understandable, because the Customer and Supplier has a different CardCode.
    I am sure I am using a correct code
    oPo.Lines.BaseType = BoObjectTypes.oOrders
    oPo.Lines.BaseEntry = sDocEntry
    oPo.Lines.BaseLine = iLineNum
    Where oPo is a Purchase Order document.
    sDocEntry is a Sales Order docentry and iLineNum is a Line number of Sales Order
    For other A/R to A/R and A/P to A/P documents are working fine.
    Has anybody found this error or has anybody created application like this?
    I am using sbo2007PL46
    Regards,
    J.

    Hi guys,
    this is still on the suggestion page:
    Link existing Purchase Orders to (Sales) Orders via DI API : View Idea
    I tryed with 9.1 PL 4 and it didn't work.

  • Creating a Good Receipt PO via DI API No matching records found (ODBC -2028)

    Hi,
    I trying to create a Good Receipt PO via DI API.  It is working when the user I used to log in to SAP via the DI API is a Professional User but when I changed it to a Limited Logistics User, I'm receiving the No matching records found (ODBC -2028). I have already added the SDK Tools license to that user but still I'm receiving that error.
    So is it that the DI API will only work with a Professional User license or I can still use a Limited Logistics User?

    HI J S L,
    I get same error when I use different user that I just now add the SDK Tools without restarting the database server.  But previous user that I added SDK Tools before restart, no error.
    Today
    User 1 - add SDK Tools, no restart, error
    Last Wednesday
    User 2 - add SDK Tools, no restart, error
    Today - database server restarted this morning
    User 2 - no more error
    Both User 1 and 2 are Limited Logistics User.
    Best regards,
    Dennis

  • How to determine host status in a task via python api

    Hello all,
    using the python api I am having some issues trying to determine the status of a host within a task. For example I have a job, with one task and 10 hosts associated with that task. Eight hosts finish the task, 2 fail. However via the api I can only seem to determine the status of the job and the task. What I want is to be able to generate a report that basically matches what you see via the gui (ie 8 hosts ok, 2 hosts failed). The data structure OnStageTaskData gives me a status and a list of hosts, but not a status for each host. (Note I am not using any of the depricated functions/data structures). Currently my code looks like (minus the api init, etc)...
    # list all the jobs for last week
    joblist = api.GetJobs()
    for job in joblist:
    # if the job occured in the last week
    if job.c_time > reportstarttime:
    print "\nJob name %s Time %s " %(job.name, time.ctime(job.c_time))
    try:
    jobdetails = api.GetOnStageJob(job.id)
    except COsApiJobNotFoundException:
    print "Can't find job %s details" %job.name
    continue
    for tasks in jobdetails.job_data.tasks:
    for hostid in tasks.task_data.target:
    try:
    hostinfo = api.GetHostGroup(hostid)
    except OsApiHostNotFoundException:
    print "Can't find host details %s" %tasks.task_data.name
    print "Hostname %s Status %s" %(hostinfo.name, tasks.status)
    which generates output like...
    Job name chg233146-sol9 Time Sun Jan 13 10:31:42 2008
    Hostname tacnomsrv02 Status Failed
    Hostname tacpthsrv01 Status Failed
    anyone have another way to doing this or suggestions? Or is this kind of info not available via the api? Thank you.

    Hi ConnectSolutions,
    As you correctly pointed out, there is some bug in our code
    that keeps the room active and you dont receive any events or
    notification if you are entering as guest and waiting and the host
    arrives. Also, since you havent entered yet i.e your role is still
    5 i.e. UserRoles.LOBBY , you can't access any of the UserManager's
    collections and will get a length of 0 always. We will be fixing
    this with priority .
    But you can get around the problem as of now, by having a
    small shared model of yours ( any collectionNode or sharedModel
    will do) where you create a node and publish a message on it from
    the Owner's side whenever the owner/host enters to notify everyone
    that he has entered. Just remember to set the accessmodel of
    NodeConfiguration of node on which you are publishing to LOBBY ie.
    role = 5 , and make the publishModel = 100 so that only owners can
    publish on this node. In this way , any users waiting will be
    receiving this message and will know the host has arrived. If you
    can't get this sharedModel concept to work, let me know. I will try
    to run on my side.
    And as of our side regarding actual fix, we will fix this use
    case and put in the next drop of SDK and also update in forum about
    it.
    On the host side though, he is always notified when he enters
    if there are pending users knocking to enter. See the KnockingQueue
    example in case you want to explore that.
    Thanks
    Hironmay Basu

  • Cannot create AR Invoice negative amount with WithHolding Tax negative amount via DI API

    Hi All,
    I tried to create AR Invoice Document via DI API, but with negative amount and negative withholding tax amount.
    Document added successfully, but when i open the document in SAP, and i open WTax Table information, withholding tax amount become zero,
    Please see image below.
    But when i add the same document through SAP Screen, i can fill WTax Amount with negative amount.
    SAP Version 9.0 PL 5
    Please kindly help,
    Thanks
    Best Regards
    Siddharta

    Hello.
    If this is different to the behavior of the B1 application it should be considered a bug - like any such difference between DI API and app.
    HTH

  • Unable to start process via GP API in which group is exposed as input

    Hi,
         I am not been able to start process using GP API for the particular senario.
    I created Process at design time.
    In this process I mapped parameters to a group and exposed this group, So that input is required for initiating the process.
    Now I want to initiate this process via GP API.
    I got sucess in starting processes which takes parameters as inputs or which does not need any inputs, but i was not been able to start process where group is exposed.
    it's giving me GP INVOCATION Exception.
    Please Help ASAP
    Regards,
    Pratik

    Pratik,
    I try to simulate with scenario described by you and I got success with my test.
    Follow my java code:
         public boolean initiateProcessSDN () {
              boolean ret = false;
              try {
                   IUser user = UMFactory.getUserFactory().getUserByLogonID("uces");
                   IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(user);
                   IGPProcess processTemplate
                        = GPProcessFactory.getDesigntimeManager().getActiveTemplate(
                                  "8DC0B411957D11DDB7910017F2EBE4A5", userContext);
                   IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
                   IGPStructure params     = GPStructureFactory.getStructure(processTemplate.getInputParameters());
                   params.setAttributeValue("NameGroup", "Pedro");
                   params.setAttributeValue("AddressGroup", "XPTO");
                   IGPProcessRoleInstanceList roles = rtm.createProcessRoleInstanceList();
                   IGPProcessInstance prInstance
                        = rtm.startProcess(     processTemplate,
                                            "Test 1",
                                            "Test 2",
                                            user,
                                            roles,
                                            params,
                                            user);
                   ret = true;
                   } catch (Exception ex) {
                        ret = false;
              return ret;
    Print screen about my GP design:
    Callable Object with 4 parameters
    http://img530.imageshack.us/img530/16/sdngpgroup001bt5.jpg
    Action grouping CO parameters into 2 groups
    http://img147.imageshack.us/img147/2006/sdngpgroup002xy3.jpg
    Process reflecting these groups as input parameters
    http://img147.imageshack.us/img147/9184/sdngpgroup003pp0.jpg
    Process started by java code above
    http://img530.imageshack.us/img530/8833/sdngpgroup004no4.jpg
    Best Regards,
    Pedro Nunes

  • How to get IPv6 site prefix via Windows API?

    Hello,
    we need urgent help. We have to automatically configure a postgres sql server. For this reason we need to determine the IPv6 site prefix. Using windows command line this is pretty easy:
    netsh interface ipv6 show siteprefix
    We are only interested in the site prefixes themselves, e.g. no lease time is needed. We want to get this information via Windows API.
    For this purpose we use GetAdaptersAddresses function. Within the result of
    FirstPrefix the needed information is included. But it's much to much information and it's not clear for us how to filter the result. We need always
    exact the same result like the command above produces.
    Any help or hint would be very very appreciated.
    Greg

    Hi Valery,
    I mean a Portal Resource..
    Inside portal, when a go to properties  of a specific document, in tab "Access Link" it shows a "Short Id".
    I'd like to know via API how to get this Id, or any other Code that it's unique for every resource or document in portal.
    Thank you!

  • Add UDF to OPOR ,OINV ... via DI API

    Hello...
    i want to add a User Defined Field to Documents via DI API. Is this possible? And if its possible, please show me a way to do it thx
    best regards
    Matthias

    this is just what i have tried.
    But i found the mistake.
    The function always puts an "@" before the tablename if there is none. And thats not good
    thx
    Matthias

  • Extract image and Features from the Catalog via JAVA API

    Hello,
    I would like to Extract image from the Catalog via JAVA API, Can anybody help on that? I also tried to extract the Features field form the Catalog but results in the error "Features field not found" Any ideas what could have wrong?
    Many thanks,
    Dharmi

    Hello,
    Can anybody tell me where i can find the latest JAVAAPI reference guide? I found the one for MDM 5.5 SP 1 but that also refers to the last parameter of the CatalogCache.Init as int and not string.
    I looked up in service.sap.com/instguides -> SAP Netweaver -> Release 4 -> Installation and there only following 3 files are there for MDM 5.5 SP2
    MDM 5.5 SP02 - Configuration Guide  SAP MDM
    MDM 5.5 SP02 - Installation Guide   SAP MDM
    MDM 5.5 SP02 – ERP-MDM Field Mapping and Check Tables
    Regards,
    Dharmi
    Message was edited by: Dharmi Tanna
    Message was edited by: Dharmi Tanna

  • How to call business rules scripts via Java API

    Hi
    I have a problem. I have some scripts (business rules in essbase) that can be seen thru Administration Services Console under Business Rules folder. How can I execute these script using Provider Services (via Java API to EssBase interface)?

    hi
    i look too java api sample for "HBR Lounch"
    you can try found example in EAS folder
    C:\Hyperion\AdminServices\AppServer\InstalledApps\Tomcat\5.0.28\eas\webapps\hbrlauncher\MC_LaunchWindow.jsp
    please back, if you will have resolution :)

  • 2007A PL8 UOMs are missing when creating a document via DI-API

    If a document is created via DI-API the UOMs are missing.
    The behavior till PL8 was that UOMs were taken from the item master when creating a new document.
    Regards

    This is a confirmed Bug. The DI-Api always uses the Inventory UoM. As work around you have to put the Sales UoM into the Inventory UoM.
    I hope they we will fix this soon.
    Regards

  • Retrieve contact list  via the API not with the last updated date but created date?

    I can connect via the API and retrieve a list of contacts  but it seems that the only paramater i can pass is to search since the last Update  Date.
    Is it possible to search on the Created date and to have a date range as well?
    I found the xml result is slow to come as it gives all entries since the "lastUpdateDate" entered.

    A change in score does not cause the Date Modified field to change on the contact record. This field only changes when some data in one of the fields has changed.
    However, some of the confusion can come from the fact that lead scores have a Profile and Engagement portion. So if you have certain fields on the profile section being modified, that would cause a rescore at the same time. Engagement criteria such as form submits often cause the contact record to be modified while website visits and email clicks/opens do not.
    Hopefully this helps clarify,
    Bojan

  • Newly created Image not listed via REST API

    Hi,
    I have created a image in azure console .Its created successfully and i could see the created image under "Image" tab in console.Also, the image created with the name appending current date, it was not before.But when I am trying to list images by
    using the below REST API its listing images except the newly created images that have the  name appended with current date.
    https://management.core.windows.net/5f2fe4c3-23b3-45c0-a70c-9560b79dcf56/services/images
    header values:
    x-ms-version : 2012-03-01
    Content-Type : application/xml
    Host: management.core.windows.net
    This makes me fail to launch new VM via REST api.I got the response as follows
    <Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Code>BadRequest</Code><Message>The image vmyffdd-20140605-813455l does not exist.</Message></Error>
    Please look into this.

    hi,
    From the error, your request parameter was incorrect. I guess your image name may be wrong. How did you write your Image name and url? I suggest you don't forget the '.VHD'. Also,if you use the
    VMImageName element which is only available using version 2014-02-01 or higher
    And I suggest you could try this code sample about how to using REST api to create VM :Simple Windows Azure REST API Sample Tool
    Please try it.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Add limits to step settings via TestStand API from LabVIEW

    Dear LabVIEW and TestStand Community!
    I'm trying to add FileGlobal Variables as limits to TestStand step NumericLimit programmatically, via LabVIEW, via TS API. I attach screenshot of the code, which I use (part of it - the module, which only sets values to low and high limit of the step), and also I attach, what I manage to get.
    In TS, when I open sequence file, after running of the code, I can see in the description line of the test, that it accepted limits, which I set from LV - you can see it from the screenshot, it is marked with yellow. But in the Tab "Limits", there are still default numeric values, not FileGlobal Variables.
    Could anyone explain, what doest it mean, and how to set up them correctly?
    Thanks a lot in advance!
    Solved!
    Go to Solution.
    Attachments:
    Limits.PNG ‏33 KB
    Add Limits.PNG ‏15 KB

    It's kind of sequence generator what I'm doing now...
    Thank you very much for fast reply, but when I setup "UsexxxExpr" to true, it doesn't change the situation... Could you, please, check my attachment? Maybe, some mistake in syntax?
    Attachments:
    Add Limits.PNG ‏23 KB

Maybe you are looking for

  • Problems installation Photoshop Elements 8 on Windows 7

    I tried to install Photoshop elements 8 on my Windows 7 computer, but the installation gives a failure after a certain time. A file "...cab" is not working and may be corrupt ( exact failure code I can give, if necesary). Is there any possibility to

  • Sun Trunking 1.& kern Warning Hardware address trying to be our IP addresse

    Using Sun Trunking 1.3 on a solaris 10 11/06 V490 server. setenv local-mac-address? is set to true Obviously server Aggregate MAC address corresponds to first NIC local MAC address. Second NIC has its specific MAC address. Aggregate seams OK (traffic

  • Enhancement Spot in ECC 6

    Hi Gurus, I want to know about Explicit Enhacement spot and how it can be made and what is the use of it.if there is some screen shots available then kindly provide the link. Every Helpfull software will surely awarded Points.

  • Laserfiche - Do you split your volume?

    Hi! On Laserfiche, can you please give me your opinion as to whether you split your volumes or not, and why. The vendor told me none of his clients splits them, back when we started using LF, but since ours is getting just around 500 GB maybe it's ti

  • How to handle Index Organized Tables in schema capture?

    I'm trying setup streams schema level between 2 database source 10.2.0.4 and 11g; one way streams; The source has Index Organized Tables with column rowed; Oracle streams doesn't support data type rowed; Is it works around? Thanks