Skip to Content

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

Create Order Not Working

Dear experts,

I have recently started learning to code in SDK so please pardon my basic question and programming stupidity.

I have created a button on a UDO (using B1Up add-on). That will create a sales order. Its a simple code, given below, but is failing.

Can you please advise what is wrong?

Errors are:

Line: 14 - Type 'SAPbobsCOM.Documents.Lines' is not defined.

Line: 17 - Name 'oOrders' is not declared.

Code is:

Imports System

Imports SAPbobsCOM

Imports SAPbouiCOM


    Public Class ROGERCLASS

        Public Function DynamicCode(ByVal ParamArray parameters() As Object) As String

            Dim company As SAPbobsCOM.Company = parameters(0)

            Dim application As SAPbouiCOM.Application = parameters(1)

            Dim form As SAPbouiCOM.Form = parameters(2)

            Dim eventForm As SBO.UI.B1Form = parameters(3)

            Dim eventData As [Shared].Model.DotNetEventObject = DirectCast(parameters(4), [Shared].Model.DotNetEventObject)

            Dim addonData As SBO.AddonLogic.AddonData = parameters(5)

            Dim oOrder As SAPbobsCOM.Documents

            Dim oOrderLine As SAPbobsCOM.Documents.Lines

            Dim oCompany As SAPbobsCOM.Company

            oOrder = oCompany.GetBusinessObject(oOrders)

            oOrder.CardCode = "10195"

            oOrder.DocDate = "20151030"

            oOrderLine.ItemCode = "BSG1273AV52600CB"

            oOrderLine.Quantity = 5


        End Function

    End Class

End Namespace

Thanks in advance.

Best Regards


Former Member

Helpful Answer

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