cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to update Period and Volume Discounts using SAP HANA Service Layer

former_member374449
Participant
0 Kudos

Hello All,

I am trying to update the price according to the period range (Valid From-Valid To) using SAP HANA Service Layer.

Period and Volume Discounts uses the same table as Special Price.

In table CardCode column has *2 value which is Price List Internal Number.

When I fetch the data using service layer, the CardCode columns has blank value.

https://xx.xx.xx.xx:50000/b1s/v1/SpecialPrices(CardCode='*2',ItemCode='TEST0001' )<br>

I tried several combinations to update the price, but it did not work.

Following error comes every time.

Does anyone have any idea how to update the price using service layer?

SAP Business One 10 version for HANA FP 2202


Thanks & Regards.

Manish Pant

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi manish.pant005,

According to SAP Note 3006734, this is a system limitation.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

former_member374449
Participant
0 Kudos

Hi ankit.chauhan1,

Can I update using SAP DI API?

Thanks & Regards.

Manish Pant

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi manish.pant005,

I would suggest you to check using DI API. Following sample code should help:

SpecialPrices speciaPrice = g_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oSpecialPrices);
speciaPrice.GetByKey("18900275", "*7");

speciaPrice.ItemCode = "18900275";
speciaPrice.PriceListNum = 2;
speciaPrice.SpecialPricesDataAreas.SpecialPricesQuantityAreas.SetCurrentLine(0);
speciaPrice.SpecialPricesDataAreas.SpecialPricesQuantityAreas.Quantity = 20.0;
speciaPrice.SpecialPricesDataAreas.SpecialPricesQuantityAreas.PriceCurrency = "EUR";
speciaPrice.SpecialPricesDataAreas.SpecialPricesQuantityAreas.SpecialPrice = 40.0;

speciaPrice.SpecialPricesDataAreas.SetCurrentLine(0);
speciaPrice.SpecialPricesDataAreas.Dateto = Convert.ToDateTime("2020-08-13");
speciaPrice.SpecialPricesDataAreas.DateFrom = Convert.ToDateTime("2020-08-13");
speciaPrice.SpecialPricesDataAreas.PriceCurrency = "EUR";
speciaPrice.SpecialPricesDataAreas.SpecialPrice = 77.50;
speciaPrice.SpecialPricesDataAreas.PriceListNo = 3;

speciaPrice.Update();

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

former_member374449
Participant

Hi ankit.chauhan1,

Thank you for always supporting.

Yes with DI API it is working fine.

Thanks and Best Regards.

Manish Pant

Answers (0)