Skip to Content
avatar image
Former Member

DI API - Updating Item Prices - Performance


We're using SAP 9.1 / (9.2 in dev) with the DI API + C#. We're now looking for a possibility to update item prices in a specific pricelist. I know of the "default" way

1. Use Items BO

2. Load Item using GetByKey

3. Find pricelist in items.PriceList

4. Set price

5. items.Update()

repeat for each item. The problem is, this is painfully slow. For 1 item, it is kinda okay (not really). For 10 items... well get a coffee. For 10k items... take a week off.

It's no suprise, because this way, the DI API has to load the entire item with ALL prices etc etc. and after changing just a single price, it has to save the entire item again / or track/detect changes. Whatever it does internally, its unbearable slow. If i tell my users, that they need to wait 2 days for their prices to update, i'm out of a job...

So my question basically is: Is there any other way (No DTW, no UI API)? Am i missing some service or object in the DI API that can speed that up? I dont want to resort to pure SQL, because this will mess up the calculations, roundings and base pricelist stuff.

Add comment
10|10000 characters needed characters exceeded

  • May I know how many price list currently you have ?
    When you have a lot of price list, this is a big problem, It does as you described, unbearably slow.
    Unfortunately there is no solution for this, I can only suggest you to schedule update this in the evening when user is not working.

  • Hi Edy,

    I would like to have a very simple sample code in order to reproduce the slowness while doing the operations on Price Lists. Kindly help for the same. Later, I would discuss it internally and let you know how it goes.

    Kind regards,


    SAP SME Support

  • Get RSS Feed

2 Answers

  • Dec 01, 2016 at 09:38 AM

    Hi Mark,

    The more calls to the API the slower it becomes. Try to make as few calls as possible.

    You mention a find of a price list. Most likely it's a loop. That means several calls to the API.

    One alternative approach:

    1. Load the item - 1 API call;

    2. Export to XML - 1 API call;

    3. Make your changes to the XML - no API calls;

    4. Update the item from the changed XML using UpdateFromXML - 1 API call.

    This will total 3 API calls per item which should give you a boost in speed.

    Pedro Magueija

    LinkedIn | Twitter | Blog

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 26, 2017 at 04:00 PM

    100.000 Euro software .... 30.000 Euro Hardware .... update picelist of 9000 products takes 5 hours .. with the raccomended SAP SDK... nice !

    Add comment
    10|10000 characters needed characters exceeded