cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to update prices from previous article

0 Kudos

I am trying to update prices based on a previous article here but I am at a bit of loss as what Ors should be I persume it should be a recordset of some description what is hapening is the customer is having two price lists and we need to update one based on the other price times 0.08. Oh by the way I am using the 9.3 DI in this case.

Can someone help me out here

Link to orginal artcile is here

https://archive.sap.com/discussions/thread/1882181

Also what should the values of spurchasepricelist,spuchasepricefield,scurrency

The reason we have to do this is the customer updates prices via values and not a percentage.

 SAPbobsCOM.Items oMM = null; oMM = (SAPbobsCOM.Items)globalD.oCompany.GetBusinessObject(BoObjectTypes.oItems); 

int lretcode = 0;if (oMM.GetByKey(itemcode))          <br>{ <br> bool need2update = false; <br><br>     for (int p = 0; p < oMM.PriceList.Count; p++)          <br>     {                <br>           oMM.PriceList.SetCurrentLine(p);      <br>           if (oMM.PriceList.PriceList.ToString() == spurchasepricelist)                                  {                 <br>              price = Convert.ToDouble(oRs.Fields.Item(spuchasepricefield).Value);                          oMM.PriceList.Price = price;        <br>              oMM.PriceList.Currency = scurrency; <br>              need2update = true;         <br>              break;                         <br>            }       <br>     }                 <br>       if (need2update)                        <br>       { <br>           lretcode = oMM.Update();          <br>          if (lretcode != 0)                         <br>       throw new Exception(string.Format("(pricelist){0}-{1}", globalD.oCompany.GetLastErrorCode(), globalD.oCompany.GetLastErrorDescription()));                        
       }
     }

Accepted Solutions (0)

Answers (1)

Answers (1)

DellSC
Active Contributor
0 Kudos

The "SAP BusinessObjects - BI Platform - SDK" tag is for the BusinessObjects SDK, which is not the same as the SAP BusinessOne SDK. You will get a better response if you ask this question under one of the B1 tags.

-Dell