Convert sales order to sales invoice

Hi Dear;
in SBO there is Document generation wizard utitity that help us to convert many sales orders to sales invoices, but for non multilanguage Business partners.
could you help me and send to me the syntax that convert a/r sales oerder to a/r sales invoice please?
regards;

Hi Dany,
Here's some sample code of how to convert a Sales Order (object type 17) to an invoice. I have used sales order number 10 as an example here.
        Dim oInvoice As SAPbobsCOM.Documents
        Dim oOrder As SAPbobsCOM.Documents
        Dim iDocEntry As Integer
        Dim i As Integer
        iDocEntry = 10
        oOrder = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
        oInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
        oOrder.GetByKey(iDocEntry)
        oInvoice.CardCode = oOrder.CardCode
        oInvoice.CardName = oOrder.CardName
        oInvoice.Address = oOrder.Address
        oInvoice.DocDate = oOrder.DocDate
        oInvoice.DocDueDate = oOrder.DocDate
        For i = 0 To oOrder.Lines.Count - 1
            oOrder.Lines.SetCurrentLine(i)
            If i > 0 Then
                oInvoice.Lines.Add()
            End If
            oInvoice.Lines.BaseEntry = oOrder.DocEntry
            oInvoice.Lines.BaseLine = oOrder.Lines.LineNum
            oInvoice.Lines.BaseType = 17
        Next
        If oInvoice.Add() <> 0 Then
            oApplication.MessageBox("Error: " & oCompany.GetLastErrorDescription)
        End If
Hope it helps,
Adele

Similar Messages

  • Table For Open Sales Order And Customer Invoices

    Dear Gurus,
    Are there any table to know open Sales orders and pending invoices for Customers?
    Wishes,
    Abhishek

    Hi,
    Go to T code VA05 and select open sales order radio button. Put other input parameters like date range or sold to . Execute you shal get list of all open sales order.
    For pending invoices go to T code VL04 and you get list of all billing not yet created even though GI is done.
    These are standard SAP functionality and can be used rather than looking in a table level.
    Regards
    Vivek

  • How to make the connection between a sale order and an invoice in SDK

    Hi,
    Im trying to make the connection between a sales order and an invoice using the SDK.
    Here is how i create each of them:
    Invoice:
    public int SalesInvoiceInternalSave(string buisnesspartnerCardCode, DateTime dueDate, double discountPercent, string id, IList<InternalItem> items, ref int invoiceId)
          int res = 0;
          SAPbobsCOM.Documents invoice_entry = (SAPbobsCOM.Documents)Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);     
          invoice_entry.CardCode = buisnesspartnerCardCode;
          invoice_entry.DocDueDate = dueDate;
          invoice_entry.DiscountPercent = discountPercent;
          invoice_entry.Reference2 = id;
          foreach (InternalItem item in items)
            invoice_entry.Lines.WarehouseCode = item.Shopid;
            invoice_entry.Lines.ItemCode = item.Code;
            invoice_entry.Lines.ItemDescription = item.Name;
            invoice_entry.Lines.Quantity = item.Quantity;
            invoice_entry.Lines.UnitPrice = item.Price;
            invoice_entry.Lines.Add();
          res = invoice_entry.Add();
          return res;
    Sales order:
        public Boolean SalesOrderInternalSave(string orderId, string buisnesspartnerCardCode, DateTime dueDate, IList<InternalItem> items)
          SAPbobsCOM.Documents order_entry = (SAPbobsCOM.Documents)Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);
          order_entry.CardCode = buisnesspartnerCardCode;
          order_entry.DocDueDate = dueDate;
          foreach (InternalItem item in items)
            order_entry.Lines.WarehouseCode = item.Shopid;
            order_entry.Lines.ItemCode = item.Code;
            order_entry.Lines.ItemDescription = item.Name;
            order_entry.Lines.Quantity = item.Quantity;
            order_entry.Lines.UnitPrice = item.Price;
            order_entry.Lines.Add();      
          int res = order_entry.Add();
          return res == 0;
    What do i need to change to get the connection between the two of them?
    And how do you insert a amount (not percent) discount into an invoice?
    Regards,
    Torben

    Hi,
    Add the sale order, then add the invoice. and while adding the invoice please add the following details to the invoce documen
    invoice_entry.Lines.BaseEntry = 'Doc entry of the newly created SO
    invoice_entry.Lines.BaseLine = 'Line No of the SO
    invoice_entry.Lines.BaseType = 17 'For sales order document type.
    Hope it helps,
    Vasu Natari.

  • Sale orders for which invoice has been created

    is there any table in sd module from which we can find out the list of all sales order for which invoice has been created.

    Hi
    Kindly Table VBFA.It is sales document flow table containing data from the begining of sales order till the invoice.
    VBTYP_N = 'M'  invoice
    Thanks
    Subha

  • Sales order, Delivery and Invoice changes history tables

    Dear All,
    I want to know how to find out the changes done in Sales Order, Delivery and Invoice.
    As far as sales order is concerned, I know CDHDR and CDPOS are tables can be used to find out the changes.
    But I am not sure about the "Object ID". Where we need to find out this Object ID?
    In the Data element "VBELN_VA" "Change Document" option has been checked under "Further Characteristics" tab.
    Please confirm about the "Object ID".
    Similarly give inputs for Delivery and Invoice change history also.
    Regards,
    Mullairaja

    Hi,
    Could you please explain, how to use these programs?
    Regards,
    Mullairaja

  • Any function module or bapi to get sales order number and invoice number?

    hi all,
    with delivery order number provided, do we have any function module or bapi to get sales order number
    and invoice number?
    thanks.

    Hi,
    Check
    BAPI_SALESORDER_CREATEFROMDAT1
    BAPI_REMUREQSLISTA_CREATEMULT  Agency Business: BAPI Create Invoice Lists from Vendor Billing Documents
    BAPI_REMUREQSLISTB_CREATEMULT  Agency Business: BAPI Create Invoice Lists from Payment Documents
    BAPI_REMUREQSLISTC_CREATEMULT  Agency Business: BAPI Create Invoice Lists from Posting Lists
    BAPI_REMUREQSLIST_CHANGEMULT   Agency Business: Change Invoice List Documents BAPI
    BAPI_REMUREQSLIST_GETLIST      Agency Business: BAPI Determine Detailed Data for Invoice List Documents
    BAPI_REMUREQSLIST_RELEASE      Agency Business: BAPI Release Invoice List Documents to FI
    Edited by: Neenu Jose on Nov 26, 2008 8:53 AM

  • Adding binlocation items from sales order to sales invoice through DI API

    Hi
    I  want to add items from sales order to sales invoice.
    when i am allocated bin locations for the item sales invoice is not adding
    is there any way to update BIN Location Alocation-Issue qty through DI API
    please help me....
    regard,
    LakkshmiKantth

    Hi Lakshmi,
    check this http://scn.sap.com/message/14740146#14740146
    REgards
    edy

  • Generating sales order and reserve invoice in a row

    Hi all,
    i'm using B1iSN PL14 with sap B1 8.8.
    I need to build the following scenario :
    I receive an xml file representing a sales order, i have to create :
    - a sales order
    - a reserve invoice based on the sales order
    I've create two BIUs that currently work.
    But now i'd like to chain the two BIUs and execute the the invoice creation only if a sales order has been created.
    What is the best way to do tha kind of thing ?
    thanks !

    I found it difficult in a similar situation & unfortunately didn't get much response from here.
    My workaround solution was:
    - I removed the filter for the B1i user; it's explained in the extensibility guide I think. Basically B1i ignores any events created by itself, but I removed that so B1i received all events including ones created by B1i itself.
    - When creating my first document (for the example lets say it was a Sales Order), I entered a specific text in the remarks field - you could also use a UDF
    - Then my BIU for the second document then had the following conditions
    Document = Sales Order
    User = B1i
    Remarks = CreatedWithB1i (for example)
    So using this, any time my first BIU completed succesfully, it triggered the second one... it's clearly a workaround solution, but it worked for me.

  • How to hide componant row of BOM while creating sales order  OR AR Invoice

    Dear expert
    my client wants to create Sales order with Sales BOM, but they do not want to see componant product while create sales order or AR invoice they want to see only parent items.
    Please help me asap

    Hi,
    check below link
    Avoid printing child items of Sales BOM in AR Invoice
    Regards
    Deepak Tyagi

  • Urjent-Any function module for finding Sales order, Delivery and Invoic

    Hi Experts,
    I am having selection screen like
    Sales order
    Delivery
    Invoice
    Customer
    If i give sales order
             Delivery and Invoice should pull
    If i give delivery
             sales order and Invoice should pull
    If i give Invoice
             sales order and delivery should pull
    If i give customer
               all customer related data should pull
    Do we have any function modules to meet this reqirement?
    If we have please provide function modules.
    Thanks,
    mahe
    Edited by: Rob Burbank on Mar 30, 2009 4:17 PM
    Edited by: mahahe on Mar 31, 2009 9:12 PM

    You can use VBFA table, right? in the FM also, you can find the same logic, like pulling from VBFA table.
    thanq

  • Price disappearing in sales order after F2 invoice is creted

    Hi
    we have a problem, till PGI we have the prices on the sales order. once F2 invoice is created the price in the sales order gets disappeared. what could be the reason, any idea. This is for a single order only.
    Venkat Cheedalla

    hello, friend.
    a possible reason is that in your copy controls using VTFL (delivery to billing) or VTFA (order to billing, if order-related), the settings for price tell the system to re-determine or update prices in the invoice.  when this is done, all manual prices in the sales order will be discarded.
    you can prevent this by choosing the right settings.  look for the option to "copy prices unchanged".
    please do post your feedback.
    regards.

  • Settlement of Sale Order to Sale Order

    Dear experts
    I need help in the following scenario:
    At my client place we are doing job work for external material. All the material are supplied by the customer and our client will do the processing and send it back to customer's customer on customers request.
    To create Excise Invoice against the Customers Customer we are handling through 2 sale orders.
    First One Sale order will be created against the Customer Order and Sale price will be the selling price of Customers to Customer.
    Second Sale Order will be created for Job Work Charges for the processing the materials.
    On settling the process orders all the cost is settling to Sale Order One, Clients revenue is coming from Sale Order Two.
    Here I need to settle the First Sale Order to Second Sale Order. I have given the second sale Order number in first sale order number in Settlement rule.
    But when I settle the First sale Order all the amount it going to Price Differance Account.
    How to settle the Cost of First Sale Order to Second Sale Order?
    Regards
    Kiran A

    Dear Experts
    any advises.
    Can I go for Sale Order to Sale Order Settlement ?
    Regards
    Kiran

  • Sales Order and Sales Item not copy over to table AFPO-KDAUF and AFPO-KDPOS

    Hi Expert,
    May I know why I run MRP and convert planned order to production order based on Sales Order, why the sales order and sales item is not copied and save in table AFPO-KDAUF and AFPO-KDPOS?
    I can see the sales order and sales item is appearing in MD04, but how is the linkage between production order and sales order/item?
    Thanks.

    Sales order No. and sales line item will only be transfer to production order in MTO ( Make to Order) scenario.
    If your scenario is MTO and the sales order reference is not getting  transfer, then check your requirement type and  requirement class setting in T.Code OVZH and OVZG.
    In standard SAP 'KE' requirement type  40 requirement class is used  for MTO scenario.

  • Sales Order / Forecasted Sale Order Report

    hi
    How to create Sales Order / Forecasted Sale Order Report.

    Hi Raju,
    Are you talking of normal sales order and in the Forecasted sale order report what are the inputs you are giving.

  • Sales Order processing - Sale from stock

    Dear Gurus,
    What are the configuration steps involved in Sales Order Processing- Sales from Stock.
    Kindly let me know.
    Regards
    Prashant Ranalkar

    Go with Make To Stock scenario.  For configuration details, make a search in this forum.
    thanks
    G. Lakshmipathi

Maybe you are looking for