Skip to Content
author's profile photo Former Member
Former Member

Problem Adding Special Price for BP

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 08, 2010 at 12:57 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 08, 2010 at 01:01 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.