Skip to Content
author's profile photo Former Member
Former Member

Sales Order to Delivery

Hi to all

From SAP B1, You could prepare DR using SO as source document from document wizard,

I how like to know if this possible using the SDK to automate DR preparation ,

please provide sample code

thanks

Edited by: Loren Flores on Dec 18, 2008 8:50 AM

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 09:16 AM

    Hi,

    Use Baskey, Basetype fields between document_lines objects.

    Set BaseType = 17 means sales order, and set the BaseEntry into the document entry of the sales order.

    Regards

    J.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      HI,

      This creates INvoice from order.

      You can just replace the invoice to delivery and customer id.

      Private Sub AddInvoiceEx(ByVal e As Integer)
      
              Dim oDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
              oDoc.CardCode = "C20007"
              oDoc.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
              oDoc.DocDate = Today
              oDoc.DocDueDate = Today
      
              oDoc.Lines.BaseEntry = e
              oDoc.Lines.BaseLine = 0
              oDoc.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
              oDoc.Lines.Quantity = 1
              oDoc.Lines.UnitPrice = 580
      
              oDoc.Lines.Add()
              oDoc.Lines.BaseEntry = e
              oDoc.Lines.BaseLine = 1
              oDoc.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
              oDoc.Lines.Quantity = 1
      
              If oDoc.Add <> 0 Then
                  MsgBox("Erreur " + oCompany.GetLastErrorDescription())
              Else
                  MsgBox("Good")
                  Dim newCode As String = oCompany.GetNewObjectKey()
                  MsgBox(newCode)
              End If
          End Sub
      

      Regards

      j.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.