Change of pricing condition in sales after delivering or invoicing of a sub

Hello,
I have to change the pricing condition of a sales order item, condition type PR00, after a sub quantity had been delivered or invoiced to the customer. BAPI_SALES_ORDER change I tried with did not work but also I got no error.
w_inx-updateflag = 'U'.
w_cond-itm_number = '000010'.
w_cond-cond_type = 'PR00'.
w_cond-cond_value = 999.
w_cond-currency = 'EUR'.
APPEND w_cond TO t_cond.
w_condx-itm_number = '000010'.
w_condx-cond_type = 'PR00'.
w_condx-updateflag = 'U'.
w_condx-cond_value = 'X'.
w_condx-currency = 'X'.
APPEND w_condx TO t_condx.
w_vbeln = p_in.  <--- from input parameter
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
   EXPORTING
     salesdocument    = w_vbeln
     order_header_inx = w_inx
   TABLES
     return           = t_ret
     conditions_in    = t_cond
     conditions_inx   = t_condx.
How can I change the price and trigger a new pricing for the sales order?
Thank you for your time
Regards
Norbert

Hi
In the transaction VOFM, tab -> Formulas -> Condition Value , create a new routine, no need to copy from existing as you will be writing your own logic.
In this new routine, set xkwert to your required value.
Ask your SD functional to assign this formula to ZAS2 condition in the transaction V/08.
I hope this might help.
Best Regards,
Nikhil Patil

Similar Messages

  • Change header pricing condition in sales order

    Hi,
    I have an requirement in VA01 and VA02 to automatically edit one header pricing condition. The user can able to change the value of that condition type in header not in items . Does anyone know what user exit I can use for this requirement.
    Thanks

    Hi Sunil,
    Plealse find below 2 methods to change header pricing conditions in sales order.
    1.Goto SE38, give prog name as MV45AFZZ and in that write logic under USEREXIT_PRICING_PREPARE_TKOMK . (OR)
    2) The same can be done by creating a Alt Calculation type routine through VOFM and writng the logic in the routine, which will then be assigned to the pricing procedure in the condition type which will automatically calculate the condition.
    Try with the options mentioned above..
    Regards,
    KK

  • How to change pricing Conditions in Sales order in change sales order bapi

    Hi Experts,
    How to change pricing Conditions in Sales order in change sales order bapi.
    I have used the 2 function modules bapi-changesalesorder and sd salesdocument change, But it is creating the new record , instead of changing the existing one, Could please assist regarding the same
    Thanks in Advance .
    NLN

    HI NLN
      I have just tried on my system and managed to overwrite the existing price by passing the following parameters.
      <b>Import Paramters:</b>
         SALESDOCUMENT - Sales Document Number
         ORDER_HEADER_INX - UPDATEFLAG as <b>'U'</b>.
         LOGIC_SWITCH - Import Structure - Pass 'X' to LOGIC_SWITCH-COND_HANDL.
      <b>Tables:</b>
         CONDITIONS_IN - ITM_NUMBER,
                         COND_COUNT, -> Condition counter same as KONV-ZAEHK generally it is <b>'01'</b>
                         COND_TYPE,
                         COND_VALUE,
                         CURRENCY.
         CONDITIONS_INX - ITM_NUMBER,
                          COND_COUNT,
                          COND_TYPE,
                          UPDATEFLAG as <b>'U'</b>,
                          CURRENCY.
       Hope i have clarified your query.
    Kind Regards
    Eswar

  • How to update pricing condition in sales in batch in the evening

    Gurus,
    I have a situation where I am supposed to update the freight charge condition type ("ZFR9" in my organization) on a scaled basis, depending on how much the customer (ship-to) has ordered on the same date. Since this changes from time to time, I need to write a program that does the following in the background in the evenings.
    1) Accumulate the wt of the material ordered by the same ship-to customer on the same delivery date.
    2) Find the scaled freight rate from a central universal freight charge table.
    3) Update the ZFR9 by this new frieght rate in all such sales order/line items that have the delivery date in question.
    The problem with using BDC is that the condition type ZFR9 appears on different lines depending on presence or absence of other condition types.
    Also I could not find any BAPI that does the update on a line item pricing condition.
    I am on 4.6C.
    Thanks for any help you can offer me.
    Regards
    Raju

    Guys,
    I am trying to make this work. I am able to add extra pricing conditions to sales order but I can not understand
    - how to change the value of an existing condition type OR
    - how to delete the condition type from the sales order line item
    Here is the sample code that I am using to test this out (most of the information is hard coded so that I can focus on a particular record)
    REFRESH RETURN.
        CLEAR   RETURN.
        REFRESH ORDER_ITEM_IN.
        CLEAR   ORDER_ITEM_IN.
        REFRESH ORDER_ITEM_INX.
        CLEAR   ORDER_ITEM_INX.
        REFRESH PARTNERCHANGES.
        CLEAR   PARTNERCHANGES.
        REFRESH CONDITIONS_IN.
        CLEAR   CONDITIONS_IN.
        REFRESH CONDITIONS_INX.
        CLEAR   CONDITIONS_INX.
        CLEAR SALESDOCUMENT.
        CLEAR ORDER_HEADER_INX.
    Move screen accepted docnumber TO SALESDOCUMENT.
        MOVE P_VBELN       TO SALESDOCUMENT.
        ORDER_HEADER_INX-UPDATEFLAG = 'U'.
        APPEND ORDER_HEADER_INX.
    Move screen accepted line item
        ORDER_ITEM_IN-ITM_NUMBER = P_POSNR.
        APPEND ORDER_ITEM_IN.
    Move screen accepted line item
        ORDER_ITEM_INX-ITM_NUMBER = P_POSNR.
        ORDER_ITEM_INX-UPDATEFLAG = 'U'.
        APPEND ORDER_ITEM_INX.
    Set the condition value
        CONDITIONS_IN-ITM_NUMBER      = P_POSNR.
        CONDITIONS_IN-COND_ST_NO      = '230'.
        CONDITIONS_IN-COND_COUNT      = '01'.
        CONDITIONS_IN-COND_TYPE       = 'ZSR3'.
        CONDITIONS_IN-COND_VALUE      = '333.00'.
        CONDITIONS_IN-CURRENCY        = 'USD'.
        CONDITIONS_IN-COND_UNIT       = 'LB'.
        CONDITIONS_IN-COND_P_UNT      = '100'.
        APPEND CONDITIONS_IN.
        CONDITIONS_INX-ITM_NUMBER     = P_POSNR.
        CONDITIONS_INX-COND_ST_NO     = '230'.
        CONDITIONS_INX-COND_COUNT     = '01'.
        CONDITIONS_INX-COND_TYPE      = 'ZSR3'.
        CONDITIONS_INX-UPDATEFLAG     = 'X'.  " update
        CONDITIONS_INX-COND_VALUE     = 'X'.  " update
        CONDITIONS_INX-CURRENCY       = ''.   " no update
        CONDITIONS_INX-COND_UNIT      = ''.   " no update
        CONDITIONS_INX-COND_P_UNT     = ''.   " no update
        APPEND CONDITIONS_INX.
        WRITE: / 'BAPI Called for', P_VBELN, P_POSNR .     
        CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
          EXPORTING
            SALESDOCUMENT               = SALESDOCUMENT
      ORDER_HEADER_IN             =
            ORDER_HEADER_INX            = ORDER_HEADER_INX
      SIMULATION                  =
      BEHAVE_WHEN_ERROR           = ' '
      INT_NUMBER_ASSIGNMENT       = ' '
      LOGIC_SWITCH                =
          TABLES
        RETURN                      = RETURN
       ORDER_ITEM_IN               = ORDER_ITEM_IN
       ORDER_ITEM_INX              = ORDER_ITEM_INX
      PARTNERS                    =
      PARTNERCHANGES              = PARTNERCHANGES
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
      SCHEDULE_LINES              =
      SCHEDULE_LINESX             =
      ORDER_TEXT                  =
      ORDER_KEYS                  =
         CONDITIONS_IN               = CONDITIONS_IN
         CONDITIONS_INX              = CONDITIONS_INX
      EXTENSIONIN                 =    .
        IF sy-subrc = 0.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
               EXPORTING
                    WAIT = 'X'.
    IMPORTING
      RETURN        =
        ELSE.                                           
         WRITE: ' BAPI RETURN CODE = ', SY-SUBRC.              
        ENDIF.

  • Manual Pricing Condition for sales order!!

    Hi,
    I have an issue, My requirement is I have to add a manual pricing condition in sales order header level. I have define the pricing condition for Freight Charges and that I have added to the pricing procedure that we have used for the transaction.
    The problem is when Iam creating the order in the condition tab manully want to choose the condition type, but what I created condition type (Freight Charges) is not appearing in the view. Only exesting condition types only appearing in tha selection view. I am on CRM Stand alone
    Pls anyone can advise where I miss the setting, I am new in CRM PRICING
    Regards
    VJ

    Hello VJ,
    You must consider that there is a setting "manual" in the pricing procedure customizing, indicating that the condition must be manually entered, and also a setting in condition type  customizing regarding changes that can be made. In condition type customizing you should NOT have option D "Not possible to process manually". Have you checked condition type customizing?
    Additionally please execute function module from note 867428 ( IPC_DET_CLEAR_CUST_BUFFER ).                
    This will ensure that all the customizing changes are immediately available  ( otherwise you would need to wait until the automatic buffer refresh occurs, by default once per day 
    Best Regards
    Luis Rivera

  • How to read pricing conditions on sales order

    Hi
    i need to retrive pricing conditions of sales order but before posting sales order
    any user exit avialable ...?
    also i hv found one user exit in that there is FM EXIT_SAPMV45A_003
    But i am not able to read pricing conditions values
    also no data is there in konv table coz sales order has yet not been post
    so before sales order can i read the pricing conditions values ...
    pls guide
    if possiple pls provide example also
    thanks
    Taran

    Hi
    The problem is you can't use the KNUMV, because u make sure to get the princing active in the document at run time.
    If you want to know the old data you can read the table KONV using field KNUMV, but here you can't know if some modification is done.
    U can try to know the field-symbols:
    DATA: XKOMV LIKE KOMV.
    DATA: FIELDNAME(30) VALUE '(SAPMV45A)XKOMV[]'.
    FIELD-SYMBOLS: <TKOMV> TYPE TABLE.
    ASSIGN (FIELDNAME) TO <TKOMV>.
    LOOP <TKOMV> INTO XKOMV.
    ENDLOOP.
    Max

  • Problem with pricing condition type in case of proforma invoicing

    Hello All,
    the problem is related to a pricing condition type in case of proforma invoice where the details are as follows -
    Name of Condition Type - ZADC - Add 10% on Cost                                         Access seq.   Z038 Diff
                                                                                    Plus/minus    A Positive
    Cond. class -  A Discount or surcharge
    Calculat.type -  A Percentage
    Cond.category - Blank
    Manual entries      D Not possible to process manually
    Amount / Percent - Checked
    Item Condition - checked
    Scale Basis - Quantity
    Currency Conversion - Checked
    Quantity Conversion - Checked
    This condition type has been kept as statistical in the pricing procedure. Still in the proforma invoice the condition type is not getting reflected automatically , whenever I am updating with " carry out new pricing " option the condition type is getting populated.In case of other commercial invoices this very condition type is getting populated automatically without any updates.Along with this point to be noted is that the Condition type in which the actual costi is captured has been kept active.
    What more needs to be configured or what are the changes to be done to populate the condition type automatically as statistical during the time of proforma invoicing?
    Thanks & Regards
    Priyanka Mitra

    Hi,
    Kindly do the pricing analysis and check whether you have the following error such as
    Inactive condition type because of subsequent price,
    Regards,
    Ravi

  • How to change the pricing rate of Sales Order after delivery is created?

    Is it possible to update(change) the pricing rate which belong to a specific condition type, of the "Sales Orders"  after corresponding delivery is created ?
    number of the Sales Order to be changed is huge. How can I handle this situation ?
    immediate replies would be rewarded

    Repricing is only possible if your pricing record has a valid from date that is equal to or before the pricing date on the order. Otherwise, your pricing rate change will be applicable only from the begin date of that record.
    Assuming that it is allowed by config, you can go to VA02, go to conditions, and then there is small button at the bottom, that says 'Update'. By pressing that, your system will automatically reprice the sales order, provided, as I said, all pre-conditions are met. Once you know that you can do this, then you can adopt any of the technical solutions that Rich had suggested above to do the mass changes.

  • Delete Pricing Condition IN Sales Order

    Hello Forum,
    Does anyone know how to delete a specific pricing condition in a Sales Order.
    In a sales order for each line item there are multiple pricing conditions. I need to delete a specific price condition 'ZZZZ' for instance then how do I go about it?
    This is what I have been able to find out so far.
    1. Does NOT seem to be possible by BDC because there is no way to position the cursor on the particular condition record I require.
    2. Although there is BAPI_SALESORDER_CHANGE, SAP via an OSS note specifies that this BAPI CANNOT be used to delete  condition records.
    3. None of the PRICING function modules seems to work for deletion. I did find out a function module PRICING_DELETE_LINE but this seems to rely on being called via SAP Standard function.
    I have tried searching for some means to do this and I hope that someone on this forum can give me some help on the same.
    Regards,

    Hi Peter,
    Your reference to OSS Note 593246 saved me from hitting my head to the wall, I had almost given up. Thanks a lot.
    Here is the code, in case any one needs to add or change a condition type on the sales order.
    REPORT ytest.
    DATA:lt_conditions_in TYPE STANDARD TABLE OF bapicond,
         lt_conditions_inx TYPE STANDARD TABLE OF bapicondx,
         lt_return TYPE STANDARD TABLE OF bapiret2,
         ls_logic_switch TYPE bapisdls,
         ls_order_header_inx TYPE bapisdh1x,
         ls_conditions_in TYPE bapicond,
         ls_conditions_inx TYPE bapicondx.
    ls_order_header_inx-updateflag = 'U'.
    ls_logic_switch-cond_handl = 'X'.
    ls_conditions_in-itm_number = '000010'.
    ls_conditions_in-cond_type = 'PR00'.
    ls_conditions_in-cond_value = '21.11'.
    ls_conditions_in-currency = 'USD'.
    APPEND ls_conditions_in TO lt_conditions_in.
    ls_conditions_inx-itm_number = '000010'.
    ls_conditions_inx-cond_type = 'PR00'.
    ls_conditions_inx-updateflag = ' '.
    ls_conditions_inx-cond_value = 'X'.
    ls_conditions_inx-currency = 'X'.
    APPEND ls_conditions_inx TO lt_conditions_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
       salesdocument               = '0000053232'
      ORDER_HEADER_IN             =
       order_header_inx            = ls_order_header_inx
      SIMULATION                  =
      BEHAVE_WHEN_ERROR           = ' '
      INT_NUMBER_ASSIGNMENT       = ' '
       logic_switch                = ls_logic_switch
    TABLES
       return                      = lt_return
      ORDER_ITEM_IN               =
      ORDER_ITEM_INX              =
      PARTNERS                    =
      PARTNERCHANGES              =
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
      SCHEDULE_LINES              =
      SCHEDULE_LINESX             =
      ORDER_TEXT                  =
      ORDER_KEYS                  =
      conditions_in               =  lt_conditions_in
      conditions_inx              =  lt_conditions_inx
      EXTENSIONIN                 =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait          = 'X'
          IMPORTING
           return         =
    Regards
    Amit Maole

  • Pricing conditions in sales order.

    Hi,
    In my sales order pricing conditions, the Condition values are coming in change mode. so that the users can change the condition values.
    I want to make it as disply mode. how can i do?
    Regards,
    jyothi.

    Hi,
    U can control the manual entry of pricing by following method:
    Go to Condition type - In Changes which can be made screen, Select "D" ( Not possible to process manually).
    However, please note u have to maintain condtion price for condition type through VK11.
    Hope it solves ur issue.
    Thanks
    M G Shankar

  • Copy the pricing conditions from Sales Order to Delivery

    Hi all,
    I have to send the princing conditions from the delivery trough Idoc.
    That's the reason why I need the princing conditions in the delivery. But I can't redetermine the pricing procedure in the delivery creation. I need to copy the pricing conditions from order to delivery.
    Because if there is any manual modification of a condition in the sales order, If I redeterminate the pricing procedure in the delivery, I would lost the changes.
    Anybody knows any User Exit or anyway to copy the pricing conditions from SO to Delivery?
    Thanks in advance

    I think pricing will not determine in delivery, if any shipmentchanges will copy to delivery, not standard pricing.
    Logically, when you create delivery by that time your pricing need to finsh, no changes, so send pricing infor from order to customer, as its standard process in any client.

  • Authorisation for pricing conditions in sales order

    Hi,
    This could be a tipical requirement. he requirement is a sfollows:
    Some users should not be allowed to enter / change some of the pricing conditions (manual) in the create / change mode of sales order (VA01/VA02). But they should be allowed to enter/change couple of other condtion types (manually).
    The other requirement is to disable the functionality of adding new condtions type through dropdown in the item pricing condition screen in VA01/VA02. The pricing update button also should be in a disabled mode for some users.
    Please advice me whether this can be achieved through some user exits or Basis authorisation?
    Regards,
    Sam

    Hi,
    Yes this can be done. If you are on EP4 you cna use the Badi PRICING_AUTHORITY_CHECK_UI to disallow users to use certain conditions.
    If you are not on EP4 you can still use the exit userexit_field_modification in program LV69AFZZ to check against authorisation.
    Choose the one that best suits your needs.
    Regards,
    Naveen

  • User exit to add header pricing condition in sales order

    Hi experts,
    I have an urgent requirement in VA01/VA02 to automatically add a header pricing condition and rate (Kanban charges) for a certain type of Sales order (Kanban Sales order). Does anyone know what user exit I can use for this requirement? Also, the additional header pricing condition should be included in the net value for the item.
    Thanks!

    HI Leo
      To add a condition price for a condition type, this has to be assigned in the <b>pricing procedure</b>. For each condition type in a pricing procedure, we will have <b>access sequences</b>. If we follow this approch, the price is automatically extracted basing on the access sequences when condition records are maintained. For this, no coding is required and everything can be done by configuration by Functional consultant.
       Naren is right to point out on the same.
      If you need to change the price for a particular condition which already exists, you can go by <b>pricing routines</b>. Go through transaction <b>VOFM</b> for the same. 
       I advice you to discuss with your functional consultant and understand the requirement and then go for modifying accordingly.
    Kind Regards
    Eswar

  • Inserting Pricing condition in Sales order when saving the sales order

    Dear ABAPers,
           My customers requirement is when saving the sales order new pricing condition has to be updated in the line item.for this i am using the User Exit 'USEREXIT_SAVE_DOCUMENT_PREPARE' ( MV45AFZZ).While saving the Sales order i am calculating the Price and updating in the Pricing conditions.
    In XKOMV internal table i am appending the pricing condition.But the problem is ,it is not calculating the taxes and it is Updating in VBAK and VBAP.
    How to do this.
    Thanks & Regards,
    Ashok.

    Dear ABAPers,
    I have Solved this Problem.
    Thanks & Regards,
    Ashok.

  • Users autorizations for pricing condition in sales order

    HI all,
    Can anyone tell me if there is any posibilities to control users autorization for certain pricing condition in a sales order? For example: User A can add/edit/display K007 but user B can only display K007 for a new sales order.
    Thanks in advance
    GeorgeR

    Hi
    Please check this link on WIKi
    http://wiki.sdn.sap.com/wiki/display/ERPLO/UserexitforRestrictingUserModifyingConditiontypeinSales+Order
    regards
    Prashanth

Maybe you are looking for

  • How can I change between different JRE in the Same PC

    I have two systems.A system can only run in JRE 1.3 and B system can only run in JRE 1.5 enviroment.But I have to run both in one desktop(which use WinXP SP2),how can I do it . I tried to edit the system config using the cmd of regedit , edited some

  • Wiki Server Will Not Start After Installing Safari 4.0.5

    *PLEASE HELP* We have a production server running MacOS X Server 10.5.8 with all software updates installed. Wiki server refuses to launch, though launchd tries to open it every 10 seconds. When visiting www.domain.com/groups/community we see an erro

  • Can we configure the new time unit in invoicing plan in OM7R

    SAP has provided the four time units in Define Rules for Date Determination (OM7R) which are 1- Day, 2-Week, 3-Month and 4-Year, I wanted to have the new time unit like "Quarterly" and "Half Yearly". Would somebody guide me on this how to get these n

  • Discoverer/Drake and other OLAP Data Sources

    Can you tell me if the new version of Discoverer for the BI functionality includes functionality for accessing Non-Oracle OLAP databases. Could you use Discoverer to access an existing OLAP datasource on Sqlserver?

  • JTextPane caches my local HTML file... How can I fix it?

    I have some problem with the JTextPane component. I do following: URL url = new URL( "file:////home/linux/myfile.html" ); jEditorPane.setPage( url );It works fine, but! Then I try to rewrite "myfile.html" with other data and when I do again: URL url