cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Order to Delivery

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi J

Thanks for your prompt reply.. could you please provide me a sample code for this scenario

Thanks

Former Member
0 Kudos

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.

Answers (0)