Skip to Content
0
Former Member
Jul 29, 2016 at 10:35 AM

DI API : create a Purchase-Request with Reference to a sales-order

907 Views

Hi All,

is it possible to create Purchase Request with reference to Sales-Order?

I try to create but it show error code -10 and doesn't have error description.

my code is below

oPRobject = DirectCast(Application.SBO_Application.Company.GetDICompany,SAPbobsCOM.Company).GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseRequest)

oPRobject.DocDate = "07/29/2016"

oPRobject.TaxDate = "07/29/2016"

oPRobject.DocDueDate = "07/29/2016"

oPRobject.RequriedDate = "07/29/2016"

oPRobject.Lines.SetCurrentLine(0)

oPRobject.Lines.ItemCode = "TestItem"

oPRobject.Lines.Quantity = 1

oPRobject.Lines.BaseType = 17

oPRobject.Lines.BaseEntry = docentry

oPRobject.Lines.BaseLine = linenum

oPRobject.Add()

if i remove basetype,baseentry,baseline this code work fine.

Anyone please help.

Thanks & Regard

Nut