Document card?

Hi.
Anyone can tell me what means document card?
I`m trying to insert a 'delivery' based on a 'sales order' and the error that I get is : '-5002',Base document card and target document card do not match.  [ODLN.DocNum]
In code I have specified the base entry  (.Lines.BaseEntry = pD.doc_entry) where PD.doc_entry is the base document numbre (DocNum)
Thanks for our help.

Hi Alex. I'm trying to see the necesary fields to do the delivery, but look inside the trace of SQL Server is a Chaos.
I have fill the fields that are mandatory in the help.
These are the fields that i have fill:
>Document:
.CardCode = pD.card_Code
.DocObjectCodeEx = BoObjectTypes.oPurchaseDeliveryNotes
.NumAtCard = pD.nalbaran
.DocDate = Date 'el del día
.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
>Lines:
.Lines.BaseEntry = pD.doc_entry
        .Lines.BaseLine = lN.getline_num
        .Lines.Quantity = lN.getquantity1 
        .Lines.Factor1 = lN.ColeccionLotes.Count
        .Lines.BaseType = SAPbobsCOM.BoObjectTypes.oPurchaseOrders
>BatchNumbers:
sapPDN.Lines.BatchNumbers.BatchNumber = lT.getBatchNumber              sapPDN.Lines.BatchNumbers.Quantity = lT.getBatchQuantity
Thanks for our help.

Similar Messages

  • 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.

  • Please help! -5002,Base document card and target document card do not match

    Hi
    When I try to save an invoice with a payment thro' the DI API I get the following error :
    <b>-5002,Base document card and target document card do not match</b>
    Why am I getting this error and how can I solce it?
    Thanks

    Hi,
    For the sake of anyone else who has this problem:
    After much searching for the answer to why I was getting this message I found that the internal validation must be case sensitive and so 'C00417' on the receipt was not matching 'c00417' on the invoice.

  • Base document card and target document card do not match

    I ran into this error "Base document card and target document card do not match" while uploading Outgoing Payments too AP Invoices.
    The CardCode of the Invoice matches the CardCode of the Payment so it's not that issue. I can't seem to fix this error.
    Any input would be helpful.
    Here's screenshots too
    OVPM - Payments
    VPM1 - Payments_Checks
    VPM2 - Payments_Invoices

    Hi,
    For the sake of anyone else who has this problem:
    After much searching for the answer to why I was getting this message I found that the internal validation must be case sensitive and so 'C00417' on the receipt was not matching 'c00417' on the invoice.

  • Delete document cards from Knowlede Directory

    Hi,
    I am trying to delete a card from the knowledge directory (document folder) but nothing happens (ie. the card is supposed to get deleted) when I run the following code:
    IPTQueryResult qrCards = Folder.QueryCards(PTPROPIDS.PT_PROPID_OBJECTID, true, PT_PROPIDS.PT_PROPID_OBJECTID, 0, -1, null);
    for (int i = 0; i < qrCards.RowCount(); i++)
    int objectId = qrCards.ItemAsInt(i, PT_PROPIDS.PT_PROPID_OBJECTID);
    Object[] status = iptSession.GetCatalog().DeleteCards(objectId);
    for (int y=0;y < status.length; y++)
    MessageBox.Show("status: " + status[y]);
    status returned: -2147024891
    Am I missing something?
    Thanks in advance.
    Edited by: user13371320 on Jan 2, 2011 10:50 PM

    If you're connecting to a portal instance with the Portal Server API (as it appears you are), then you should probably be selecting the Portal component in PTSpy. You can tell from the startup which component to select, as it will say something like:
    OpenLog: verposity level = 2
    OpenLog: Registered application name: ConfigInitialization (local machine only)
    OpenLog: Registered application name: portal.[machinename].Administrator (local machine only)
    The last application name is what you'd use. Make sure you are recording on the machine running the custom app.
    Since you can see it in both browse and edit mode, we know that the search index and the database both know of the card, so it can't be that it thinks the card is missing. At this point, you'd have to go through the PTSpy recorded when you run your app. You should start it right before you initiate the delete, and shut it off after the PTSpy stops recording new lines. You might be able to search for the error code, otherwise you'd have to go line by line to find something related to permissions, though other types of errors (not found, network access problems) might return the access denied message.
    -Mike Headley, WCI Developer Support

  • Is it possible to change the baseentry/baseline/basetype in document lines?

    Hi,
    I have created a PO and a SO with same item in document lines separately. I want to set the BaseEntry, BaseLine and BaseType of PO lines to points to a item line in SO. My code is like below:
                    po.Lines.SetCurrentLine(0);
                    po.Lines.BaseEntry = xxxxx;
                    po.Lines.BaseLine = 0;
                    po.Lines.BaseType = 17; // Sales Order
    When I called po.Update(), i got error code -5002 with error message : Item no. is missing  [POR1.ItemCode][line: 1]. I am sure when i called po.Lines.SetCurrentLine(0), it points to correct line. My question is Can I update the BaseEntry/BaseLine/Base in a existing document line item?
    BTW, since the PO is created separately the BaseEntry and BaseLine are all empty or -1. Now, I am using DI 2007A.
    Please suggest!
    Thanks,
    Lan
    Edited by: ZHANGLAN on Apr 15, 2011 10:03 PM

    Hi Gordon,
    I tried it again to create a new PO with all base document info in the line item, but this time I got error message: "Base document card and target document card do not match." with code -5002. The SO and the new PO have same line item and same qty. But I don't know what does that error message mean? Is it about business partner code? But they are different, in SO it is customer and in PO it is vendor. What's possible reasone for this error message?
    Thanks!
    Lan

  • Document Sequencing in Directory Browse Help

    I need to resequence the order of the documents (cards) view when in browse mode in the Documents Directory. I need to reorder them by the card name instead of ordering by the cards ObjectID, in which is by default its sequencing them now. What do I need to do in BrowseDocViewHelper.CS or the DirBrowseDP.CS objects?? Am I looking at the right direction here? Please point me to the right class objects to modify to get these results... Much obliged in advance for help...
    Ray Salgado, State of Maryland, [email protected]

    Hmmm... That is strange then, this could be a bug. This is the first thing we did. Went in the Folder Editor, there is a section there for "Sorting", an option of "Order this way when browsing" we had set to the "Name" property. We did the same thing for the "Order this way when Editing" option. And yet as soon as I set the Browse Mode again, it orders the documents in reverse, like if it orders by ObjectID. I will report this to Tech Support.

  • Payment against Reserved Invoice

    Hi Experts,
    We are creating Reserved Invoices through the DI API.  The Reserved Invoice is received in just fine.  After the Invoice is processed through the DI API, we then process a payment for the Invoice.  We are getting an error that states "The Base Document Card does not match the Target Document Card".
    Orginally we were processing Sales Orders and then bringing in the payment.  Both were received into SAP with no errors.  We discovered that we could not link the Payment to the Order, so we changed to using Reserved Invoices.  Now we are getting the above mentioned error when processing the payments.
    Does anyone have any suggestions has to why we could be getting this error?  What would be considered the Target Document?
    here is the payment code:
    SAPbobsCOM.Payments vPays = default(SAPbobsCOM.Payments);
                        vPays = (SAPbobsCOM.Payments)vCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments);
    SAPbobsCOM.Documents SapInvoice = default(SAPbobsCOM.Documents);
                        SapInvoice = (SAPbobsCOM.Documents)vCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
    int SapOrder = GetSapInvoiceNumber(OrderNumber);
    SapInvoice.GetByKey(SapOrder);
    vPays.Address = SapInvoice.Address;
    vPays.CardCode = SapInvoice.CardCode;
    vPays.DocDate = PayDate;
    vPays.DocType = SAPbobsCOM.BoRcptTypes.rCustomer;
    vPays.DocObjectCode = SAPbobsCOM.BoPaymentsObjectType.bopot_IncomingPayments;
    vPays.CashAccount = "23500000";
    vPays.JournalRemarks = journal;
    vPays.Invoices.DocEntry = SapInvoice.DocEntry;
    vPays.Invoices.DocLine = 0;
    vPays.Invoices.SumApplied = SapInvoice.DocTotal;
    vPays.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Receipt;
    lRetCode = vPays.Add();
    Thanks,
    Josh
    Edited by: Josh Mellette on Apr 28, 2009 5:09 PM

    Dear Josh Mellette,
    The invoice type should be invoice 13 but not Receipt
    vPays.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Invoice;
    and you need to set cash sum if you pay the invoice by cash
    vPay.CashSum = SapInvoice.DocTotal;
    and please check if the DocEntry of the invoice is correct by check OINV table.
    Best Regards
    Jane Jing
    SAP Business One Forums team

  • Purchase order based on Sales order

    Hi,
    I try to create Purchase order based on Sales order.
    The error message :
    "Base document card and target document card do not match"
    My code:
    oPurOrder.Lines.BaseEntry=oSalesOrder.DocEntry
    oPurOrder.Lines.BaseLine=oSalesOrder.Lines.Linenum
    oPurOrder.Lines.BaseType=17
    Could you help me please ?
    Tks.
    Laetitia

    Hi,
    Looking at your code I will check how you fill the fields in the oPurOrder object because the code you copied is only for the document lines and the error refers to the document itself (maybe you forgot to assign the cardcode property).
    If you are basing the document, a good and reliable method is to export the base to a xml file and load the target using this file. This way you garantee that all the info of the document is copied. After that you could use your code to update the info you want to change the same way you pasted it in your post.
    Hope it helps,
    -M

  • Error whilst posting a payment against an invoice ..

    I'm trying to post a payment against an invoice but i'm getting an error saying 
    "Error -10: Base Document Card and Target Document Card do not match"
    The code is shown below
    // Post a payment against this invoice  ..
                Payments oPay = (Payments)B1Connections.diCompany.GetBusinessObject(BoObjectTypes.oIncomingPayments);
                oPay.CardCode = form.DataSources.DBDataSources.Item("@MyFileName").GetValue("U_BPCode", 0);
                oPay.CardName = ((EditText)form.Items.Item("CardName").Specific).Value;
                oPay.Reference1 = ((EditText)form.Items.Item("DocEntry").Specific).Value;
                string workFld = ((EditText)form.Items.Item("U_Balance").Specific).Value;
                oPay.CashSum = Convert.ToDouble(workFld);
                oPay.CashAccount = "161010";
                oPay.DocType = BoRcptTypes.rCustomer;
                oPay.Invoices.DocEntry = invoice.DocNum;
                oPay.Invoices.DocLine = 0;
                oPay.Invoices.InvoiceType = BoRcptInvTypes.it_Receipt;
                oPay.Invoices.DiscountPercent = 0;
                oPay.Invoices.SumApplied = invoice.BaseAmount;
                oPay.Invoices.Add();
                int rtnCode = oPay.Add();
               Utility.handleAnError(rtnCode);
    I've checked the obvious that the invoice.DocNum does relate to the business partner in oPay.CardCode ..
    Anyone any ideas ?  The invoice is a service invoice and I don't have any Sales Order or anything for it  ..
    TIA

    Rob,
    which ?
    Robins or mine ?
    EDIT: is see Robin was right
    i place this in my "answered questions" book for other members
    regards
    David
    Edited by: David Nussböck on Jun 3, 2008 3:11 PM

  • Component item duplicated in Posting Purchase Order (BOM Template) from XML

    Hi,
    I have a SDK program that posts draft document using XML.  I have a problem in posting a Purchase Order using a bom template from XML, it duplicates the component items of the document. Here is an example of the transaction.
    Draft Document to be posted----
    Card Code - PM0013
    Status - Draft
    ItemCode         | Quantity           | UOM          | Warehouse         | Profit Center        | Price     
    PMBX13            1                        set               DHO                      KAP                        
    PMBX13-B        1                        piece            DHO                      KAP                      USD 0.8000
    PMBX13-C        1                        piece            DHO                      KAP                     
    PMBX13-P         1                        piece            DHO                       KAP
    Draft Document to be posted----
    Posted Document----
    Card Code - PM0013
    Status - Open
    ItemCode         | Quantity           | UOM          | Warehouse         | Profit Center        | Price     
    PMBX13            1                        set               DHO                      KAP                        
    PMBX13-B        1                                            DHO                      KAP                      
    PMBX13-C        1                                            DHO                      KAP                     
    PMBX13-P        1                                            DHO                       KAP
    PMBX13-B        1                        piece            DHO                      KAP                      USD 0.8000
    PMBX13-C        1                        piece            DHO                      KAP                     
    PMBX13-P        1                        piece            DHO                       KAP
    Posted Document----
    Thanks!

    Hi Cecille,
    When adding template BOMs to a marketing document via the DI API, you only need to add the BOM header item and not the components. When the DI API adds the document it will copy the components from the BOM definition. This is why your components are doubling up. If you want to be able to edit the components then you'll need to add the PO using the DI API (with just the BOM header in your XML) and then reload it in to a PO object. You'll then be able to loop through the component lines and edit quantities etc.
    Kind Regards,
    Owen

  • Link Purchase Order to Sales Order

    Hey All,
    I am trying to link a purchase order created via the DI API to a sales order in the B1 system.
    I set the following fields:
    B1Document.oDocument.Lines.BaseEntry = B1Detail.BaseDocEntry;
    B1Document.oDocument.Lines.BaseLine = B1Detail.BaseDocLine;
    //set base type to sales order = 17
    B1Document.oDocument.Lines.BaseType = 17;
    When I add the purchase order I get this error message:
    Unable to Create Document. Error: Base document card and target document card do not match.  [POR1.VatGroup][line: 1]. -
    After searching for this error I found forum posts relating this to mismatched cardcodes when adding invoices based on sales orders etc.. But the PO will always have a different cardcode then the sales order. I can link the purchase order using the B1 client using the PO checkbox on the sales order form with no problems.
    Am I doing something wrong or is this not possible to do via SDK?

    OK I even tried setting this in XML:
    xmltemplate.InnerXml.Replace("<BaseCard></BaseCard>", "<BaseCard>C20000</BaseCard>");
    I then used that xml to load the purchase order object via GetBusinessObjectFromXML and it still gets the same error. Is there anyone who has figured out a way to do this?

  • Outgoing Payment with journal Entry

    Hi guys I need your help
    I need to be able to do an outgoing payment based on a journal entry. This is my code but I get this error:
    "Base document card & target document card do not match"
    The journal is based on an incoming payment that was over paid and has a remaining balance.
    Thanks
                oOutPay.DocTypte = SAPbobsCOM.BoRcptTypes.rCustomer;
                oOutPay.CardCode = "CC0001";
               //oOutPay.Invoices.Add();
                oOutPay.Invoices.DocEntry = 106;
                oOutPay.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_JournalEntry;
                oOutPay.TransferAccount = globals.bankTrAccOP;
                oOutPay.TransferSum = 80;
                int lRetCode;
                lRetCode = oOutPay.Add();

    Hi Costas,
    In order to based the payment on Journal Entry,
    You have to set the docline of the Payment to Journal Entry Line which has the same cardcode as your payment card code like this
    oPay.Invoices.DocLine = oJE.Lines.Line_ID
    What I do is I iterate through the Journal Entry to look for the line like this :
    If .Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_JournalEntry _
                                        Or .Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_PaymentAdvice Then
        Dim oJE As SAPbobsCOM.JournalEntries
        oJE = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
        oJE.GetByKey(.Invoices.DocEntry)
        For iLines As Integer = 0 To oJE.Lines.Count - 1
        oJE.Lines.SetCurrentLine(iLines)
        If oJE.Lines.ShortName = .CardCode Then
        'If the line card equal payment card code, then assign the docline id
              oPay.Invoices.DocLine = oJE.Lines.Line_ID
              System.Runtime.InteropServices.Marshal.ReleaseComObject(oJE)
              oJE = Nothing
              Exit For
         End If
        Next
    End If

  • Incoming Payment / Journal Entry

    Hi people
    I'm working in 2005 SP01 PL27
    I'm trying to do an Incoming Payment based in a Journal Entry.
    I have the follow journal entry
    Account: 572000 Credit: 185.2 (line 0)
    Account C00001 Debit: 185.2 (line 1)
    Code is like this
    lPago.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_JournalEntry
    lPago.Invoices.DocEntry = mRS.Fields.Item("TransID").Value
    lPago.Invoices.DocLine = mRS.Fields.Item("Line_ID").Value ' Value (1)
    I fill CardCode and anymore mandatory fields, but and error message says me:
    Base document card and target document card do not match
    Any idea?
    Thnx in advance

    Hi Juli,
    iam programing at this moment a payment tool.
    i don't use Invoices.DocLine and its working fine
    btw - i think i had a similar problem when i didnt use
    oPay.DocType = rCustomer or rSupplier
    regards

  • Journal Entry DocEntry

    Hi Experts
    how to know the DocEntry of Journal Entry
    because when im uploading IP in DTW and the DocType is JE i was failed to upload because it say's "Base document card and target document card do not match. [RCT2DocLine][Line8]
    hope you can help me..thanks

    Hi,
    1. Are you uploading incoming payments-checks? If yes, run below query to get docentry of AR invoices.
    Select * from OINV
    2. Please refer below threads:
    Upload Incoming Payment using DTW
    Import incoming payment with DTW
    Thanks & Regards,
    Nagarajan

Maybe you are looking for

  • Mid year go live INLK

    Hi All, I have copied INLK and making changes to INLK can any one tell me. Which is the rule I have to change for basic pay, For ex: for HRA I have to edit " <b>INKR</b> " can any one tell me what is the rule for basic pay. Thanks Veeresh

  • New MacBook Pro disabled keystrokes! HELP!

    Hi there, folks After upgrading to the new MacBook Pro and and the Leopard operating system I can no longer use the keyboard keystrokes that replicated hitting the 0 or asterix on the number pad. It used to be fn+m for ram preview and fn+j for markin

  • Execution time of a flat-sequence

    Hello there - Is there any way to get a measurement of how long each part of the flat sequence takes to execute?  Anything like matlab's "tic" and "toc" commands in labview?  I have been playing with it for a while now and have yet to discover if Lab

  • Taking Files Home Then Returning - Imported Graphics

    I'd be interested in techniques for copying Frame files from the office shared drive for homework purposes, then returning the files to the office, when those files have graphics imported by reference from the office shared drive. Right now all the g

  • Thinkpad x220 display problems very bright

    I just bought my laptop in March 2012 and I've run into this problem 3 times since then.   All of a sudden, the display will become very bright, oversaturated, for every application that I have open.   The pixel sizes remain the same, and most of the