Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Can i create SalesOrder using SalesQuotation

Hi all,

I want to create SalesOrder with reference using the SalesQuotation. How can i achieve this.

I am using JAVA to develop this. I am using DI API to achieve this. I am creating SalesOrder directly by giving the items and their quantities and succeded. But when i want to give the SalesQuotation number Reference while creating salesOrder it is giving error.

-5002Item no. is missing [ORDR.ObjType] Invoke of: DoQuery

Source: SAPbobsCOM.Recordset.6.7

Description: 1). [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'FOR'.

2). [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.

at Method)

at Source)

at Source)

at Source)

at Source)

at SalesOrderCreate.main(

Can any body give me a sample code that how can we create salesOrder using SalesQuotation.



Former Member
Former Member replied


I've never tried doing it in java. But i here is an example of how it is done in VB.Net, im sure it will help you connect the dots. This example makes a invoice based on a sales order

Dim oInvoice As SAPbobsCOM.Documents

oInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)

oInvoice.CardCode = BPCode.Text

oInvoice.DocDueDate = Now

oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders

'OrderStr is sales order DocEntry,not Docnum

oInvoice.Lines.BaseEntry = CInt(OrderStr)

oInvoice.Lines.BaseLine = 0


oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders

oInvoice.Lines.BaseEntry = CInt(OrderStr)

oInvoice.Lines.BaseLine = 1

lRetCode = oInvoice.Add

oCompany.GetLastError(lErrCode, sErrMsg)

If lRetCode <> 0 Then

MessageBox.Show("Not Added" & lErrCode & " " & sErrMsg)

ElseIf lRetCode = 0 Then


MsgBox("Added Invoice")

End If

please not, OrderStr is sales order DocEntry,not Docnum

Hope this helps

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question