Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

update Speical Price by DI

Hi, all,

Our business nature need to update the item speical price daily, but it is difficult to user input manully.

I want to develop a program to import the new price from Excel through DI.

I can find sample SDK program to add records. But I have no idea how to update records.

According to the Special Price, I need to "Expired" the current price before adding a new one.

Here is existing record.

OSPP.CardCode = "C001"

OSPP.ItemCode = "M001"

SPP1.DateFrom = "2008.10.01"

SPP1.DateTo = ""

SPP1.Discount = 3

Now I want to change the discount to 5 with DateFrom = 2008.10.02, I need to update the existing record SPP1.DateTo = "2008.10.01" and then create a new record:

SPP1.DateFrom = "2008.10.02"

SPP1.DateTo = ""

SPP1.Discount = 5

Anyone can help?

Thanks

Former Member
Former Member replied

Dear hkcm,

Please try code as following example

Set sp = oCompany.GetBusinessObject(oSpecialPrices)

sp.GetByKey "M001", "C001"

sp.SpecialPricesDataAreas.Dateto = "2008-10-01"
sp.SpecialPricesDataAreas.Add
sp.SpecialPricesDataAreas.DateFrom = "2008-10-02"
sp.SpecialPricesDataAreas.Discount = 5

sp.Update

Best Regards

Jane Jing

SAP Business One Forums team

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question