Create Invoice From a Draft

Hi everybody,
                    I'm trying to create an invoice from an existing draft by code and i can't...i use this code to do this, but it create a new draft instead an invoice.
oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode
oCompany.XMLAsString = False
oDrafts = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts)
oFacts = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
oDrafts.GetByKey(20)
oDrafts.SaveXML("C:\draft.xml")
oFacts = oCompany.GetBusinessObjectFromXML("C:\draft.xml",0)
oFacts.DocObjectCode = SAPbobsCOM.BoObjectTypes.oInvoices
oFacts.Add()

Hi Mariano Bertini,
Can you pls share the code as i'm facing the same problem for conversion of open draft a/r invoice to invoice

Similar Messages

  • Problems creating invoice from order (DI API and SBO)

    Hello all!
    I´m getting various tax problems using the following code to automatically create invoices from existing orders.
    For Each currentKey In arrABEntrys
      objInv = objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
      objAB.GetByKey(currentKey)
      objInv.CardCode = objAB.CardCode
      With objInv.Lines
        .BaseType = SAPbobsCOM.BoObjectTypes.oOrders
        .BaseEntry = currentKey
        .BaseLine = 0
        For i = 1 To objAB.Lines.Count - 1
          objInv.Lines.Add()
          BaseType = SAPbobsCOM.BoObjectTypes.oOrders
          .BaseEntry = currentKey
          .BaseLine = i
        Next
      End With
    If objInv.Add() = 0 Then
    Else
    End if
    The result of objInv.add() was first "5002 - 'Tax Definition (1)' (a very informative message to me).
    Then I checked my admin tax settings and put a check on "EU".
    The next time the result was "10 - Customer´s tax ID not defined OINV.LicTradNum"
    Actually, I don´t want to pre-set any fields in the invoice, because the order looks complete to me.
    By the way: The error occurs in SBO, too.
    Thanks for help in advance!
    Best regards
    Marian

    Hi Marian,
    Your Error "10 - Customer´s tax ID not defined OINV.LicTradNum" is not working (through DI and in SBO)
    occurs because your "Federal Tax ID" is not set up against the Business Partner. (This is on the main page of the Business Master Data Screen).
    Set this up and it will work in SBO and the DI API!

  • Unable to Create Invoice from iSupplier

    I am unable to create invoice from isupplier module,
    the moment i click on create invoice "with a PO" or "without a PO" under finance Tab,
    i get this error "You cannot complete this task because you accessed this page using the browser's navigation button(the browser Back button, for example).
    But I have not accessed the pages with any browser navigation buttons at all.
    please advise what may be preventing me from creating invoice?

    This is caused by the incorrect setup of the browser.
    The browser's "Temporary Internet Files" setting for "Check for newer versions of stored pages" was set to "Never". This caused the browser to pull up the old data instead of querying the server.
    Please make sure the browser's "Temporary Internet Files" setting for "Check for newer versions of stored pages" is set to "Automatic".
    You Used Your Browser's Navigation Buttons To Get Here (Doc ID 1214138.1)

  • Can we create invoice from po instead of receipt in P2P

    Hi,
    how to create invoice from po in p2p instead from receipts.
    Thanks and Regards,
    Srikanth

    Hi Srikanth,
    You don't need a receipt to create an Invoice.
    All depends on your matching preferences.
    2-way. 3-way, 4-way - Please go through the documentation.
    Thanks
    Vinod

  • Creating Invoice from a Delivery Note using SDK

    Hi,
    I am working on SAP 2005 A Patch 4 with SQL 2000 SP 4. I am using VB.NET (VS2005). I am trying to create a Invoice from a Delivery note which is created based on a Sales order.
    I am getting the following error
    Error occured while saving Invoice: 0 - '15' is not a valid value for field 'BaseType'. The valid values are: '-1' - '',  '0' - '',  '23' - 'Sales Quotation',  '17' - 'Sales Order',  '16' - 'A/R Returns'
    The Code that i used to create the invoice is as follows
    Dim oInvoice As SAPbobsCOM.Documents
            oInvoice = pcompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
            oDelivery = pcompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
            Try
                If oDelivery.GetByKey(iDlvNo) = True Then
                    sTaxCodes = sTaxCode
                    oInvoice = pcompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
                    oInvoice.CardCode = oDelivery.CardCode
                    oInvoice.SalesPersonCode = oDelivery.SalesPersonCode
                    oInvoice.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
                    oInvoice.DocumentSubType = SAPbobsCOM.BoDocumentSubType.bod_None
                    oInvoice.Address = oDelivery.Address
                    oInvoice.ShipToCode = oDelivery.ShipToCode
                    oInvoice.Address2 = oDelivery.Address2
                    oInvoice.JournalMemo = "Invoice - " & oDelivery.CardCode
                    oInvoice.Comments = "Based on Delivery  " & oDelivery.DocNum
                    oInvoice.PaymentGroupCode = oDelivery.PaymentGroupCode
                    oInvoice.DocDueDate = Now.Month & "/" & Now.Day & "/" & Now.Year
                    For iRowNo = 0 To oDelivery.Lines.Count - 1
                        If iRowNo > 0 Then
                            oInvoice.Lines.Add()
                        End If
                        oDelivery.Lines.SetCurrentLine(iRowNo)
                        oInvoice.Lines.ItemCode = oDelivery.Lines.ItemCode
                        oInvoice.Lines.Quantity = oDelivery.Lines.Quantity
                        oInvoice.Lines.Rate = oDelivery.Lines.Rate
                        oInvoice.Lines.BaseType = SAPbobsCOM.BoAPARDocumentTypes.bodt_DeliveryNote
                        oInvoice.Lines.BaseEntry = iDlvNo 'DocEntry of Delivery Note
                        oInvoice.Lines.BaseLine = iRowNo
                        oInvoice.Lines.TaxCode = sTaxCodes
                    Next
                    iReturnValue = oInvoice.Add()
                    If iReturnValue <> 0 Then
                        pcompany.GetLastError(iReturnValue, sErrorDescription)
                        Throw New Exception("Error occured while saving Invoice: " + _
                                           iErrorNo.ToString() + " - " + sErrorDescription)
                    Else
                        MessageBox.Show("Invoice created succesfully")
                    End If
                End If
    Since in the error message it has specified that i have given the BaseType as Delivery which has a value of 15 i changed that from bodt_DeliveryNote to bodt_Order which has a value as 17.
    When i tried creating the invoice again it gave the error
    Error occured while saving Invoice: 0 - Target item number does not match base item number.  [RDR1.TargetType][line: 2]
    I am not able to proceed further ... can any one help me
    thanks in advance
    Ganesh

    Greetings,
    I am having a similar problem, only I'm doing it as suggested in Louis' reply.  In fact I copied that code and tried it.  It's giving me a 2028 error with no description.
    I had been doing it slightly differently and the error I was getting was 5002 "Item no. is missing [INV1.ItemCode][line 2]"  I don't have 2 lines and I'm certain I have an item code.  The numbers I'm putting in for baseentry & baseline are absolutely in the table and the order is open.
    Here is that code:
            oDNUpd = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
            oDNUpd.CardCode = CardCode.Text
            oDNUpd.Lines.BaseEntry = CInt(SalesOrder.Text)
            oDNUpd.Lines.BaseLine = CInt(baseline.Text)
            oDNUpd.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
            oDNUpd.Lines.Add()
            lretcode = oDNUpd.Add
    I'm using SBO 2005 patch 7 (and the new dll).  I have similar code doing a stock transfer and it's working fine.
    Thanks for any suggestions you can offer
    John

  • Function module to create Invoice from the Delivery no ?

    Hi All,
    Is there any way (function module) to create an Invoice from the Delivery no and the Billing Type ? We do not want to go with BDC for transaction VF01.
    Details:
    We want to generate a pro-forma invoice while saving the delivery. We will have 'Special Function' (NAST-NACHA = 8) in the output determination and a routine would be called from there. That routine would contain the code to generate the Invoice. We will have only the 'Delivery no and the Billing Type'  in that routine. So trying to find any function module which can create an Invoice from the Delivery no and the Billing Type.
    Any suggestion / hint  is welcome.
    Thanks,
    Ashok

    Hello Ashok Satapathy ,
                                        The only option  for you is to call the FM "GN_INVOICE_CREATE" .
    There is no special FM availaible to pass only the delivery number at this point.
    You need to retrieve all the delivery information details and need to pass it to the FM "GN_INVOICE_CREATE".
    Thanks,
    Greetson

  • Create invoice from delivery

    Hi,
    i have different  sales order numbers.against all these sales orders a delivery is created.now i want to create a invoice against this delivery.is there any bapi/fm to create invoice using this delivey only.(i dont have any po details i.e.no po is created)...can any one help me in finding this ...its an urgent thing.....thank you...
    Thanks,
    Bhaskar.

    You can use transaction VF01 in batch input mode (call transaction VF01 using ...)
    To get an idea of how batch input data should look like for this transaction use SHDB transaction before - to record an example VF01 transaction.
    Preparing batch input data for transaction VF01 is quite simple - all you have to do is to enter delivery document number and have diskette icon clicked.
    good luck

  • Can't create invoice from the delivery

    Hello.
    Ship out the trade order then i created the delivery and PGI successfully.
    But when i went to VF01 to invoice the delivery i can´t create it.
    I take a look to the LOG and this is what i found:
    Error Log
                 6910517662 000010 The item is blocked for billing
    I double click the item and in the configuration of Financial processing there is a field called "Block" but there is nothing selected over there. Do you have any suggestion?
    I appreciate your help

    The item is blocked for billing
    Apart from the suggestions, if that particular material is kept open in some other system, then also, system will throw this error.  Also ensure that in material master Sales Org.1 view, this material is not blocked against the field "X-distr.chain status"
    thanks
    G. Lakshmipathi

  • Creating Invoice from goods receipts PO

    Is posible create a invoice using all goods receipts PO to one provider, or is necesary create one invoice by goods receipt PO document?

    Hi
    I didn't understand what you mean but my guess is
    You want to merge multiple GRPO into One invoice ..
    If I am correct ,
    Document Generation wizard is only available in A/R module side
    You can take a look at this  from Sales A/R> Document generation wizard
    But.. You can use  Copy from  to merge multiple document and convert into one if it is one provider .
    on purchase order side
    Hope this helps
    Bishal

  • Create Invoice from multiple GRPOs with Landed Costs

    Hello all, again,
    Sorry to bother again, but this one seems strange to me. Consider the following business process:
    1) One Purchase Order is created in SAP, and sent to provider (no journal entry)
    2) Several partial deliveries are received and posted to inventory (inventory @ invoices to be received)
    3) Partial deliveries are pulled into Landed Costs document (inventory @ invoices to be received)
    4) Steps 2) and 3) may be repeated several times
    5) Invoice of provider is received, with the total amount as per PO
    Now in step 5, I have no possibility of "pulling" the PO from step 1), neither pulling the GRPOs created in step 2), because they were used in the Landed Costs document. It is also not possible to "push" the PO to Invoices (only the open amount would be pushed, not the delivered amount). It is only possible to push a single GRPO to Invoices, resulting in lots of manual work and incorrect representation of provider's invoices (1 PO is delivered in up to 100 different shipments of varying quantity).
    The only reasonable solution I see at the moment, is to use a service invoice and post it directly to the "invoices to be received" account. Or do you have any other ideas/solutions?
    Thanks for your suggestions,
    Joerg.

    I should is correct. Yet it is not possible. I am using 2007 SP00, PL 47.
    Do you think I should send the issue to SAP? Do you know of any notes about this issue?
    Thanks,
    Joerg.

  • A/P Invoice created from Approved Drafts, through DIAPI

    Please I need help with this error.
    I need create A/P Invoice  from approved drafts with DIAPI.
    There are no errors if the "A/P Invoice" is copy of "Purchase Order" or without base document. In this case the Invoice is created without problems.
    But, if the invoice is copy of "Goods Receipt PO", it is not created and DIAPI retrieve an error:
    "Field cannot be updated (ODBC -1029)"
    is a bug in  sdk?
    Thanks a lot.
    Please help.

    Hello Norman,
    This sounds really like a bug which you should report to SAP Support... - sorry!
    ...but let me (and others) give you some advice how to be more sure in such conclusions:
    In such cases you should check:
    a) Does it work in the B1 GUI application?
    If yes, it's a bug (or limitation?) which you should raise to SAP Support.
    ...and of course it works...
    b) If you are not sure about a) - or if there are problems too, but you still think it should work... you should check the DB documentation.
    In your case the information is more-or-less obvious (could surely be easier to find...) available as the "Constraints" for the field PCH1.BaseType...
    The DB documentation says that Purchase Orders + Goods Receipts POs (GRPO) as base types - and thus your problem is certainly a bug (but Support will do the final judgement).
    But you should make sure that the GRPO is OK - i.e. the lines you need are not closed etc., but I assume you checked all that a couple of times already.
    Regards,
    Frank

  • How to create A/R Invoice from draft

    Hi,
              How to create A/R Invoice from documnet draft using DIAPI.
    Thanks,
    P.Suresh Kumar

    Hi Suresh Kumar,
    You may check this as a reference: Re: Problems while saving the tax values in a Draft Document to AP Invoice
    Thanks,
    Gordon

  • Item Quantity not Copied exactly from sales order while creating Invoice

    Hi Experts,
    at
    My Functional Guy encountered a strange problem while creating Invoice from Sales Document.Actually there are 6 line material items in the order and the sixth line item is having a quantity of 8EA While trying to generate an invoice from sales order the sixth line item billed quantity gets converted to 70EA automatically  in the invoice .This only happens with the sixth line item and the remaining all are fine.I have checked OSS Notes and could not get a.ny fruitful results.Please let me know if you have any suggestions.I also checked with the functional guy whether its the problem due to copy controls.But everything is fine.Please help
    Best regards,
    Lakshman

    Are your invoices combing multiple delivery line items based upon copy control/invoice split/combine configuration settings?
    If your order was for 8 and you delivered 8, and there is no conversion for units, and the only quantity being included is for a single order line and delivery line, then there must be an error in customer-written exit or enhancement code that you have yet to find.  What do you see in debug when the data for this line is being collected and set?
    Edited by: DaveL on Sep 6, 2011 4:19 PM

  • Problems in creating Invoice using BAPI

    Hello Friends,
    I am using a BAPI BAPI_BILLINGDOC_CREATEMULTIPLE to create invoice from a sales order, but i am not able to change the payer value.
    The payer is by default taken from Sales-Order, even if i change it in Payer value passed to BAPI.
    Please suggest me a solution.
    Sandeep.

    To answer your question I would need to know what stack trace comes back with.
    I also need to know the set up.. Is the applet running on you personal machine and what operating system are you using.
    Lee

  • One Invoice from 2 deliveries

    Hi Gurus,
    can anybody Plz help?
    1.) Suppose i have two deliveries say 80015009 and 80015010. I want to make one invoice from it how to do it? I tried through VF01 and also all the header data is same. is there any copy control setting which is left out?plz answer in details?
    2.) In case of STO Intra company I have purchase order through ME21N, Than created a delivery by VL01n and now that i am trying to create Invoice from it , it says " Not relevant for billing" can anybody plz help?
    3.) How to make Multiple deliveries in STO Intracompany from One Purchase order?

    1. check for you PO no in standard system po is also one of the selection creteria in zuk table -- dist channel, div and purchase order.
      or change you ref no alter no in copy control.  may be po mentioned in it. check vbrk/vbap field in copy control (item)-select sample
    2. in sto process you have select through collective processing only VL10b or vl10g.
    3. select fore ground(not back grond)--select only single doc(PO) and in the del doc you change qty

Maybe you are looking for

  • How to make a virtual channel in MAX using DAQmx ?

    I want to measure the CJC temperature on the TBX 1328 ( attached to SCXI 1121). I want to create a virtual channel in MAX using DAQmx. I have right clicked on DAQmx but there is no option for virtual channel. Ther is the option of 'Traditional virtua

  • Mail send error in Oracle UCM Test Mail/Notifications

    Hi Everyboby, I have configured workflows which need approval. While the documenr is checked in the notification should be fired to the reviewer. But the mail notification is not working. Also I have tried to login as sysadmin and tried the Administr

  • Mouse right click copy and paste issue

    No matter if I use the trackpad or any mouse if I go to copy & paste something to the end of a sentence it will backspace to the next word. I can hit SPACE and seperate it and it will still backspace into the last word like this. Example. Hello my na

  • Parallel option for DML

    Hi , I have 8 cpus on my server . I want to insert data from tab1 into tab2 as follows : insert into user1.tab1 select * from user1.tab2 ; I wanted to utilize the parallel option in above query and i tried INSERT /*+ PARALLEL(user1.tab1,5) */ INTO us

  • Best quality on screen

    Hi there, Could someone please remind me what setting I should use to get the best quality when I preview my edited sequences on my computer. I find that the text that I included via the video generator is not looking sharp and the video does not loo