📚 SAP Business One SDK Help

SpecialPrices Object
See Also  Members  Example

Description

Represents a discount for a specific item in a specific price list. The discount can apply to a specific business partner or for all business partners.

  • Specific Partners: To view discounts for specific business partners, select Inventory --> Price Lists --> Special Prices --> Special Prices for Business Partners.
  • All Business Partners: To view discounts for all business partners, select Inventory --> Price Lists --> Period and Volume Discounts. In previous versions, this was called Hierarchies and Expansions.

For a specific business partner, the item and business partner must be unique; for all business partners, the item and price list must be unique.

Source table: OSPP

Mandatory fields: ItemCode

Object Model














Remarks

For marketing documents, the system checks for special prices in the following order:

  1. Special prices (this object) for the specified business partner
  2. Discount groups (DiscountGroups) for the specified business partner and item
  3. Special prices (this object) for all business partners

If no special prices are found, the price is set by the default price list for the business partner.

Example

Adding a special price -- Specific Partners (Visual Basic)Copy Code
'Call the object
Dim vSP As SAPbobsCOM.SpecialPrices
Set vSP = vCompany.GetBusinessObject(oSpecialPrices)

'set object's properties
vSP.CardCode = "D10002"
vSP.Currency = "Eur"
vSP.DiscountPercent = 30.3
vSP.ItemCode = "A00001"
vSP.Price = 355.3
vSP.PriceListNum = 0

'Call the Add method
Call vSP.Add
Adding a special price -- All Business Partners (Visual Basic)Copy Code
Dim oSpp As SAPbobsCOM.SpecialPrices

oSpp = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oSpecialPrices)
oSpp.PriceListNum = 4
oSpp.ItemCode = "I0001"
oSpp.Price = 33.033
oSpp.SpecialPricesDataAreas.PriceListNo = 4
oSpp.SpecialPricesDataAreas.DateFrom = #10/20/2007 12:14:00 PM#
oSpp.SpecialPricesDataAreas.Dateto = #11/20/2007 12:14:00 PM#
oSpp.SpecialPricesDataAreas.Discount = 5

oSpp.SpecialPricesDataAreas.Add()
oSpp.SpecialPricesDataAreas.PriceListNo = 4
oSpp.SpecialPricesDataAreas.DateFrom = #11/21/2007 12:14:00 PM#
oSpp.SpecialPricesDataAreas.Dateto = #11/30/2007 12:14:00 PM#
oSpp.SpecialPricesDataAreas.Discount = 6

oSpp.SpecialPricesDataAreas.Add()
oSpp.SpecialPricesDataAreas.PriceListNo = 4
oSpp.SpecialPricesDataAreas.DateFrom = #12/21/2008 12:14:00 PM#
oSpp.SpecialPricesDataAreas.Dateto = #12/30/2008 12:14:00 PM#
oSpp.SpecialPricesDataAreas.SpecialPrice = 28.808

oSpp.SpecialPricesDataAreas.SpecialPricesQuantityAreas.Quantity = 101
oSpp.SpecialPricesDataAreas.SpecialPricesQuantityAreas.SpecialPrice = 25.012

oSpp.SpecialPricesDataAreas.SpecialPricesQuantityAreas.Add()
oSpp.SpecialPricesDataAreas.SpecialPricesQuantityAreas.Quantity = 401
oSpp.SpecialPricesDataAreas.SpecialPricesQuantityAreas.SpecialPrice = 24.98

Dim retV As Integer = oSpp.Add()

See Also