Invoice from order in B1WS

Hi,
I can see that is possible in DI server to create an invoice from a sales order. Can anyone point me in the right direction for doing this with B1WS?
Thanks
Iain

njmog1 wrote:
I think it should be possible, in the same way as the DI (Apologies if it isn't but in theory it should be)
>
> You link documents on a line level instead of a header level. The needed properties on the line level are BaseType, BaseEntry and BaseLine. If you set these, the document will pull through the information from the base document.
Thank you for the support! Although not strictly an answer it helped motivate me to figure the thing out.
Relatively straight forward in the end, this is my code in case it can help someone else -
Dim myInvoice As Document = New Document
myInvoice.CardCode = "XXX01"
Dim DocLine As DocumentDocumentLine = New DocumentDocumentLine 'just used to define type in the array
myInvoice.DocumentLines = Array.CreateInstance(DocLine.GetType(), (1)) 'create the array with your amount of lines
Dim DocLine1 As DocumentDocumentLine = New DocumentDocumentLine 'define the lines of your document
          With DocLine1
                .BaseEntry = 21175
                .BaseEntrySpecified = True
                .BaseLine = 0
                .BaseLineSpecified = True
                .BaseType = 17 '17 for sales order, 15 if you want to base this on a delivery note
                .BaseTypeSpecified = True
            End With
            myInvoice.DocumentLines.SetValue(DocLine1, 0) 'set your document lines
            myInvoiceService.Add(myInvoice) 'add invoice
Iain

Similar Messages

  • Restrict multiple Proforma invoice from order

    Hello All,
    Our customer wants to restrict multiple proforma invoice from sales order.I have written a logic in copy requirement routine.Its working when there is already created invoice from order .But if i try to create invoice first time from order then system doesn't allow me to create invoice and giving message "No billing document were generated ".
    Could anybody help.
    Regards,
    Sachin

    Hi,
    Restrict multiple Proforma invoices
    Thanks & regards.

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

  • Po no in invoice from order

    hi guru's
    i  do order related billing ........when i create invoice  it not copy the P O no. mention in  order. to invoice.......
    pls suggest

    HI,
    If you put at header level reference number in copy control settings then u will get it PO number in invoice document..
    U can use even assignment number also for this. Both will work in the same way..
    But generally people will prefere reference number field for this purpose..
    Regards
    sankar
    Edited by: sankar sankar on Aug 20, 2008 4:27 PM

  • I ordered a iPod touch , and it says I need an invoice. Shipment requires commercial invoice from customer or seller ?

    I ordered a iPod touch , and it says I need an invoice. Shipment requires commercial invoice from customer or seller ?

    Ordered from whom?
    In " and it says I need an invoice" what is "it"
    Are you specifying special shipping?

  • Copy price conditions from order to invoice

    Dear experts,
    I have a problem I can't solve myself !
    When we create an invoice from an order, the conditions are copied using a predefined pricing procedure in customizing ... Now, I think I have a strange problem ... When the conditions are copied from the order to the invoice, the inactive conditions are not copied (which seems normal) ... Now, I would like one inactive pricing condition (ZPRO) to copied always, because this one is mandatorry on invoice and otherwise I get an error while copying ... Is there a userexit where I can force this ? And how do I implement this ?
    Thanks in advance for the answers ...
    Greetz,
    Kurt.

    Hi,
    Try this.
    GO to the VTFA transaction..
    Give the source sales document type and target billing type..
    Press item button..Choose the item category..
    In the pricing type give "D" (Copy pricing elements unchanged)...And check again..
    This might work..
    Thanks,
    Naren

  • A/P Invoices FROM Purchase Order

    Hi,
           how can I create a Purchase Invoice from purchase Order in DI API ?
    thanks
    Leonardo Correa

    Hi Leo,
    you have to create two objects
    oPO = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)
    oPI = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)
    than you use oPO.GetByKey(DocEntryFromPO)
    to load the old Purchase Order in the Object
    than you copy the properties to the PurchaseInvoice Object
    oPI.CardCode = oPO.CardCode
    oPI.Lines.SetCurrentLine(0)
    oPO.Lines.SetCurrentLine(0)
    oPI.Lines.ItemCode = oPO.ItemCode
    and you also have to "link" the lines - make a loop.
    oPI.Lines.BaseEntry = DocEntryFromPO
    oPI.Lines.BaseLine = oPO.LineNum
    oPI.Lines.BaseType = bodt_PurchaseOrder
    thats it - this are the important steps.
    i hope it helps enought
    regards
    David

  • Getting double intercompany invoice from one STO orders

    Have you already implemented the following flows and if yes how ?
    I would like to build an intercompany STO between company A plant 1 and company B plant but with a 3rd company C responsible of the order, That means that i would like to get 2 intercompany invoice from the replenishment delivery --> One IV invoice from company A to company C and one IV invoice from company C to company B.
    I didn't find anything in standard. If someone already faced the same issue, thanks in advance for the advice.
    Regards,
    Marc

    Hi Ravi,
    My business scenario is very standard stock transfer order across two company codes.
    Only difference is that SAP Retail is in place in my R/3 system.
    Scenario:
    - A sales order is being created for end customer under a sales area and article (material) in one site (plant), say site- DC02. This site does not have stock for that material.
    - A STO PO is created with supplying site say DC01 and receiving site as DC02.
    - Site DC01 is in company code- FS01 and site - DC02 is in company code- FS02.
    - Intercompany delivery has been created for STO PO by VL10B and goods issues from site - DC01.
    -  Goods received is done against same STO PO in site - DC02.
    - Goods issued to end customer against the Sales order and later invoiced. - No error at all.
    - A intercompany invoice needs to be raised from company FS01 to FS02 for the intercompany delivery done - Here getting error.
    Please suggest, if you know that in case of SAP retail, we can create intercompany invoicing or not.
    If yes, how to do that. Standard intercompany setting can not be done as site profile is maintained by WB02, after the plant is created.
    Regards,
    Praveen

  • Two invoice types order-related from the same sales order type

    Hi experts,
    I need to assign a different invoice type to two different items categories regarding to invoice each item with a different invoice rumber range and a different accounting document type (one 'RV' and another 'PF').
    Neither of them have delivery.
    I' ve assigned in the copy controls from sales orders to invoices the items categories to the corresponding invoice type in order to avoid the items are invoiced by wrong invoice type.
    Exem:
    item category ZIC1 must be invoiced by invoice type ZF1
    item category ZIC2 must be invoiced by invoice type ZF2
    I executed VF04 twice: first regarging to create ZF1 and second create ZF2.
    1)  If I insert ZF1 invoice type (order-related) by default in the sales orders definition (Sales and Distribution -> Sales -> Sales -> Sales Document Header -> Define Sales Document Types), the item ZIC1 is properly invoiced and the ZIC2 too. But: although I already invoiced both items, SAP laves the sales order opened waiting to create ZF1 for ZIC2.
    2)  If I don't fill the invoice type by defautl, the invoicing can't be done because the invoice type isn't determined (VKDFS-FKART empty).
    I want to know if  there is any exit to change the values of VKDFS entries for each item of sales orders before to process this table with VKDFS.
    Thanks in advance,
    Aupalaura

    Hi,
    thanks a lot for the quick answer.
    But in save document prepare it's not this structure. And the field for save the invoice type by default is at header level FKARA (in VBAK table).
    Anyway, I'll check it.
    Regards,
    Aupalaura

  • Invoice from sales order

    My requirement is to get invoice from vbfa table by delivery no., where vbtyp_n is M or N. But there are some deliveries which vbtyp_n is not 'N', then to get those invoices:
    I went to lips table retrieve sales order and item(vgbel, vgpos) for a particular delivery.
    then I went to vbrp table to get the invoice by sales order and item.
    But my question is performance is not good in this way, Is there is any better way to achieve this? Your inputs please.
    Thanks
    Shailaja

    Hi,
    You are right,
    Instead of using the relationship between LIPS and VBAP
    LIPS-VGBEL = VBAP-VBELN and LIPS-VGPOS = VBAP-POSNR (order related)and
    VBRP-VGBEL = LIPS-VBELN (delivery) VBRP-VGPOS= LIPS-POSNR and
    VBRP-AUBEL = VBAP-VBELN (Order) VBRP-AUPOS= VBAP-POSNR
    it is advisable to use VBFA to fetch the linked documents since it is faster.
    so to get the billing doc for the sales order from VBFA
    pass Preceding doc type = C and Prece doc no = Sales Order
    and subsceeding doc type = M and you will get the billing doc for that sales order.
    To get the delivery for sales order pass the Subsceeding doc = J to VBPA
    hope this is usful
    reward points if useful
    regards,
    ANJI

  • Mutiple commercial Invoicing from single Sales Order

    Mutiple Invoicing from an single SO (Invoicing from SD)
    Refer the requirement posted below
         PO issued by the customer requesting supply in multiple consignment (Multiple Sets)
         Single Set may be delivered by multiple trips  
         Every consignment/trip released accompanies an excise invoice
         When the shipment is completed for one Set then one consolidated commercial invoice is raised, details of
                          excise invoice   number and logistics receipt information are entered 
         Sales order is closed only when all the Sets of materials are completely delivered.

    Hi
    Whats the problem in this case.. This is pretty standard business scenario....
    If you are using Costing based COPA, your COGS would post to COPA upon billing... Hence, total revenue as well as cogs will be posted at same time
    br, Ajay M

  • Unable to add Invoice from a sales order draft.

    Hi all,
    I have a customer who is trying to add an A/R Invoice from a sales order draft and is receiving this error, "applied amount cannot be negative in the base document [Message 439-182]"
    If anyone has seen this before or has any suggestions that would be great.
    Best Regards,
    Jeff Haldeman
    Support One

    Hi Jeff,
    Can you also let us know what where the contents in Sales Order and the resultant AR Invoice?
    The Quantity , Price and the Total
    Regards,
    Jitin
    SAP Business One Forum Team

  • Hello. I have bought an iMac in Ft.Lauderdale but now i'm in Ukraine. I lost the receipt and in order to get my iMac fixed they told me to get an invoice from Apple. So how can i get an invoice from Apple?

    Hello. I have bought an iMac in Ft.Lauderdale but now i'm in Ukraine. I lost the receipt and in order to get my iMac fixed they told me to get an invoice from Apple. So how can i get an invoice from Apple? Thank you!

    If you bought it from an Apple Store you will need to contact the Apple Store to see if they can help you. This forum is a user to user forum and frankly I've never seen a question like yours come up. If you purchased it with a credit card then it should be pretty simple to get a copy of your statement and see if the "they" you are referring to will accept that as proof of purchase.
    Good luck!

  • Unable to print order invoices from CRM in V3

    Hi, in old interface I can print off individual invoices for orders received but when I try in V3, I get a very poor result which looks more like a screen print.
    I have tried doing this for individual orders and bulk orders but with same result.

    Hi Jim,
    I'm not seeing a difference when viewing the print previews in both v2 and v3.  Maybe I'm missing something but if you could provide more details like a screencast of the differences please post here. 
    v2
    v3
    Or you can always reach out direct support (live chat) under Business Catalyst for quicker assistance here. 
    - http://helpx.adobe.com/contact.html
    Kind regards,
    -Sidney

  • Customer Down Payment invoice (from delivery) not automatically assigned

    If I create a Down payment invoice from Sales Order (and I paied it) on the final invoice the sistem automatically assigne the down payment invoice on the final invoice for the order.
    If I do the same think but crerating the Down payment invoice from the delivery (and I paid it) when I create the final invoice I need to assigned it manually.
    SBO 8.81 PL 06
    I haven't found any set up for this, so I think is an error the sistem must work on the same way if the document is copied from the Sales order or delivey.
    Someone know if there is some set up? or I need to open an error message to SAP?
    Thanks

    My question is:
    If I make a sales order.
    I create a down payment invoice using copy from SO.
    I make the incomuing payment for the down payment invoice.
    I create the delivery from the SO
    I create the invoice from the delivery
    The system apply automaticaly the down payment invoice to the invoice (because I select a delivery that is linked to the so that I used to create the down payment invoice).
    If I make a sales order.
    I create the delivery from the SO
    I create a down payment invoice using copy from delivey.
    I make the incomuing payment for the down payment invoice.
    I create the invoice from the delivery
    The system DO NOT apply automaticaly the down payment invoice to the invoice (even if also this document is linked to the delivery that I use to create the down payment invoice).
    I know that I can select it manually. But I can select it manually also if I use the SO to create the down payment instead of the
    delivery. Why if the situation is the same in the firs case the system do it automatil^cally and in the second case I need to do it manually?
    Of course if I create a Down Payment invoice without selecting any document (SO, delivery..) the system don't know if you want to apply the payment to the final invoice.
    But If I select the delivey to create the down payment (the same if I select the SO): I want to apply the down payment to the final invoice of this delivery and not to another delivery.

Maybe you are looking for

  • Macbook, performanc and memory

    For those of you who are still running 512MB in your macbook, go straight to the nearest memory store and upgrade now!! I got my macbook in today and was running it with 512MB and it crawled!! I also ordered 2x1GB sticks from owc and put them in afte

  • How can I update multiple IOS devices from one computer without downloading IOS each time

    My company is on a VERY slow internet connection, and at the moment we are using a cellular modem to increase our bandwidth.  This connection is a metered connection.  The 1 Gb download for IOS 7 will kill all of my purchased bandwidth, and has a pot

  • CORRECT DRIVER FOR WINDOWS 7 AND HP COLOR LASER JET 4600dn

    I'm having a problem with our IT department.  My old 4600dn worked great until they started downloading new drivers for Windows 7, which they installed just recently.  Now the one he INSISTS I use has only one tray selection.... Auto.  I'm trying to

  • How to Restore Music,Songs from iPhone

    Please give a suggestion to Recover Songs from iPhone,Thanks!Finally, in the coming Christmas, Wish you Merry Christmas!

  • Change manifest file in existing EAR file with ANT task

    Hi, I use ant task (ojdeploy) to create EAR files from ADF application. Now I want to add the application version number to MANIFEST.MF. Is it possible to do the manifest file modification IN THE EXISTING EAR FILE (or while creating the EAR file with