Items_Prices is a child object of the Items object that represents the items' prices in the Inventory and Production module. This object enables you to specify prices for various price lists.
The sample prints the pricelist of the Item and updates the price of the Item in the current price list.
Price_list (Visual Basic)
Copy Code
Dim lErrCode As Long
Dim sErrMsg As String
Dim bRetVal As Boolean
Dim oItems As SAPbobsCOM.Items
Dim oItemPrice As SAPbobsCOM.Items_Prices
Dim i As Integer
'Retrieve specific item
bRetVal = oItems.GetByKey("X0004")
'Check errors
If Not bRetVal Then
oCompany.GetLastError(lErrCode, sErrMsg)
MsgBox("Failed to Retrieve the record " & lErrCode & " " & sErrMsg)
Exit Sub
End If
'print price lists names and prices
For i = 0 To oItemPrice.Count - 1
oItemPrice.SetCurrentLine(i)
'print price list name
Debug.WriteLine(oItemPrice.PriceListName())
'print the items price
Debug.WriteLine(oItemPrice.Price())
Next
'change the price of the item in the last price list
oItemPrice.Price = 600