cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Adding Special Price for BP

Former Member
0 Kudos

Hi

I'm using the DI to add Special Prices for certain BPs. I'm either adding or updating records depending on whether the BP/ItemCode combinations are already set up as Special Prices or not.

I've set it so the price list to use is always -2(Without Price List), but I'm having a bit of a problem when trying to add items. The Special Price doesn't add and I get the error "-10 No price defined for item in selected price list".

I've tried doing the same thing using the user interface and it allows me to add the Special Price. The strange thing is though if I try updating a Special Price through the DI after adding it through the UI it works even though the update code is exactly the same as the add code however instead of using .Add to add a new record I'm using .Update.

Does anyone know what could be causing this.

Thanks

Steve

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Steven,

First you must set your line setCurrentLine() for adding a new price.

see this thread:

[]

else from the sdk help:

'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

or

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()

Else post your own code or take a look in the SDK help

HTH Regards Teun

Answers (1)

Answers (1)

Former Member

Cheers I've sorted it now it was because I wasn't choosing the correct Price List. Without Price List is 0 not -2.