Skip to Content
0
Former Member
Apr 15, 2005 at 10:28 AM

Item no. is missing [OPOR.ObjType]

54 Views

Hi,

I am trying to create a purchase order using DI API.

I am gettig the following message:

Item no. is missing [OPOR.ObjType]

I am using SAP-B1 2004

My code is as follows:

-


Dim sObjectCode As String

Dim sErrMsg As String

Dim lErrCode As Long

Set oCmp = New SAPbobsCOM.Company

oCmp.UseTrusted = True

oCmp.Server = "(local)"

oCmp.CompanyDB = "SBODemo_SG"

oCmp.UserName = "manager"

oCmp.Password = "manager"

oCmp.language = SAPbobsCOM.BoSuppLangs.ln_English

l = oCmp.Connect()

Set oPurOrd = oCmp.GetBusinessObject(oPurchaseOrders)

oPurOrd.CardCode = sFirstVend

Set oPurOrdLine = oPurOrd.Lines

oPurOrdLine.ItemCode = txtItemCode

oPurOrdLine.Quantity = txtQty oPurOrdLine.Add

lRetCode = oPurOrd.Add

If lRetCode = 0 Then

oCmp.GetNewObjectCode sObjectCode

Msgbox "Purchase Order " + sObjectCode + " added"

Else

oCmp.GetLastError lErrCode, sErrMsg

msbox sErrMsg

End If

-


Can anybody tell me why this error is comming up.

Thanks.