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

Standard program to close all open sales orders when price is changed.

Dear All,

I have a scenario where i need to close all the open sales orders in VA05n when there is a change in standard price.

The process goes as below.

If there is a change in standard price VK12 for a material, then all the open sales orders for that material should be close automatically(Va05n).

A call must be triggered as soon as there is a change.

Please let me know if any standard program or any confrontational changes should be done to approach this scenario.

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • Posted on Oct 24, 2013 at 08:18 AM

    Hi Sudhir,

    As per my knowledge, there is no link in condition change and order status, a condition change (using VK12) cannot trigger change of order status.

    This thing can be done using an ABAP program which has to be executed at a regular interval to check the condition change and then access any open order and upon finding, reject those items.



    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 24, 2013 at 08:43 AM


    In my opinion whenever there is some change in price we always maintain new condition record in VK11 valid from that date on which new price is declared. We don't change existing condition records. Why you are changing existing condition records and why not maintaining new one in VK11.

    For your query this is not possible in standard or even with ABAP it will be tricky and complex. In our company whenever price changes we run VA05N and download all open sale orders in excel file. Then copy sales order numbers and paste them in VKM3 and select all and reject. Now you may ask your ABAPER if he could use this logic and schedule a job on daily, weekly or whenever you want.

    For this you need to tell the system that when a price is changed. May be whenever you run VK11 for any material or if there is anyother better idea in your mind.

    What I would suggest is to do it manually. How time will it take to download a report in excel and then copy > paste > select all > reject and save. Hardly 2 minutes may be.


    Add comment
    10|10000 characters needed characters exceeded

    • Hi

      We have thousands of materials and thousands of open orders on every month end closing. We have change in price almost every month but we reject open orders on end of very month by VA05N and VKM3 which I have explained earlier.

      If you have this requirement from client then you have to do it. It will take a lot of testing and because you know we use different tables for maintaining price and you need to tell the system about price change in every table.

      Amit has explained the logic very well but I would like to add something in that. You have to go with that Logic which Amit has shared and take help of your ABAPER and BASIS guy to schedule this job on every night at some specific time. This may reduce the system performance based on number of entries and transaction volume so it would be nice if you schedule this at night.

      There are lot of threads and discussions where members are discussing about function module for reading condition records and BAPI for rejecting open orders etc. While reading table you have to take care of all pricing tables which you have in your pricing condition's access sequences.

      PS: Discuss this logic and solution with your ABAP and BASIS guys and get this requirement done by your collective efforts. Once you get your desired program you may share that here in SCN as blog or document. I will like to hear from you the updates for this solution.


  • Posted on Oct 26, 2013 at 09:28 AM

    Dear Sudhir,

    For a similar requirement we had done like,

    1. At the time of saving sales order, check Pricing date = Current date or future date.

    2. In delivery order, at the time of saving Delivery Check Actual GI date = Sales order price date, if fails display error message to update the sales order.

    By this, you can ensure only the revised price flow in the sales documents.

    And irrespective of back dated open sales orders, at the time of delivery selected sales order which user want to continue will get update.



    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2013 at 11:05 AM

    Dear sudhir,

    Assign reason of rejection in sales order . for bulk sales order ,Use Change sales order BAPI-

    BAPI_SALESORDER_CHANGE to Close sales order-



    Add comment
    10|10000 characters needed characters exceeded