cancel
Showing results for 
Search instead for 
Did you mean: 

Create a new ProductTrees_Lines

Former Member
0 Kudos

Dear all,

I'm developing an automatic application to import cvs file and to create BOMs into SAP via SDK.

How can create a new product tree line?

Dim oPT As SAPbobsCOM.ProductTrees = Nothing

oPT = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductTrees)

oPT.TreeCode = "XXXXX"

Dim oPT_Line As SAPbobsCOM.ProductTrees_Lines = Nothing

Now, which SAP object should I use?

for example...

oPT_Line = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes...........)

Then... I'd use these commads to set the product tree line object:

oPT_Line.ItemCode = "YYYYYY"
oPT_Line.Warehouse = "W10"
oPT_Line.Quantity = "2"
oPT_Line.PriceList = 2

oPT_Line.Add()

Can some one help me please?

Regards

Emanuele

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

It works.

Thank you very much

daniel_martinec2
Participant
0 Kudos

Hi,

You don't need the product tree line object. Try this code:

Dim oPT As SAPbobsCOM.ProductTrees = Nothing
oPT = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductTrees)
oPT.TreeCode = "XXXXX"
oPT.TreeType = SAPbobsCOM.BoItemTreeTypes.iProductionTree

'1st row
oPT.Items.ItemCode = "YYYYYY"
oPT.Items.Warehouse = "W10"
oPT.Items.Quantity = "2"
oPT.Items.PriceList = 2

'2nd row
oPT.Items.Add()
oPT.Items.ItemCode = "ZZZZZZ"
oPT.Items.Warehouse = "W10"
oPT.Items.Quantity = "2"
oPT.Items.PriceList = 2

oPT.Add()

Hope it helps,

D.