Deleting pricing conditions using FM /AFS/VBAK_SALESDOCUMENT_CHANGE

Hi all,
following the instructions in oss note 593246 I have succesfully implemented code to delete a discount condition from a sales order using FM /AFS/VBAK_SALESDOCUMENT_CHANGE. But now I also want to delete a condition from a sales order position which has an item which has the AFS 'price by size' characteristic (an item with a shirt for example,  with 10 pieces, which are divided in 3 smalls, 4 mediums and 3 large).
Using the same code that was succesful earlier, it deletes the discount condition, but also all standard pricing conditions, making the pricing in the order invalid obviously.
Has anyone else had this problem? And more importantly: has anyone found a way to do this succesfully?
Thanks in advance
Arjan

update:
setting the condition to value zero is possible I found... so at least I have that option. But deleting would be the tidy solution, so any help is still aprreciated.
If there is anyone also struggleing with this AFS module and pricing, I can share the code I am using to update to zero or delete (when the material is not price by size-ed.

Similar Messages

  • Delete pricing condition using FM crm_order_maintain

    Hi experts
    I need to delete an order pricing condition using the FM crm_order_maintain but i can't do it....
    somebody can help me with the code for do this?
    Thanks in advance
    Marco

    Do one thing,,,
    Go to CRMD_ORDER
    Open the transaction in change mode
    Go to the Pricing condition tab
    put /H in transaction code box
    delete the pricing condition manually from the transaction
    Put break point on CRM_ORDER_MAINTAIN function module...
    debugger will stop at the function module...
    check the data in all tables at this time and try to pass the same...it should work..

  • Delete pricing conditions line using BAPI_SALESORDER_CHANGE

    Hi experts.
    I've read the forum and OSS about this topic and don't have clear if it's possible to delete a price condition position (using BAPI). Using tx. VA02 I can delete pricing conditions, that's why I think should be possible.
    We have a sales order created, and depending on the sold-to-party we have some discounts: RA00 (% discount) or RB00 (absolute discounts).
    In some cases we need to insert/update or delete these pricing conditions. For insert/update, we don't have any problem using
    BAPI_SALESORDER_CHANGE and setting the appropiate updateflag.
    But... what would be the procedure to delete a discount, for example, RA00 fixed on a sales order? Has the logic_switch be informed specially?
            wa_cond-itm_number = lt_cond-itm_number.
            wa_cond-cond_type  = lt_cond-cond_type.
            APPEND wa_cond TO i_cond.
            wa_condx-itm_number = lt_cond-itm_number.
            wa_condx-cond_type  = lt_cond-cond_type.
            wa_condx-updateflag = 'D'.
            APPEND wa_condx TO i_condx.
    Lots of thanks.
    Javier

    I am not positive on being able to delete a pricing condition through program.
    Online when you try to change the pricing, SAP suggests us to redetermines the Pricing rather than just changing the values. And also the pricing condition config also plays a role... I think there was a setting which says Pricing condition to be manual which means you can add or delete the conditoin.

  • 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

  • Mass delete pricing condition type

    Hi experts,
    I have a requirement to delete a pricing condition type e.g. ZA01 (manual input) which was entered twice by users to all sales orders not billed about 1000 and 3000 item lines. What is the best way to delete without incurring errors later during billing?  It's very easy to identify i.e. to delete all ZA01 without any amount entered.
    Thanks.
    Regards
    PSK

    Hi,
    I can think of this: get a program built to do this activity.
    build it flexible to delete any such CType for any S-Org--so it can be r-used later.
    Not sure if t-code MASS can help here?
    Regards,
    Raghu.

  • Table for Deleted Pricing Condition

    Dear SD Guru's,
    Good Day.
    I would like to ask what is the table i can use to show all the pricing condition that is flagged for deletion? and with the deletion date.
    Currently I am using KONP, but there is no deletion date field there?
    Any ideas?
    Hoping for your positive feed backs.
    Thank you.

    Hi Tina,
    Check this if it useful
    Enter transaction: OY18 ? Then choose the option: Evaluate Logs.
    Enter table: NACH,then Specify the time interval for which you want to run the analysis. Choose the option: "Tables" in the Evaluate for - area.
    If you get the message "No logs found for selected period" and you know for a fact that there were changes, execute /nsu53.
    Regards,
    Madhu.

  • Regarding purchase order pricing conditions using exits or badi

    Hi friends can anybody help me and  let me know the solution.
    Please explain how the change in the pricing condition amount value should update the cost in PO.
    and which EXITS or BADI use for .
    if anybody have the solution send me reply AS SOON AS
    Thanks,
    srinivas

    OK
    But the problem is pricing conditions like transport cost. Because when I do a new purchase order the system use last transport cost and i don´t want it.
    What I want (if possible) with infoupdate is:
    - Update ( PBXX & PB00)
    - Don´t update (other conditions like transport).
    Thanks....

  • Question regarding usage of CRM pricing conditions using date ranges

    Hi,
    I wonder if someone has a suggestion regarding how to set up pricing conditions in CRM to accomplish the following scenario:
    For existing customers we want to “freeze” the product price for certain customers,
    but at the same time let other customers get another prize for the same product
    and period.
    (We have scenarios where the product price changes retroactively, years back in time, but only for those custoemrs that  fulfill a specific criteria at the time where the prize change was decided to take place..)
    We want the prize to be dependent on the customer status AND when this status was set
    (before a specific date), but there doesn’t seem to be a way to set up pricing
    conditions with date ranges (i e "customer status changed before YYYYMMDD
    renders prize X").
    Since we are talking about quite a lot of customers we do not want to add each and every
    one of them as “individual price items” in the pricing conditions tables.
    Does anyone have an idea regarding how to set this up?
    Thanks
    /Marika Wasserman

    Hi Marika,
    condition records have validity (FROM - TO). Let us assume you have a condition record for product A with 50 EUR per piece and this record is valid from 01.01.2014 until 31.12.2014.
    If you create CRM Sales Order having product A at 4.12.2014 and this date is used as pricing date for the conditon determination, then it will find this condition record with price 50 EUR per piece. This 50 EUR should be the froen price.
    Now how can you achieve that for the same CRM Sales Order another product price is determined for certain customer or a certain customer group?
    The idea is to pass an additional pricing attribute, e.g. customer group. Then you can create a new condition table with this field with the key fields product and customer group. In the access seqeunce first the new condition table is checked and if no record is found, then the second conditon table is checked as shown below:
    Access Sequence ABC
    Access 10: condition table with key fields product + customer group
    Access 20: condition table only key field product
    Instead of customer group you define also any other field. You create your own implementation of the BAdI  CRM_COND_COM_BADI that passes this field with a value to pricing.
    Best regards,
    Baris Yalcin

  • Delete pricing condition records : vk12

    When i mark a record as deleted in vk12, there add a tick in DeletionID column. I was told the record would be deleted after database reorgnization.
    I want to ask, when will DB reorgnize? Would the deleted records be active before DB reorginze?
    Can anybody help me?
    Thanks a lot

    hi Yimeng,
    In v/06 for your condition type check the field delete from DB
    If you set this field as A or B,then only you will be able to delete the condition record permanently via VK12.Otherwise you can only set deletion indicator. after u set the indicator in v/06, then goto
    vk12 and set the record as delete.so the first one controls the actions in vk12.
    condition record can be deleted in two ways
    1.physical deletion
    2.marked for deletion.
    The customizing can be done at the condition type maintainance in V/06,
    u have three options
    1.physical deletion with pop up
    2.physical deletion without pop-up
    3.mark for deletion.
    select an option there and in condition record in VK12, select the record and
    and delete with the deletion indicator.
    SAP recommends physical deletion
    reward if it is useful
    bye MCM

  • Regarding adding new pricing condition using BAPI_SALESORDER_CHANGE

    Hi All,
    I am trying to add a new pricing condition at item level using Bapi_salesorder_change, but it is not getting updated. I am also doing Bapi_transaction_commit as the next step.
    I am passing the sales order number and the Update flag in the header. Tried passing G as the logic switch-pricing and also tried with logic_switch-COND_HANDL = X.
    I am passing the data in structure CONDITIONS_IN with the value for item numebr, condition step number, condition count , condition value, currency and unit.
    Also I am passing data in CONDITIONS_INX with the required flags set and update flag as 'I'.
    The output says that order is changed and saved successfully, but the condition type is not there when i check the pricing coinditions inside the order at item level.Please help.
    Regards,
    Kaustubh B. Khasnis

    Hi,
    In the condition tab..
    Press the determination analysis button..
    There it will show the why the pricing condition type is not added..
    Thanks,
    Naren

  • Create pricing condition using BAPI_CUSTOMERQUOTATION_CHANGE

    Hi ,
    I have a requirement to update  quotation pricing data is condition exists i.e if pricing is already exists , if pricing is not exists it has to create a new pricing condition with the given information .
    I am able to update the information using  BAPI_CUSTOMERQUOTATION_CHANGE if pricing condition exists ,if pricing condition  not existing its not working as expected.
    Please guide me..
    code i have written
    *Conditions
          lt_conditions_in-itm_number = it_quot-posnr.
          lt_conditions_in-cond_type = c_zill.
          lt_conditions_in-cond_value = it_quot-kbetr.
          lt_conditions_inx-cond_count = 1.
          APPEND lt_conditions_in.
          lt_conditions_inx-itm_number = it_quot-posnr.
          lt_conditions_inx-cond_type = c_zill.
          lt_conditions_inx-updateflag = c_u.
          lt_conditions_inx-cond_value = c_x.
          APPEND lt_conditions_inx.
    Thanks in advance,
    Srinivas.

    Hello Srinivas,
    Use BAPI_QUOTATION_CREATEFROMDATA in the create scenario. Before calling the BAPI check if the quotation exists. If yes, use BAPI_CUSTOMERQUOTATION_CHANGE.
    Regards,
    Ajith

  • Tracking deleted pricing condition records

    Hello,
    I Have a condition record for a condition type with a  particular price of USD 100 with validity date from 1.10.09 to 30.10.09.
    Now we create another condition record for the same condition type with a new price of USD 50 with same valid date from 1.10.09 to 30.10.09..
    So now the systems delete the old condition reocord of USD 100.This is standard sap.
    Now I want to know is there any way of tracking the deleted condition records like  the ones the system has deleted. If there is no standard report and if we have to develop a Z report, then how to develop that since the tables do not contain the old conditon records.
    regards
    sachin

    Hi,
    Yes, from the condition table that you are going to maintain the condition records (check the condition table assigned to the access sequence, from the condition type), we will get all the condition records maitained for specific combination/material
    Now go to se16 and enter the condition table name and give the proper selection criteria then you will get all the condition record numbers maintained to your selection with validity dates. then you can go to KONP and pass the condition record and you can get the condition values for that particular combination with proper validity dates.
    (Actually from VK13/VK12 based on validity date that we have mentioned in the selection screen will display the condition record valid on that paricular date, from the system those condition records will not be deleted at all)
    OR
    There are two possible methods of displaying change documents:
    Choose Environment -> Changes -> For condition record.
    Change data for the selected condition record(s) will be displayed.
    Choose Environment -> Changes -> Report.
    A selection screen will appear where you can choose multiple criteria for displaying change documents. The result of the selection report is displayed.
    Regards,
    Satya

  • Pricing condition deletion in CRM

    Hello!
    We're trying to delete pricing condition using CRMXIF_CONDITION_SEL_DELETE, but we are able to delete only a number of condition records at once.
    I've read the documentation  for this FM, but  i still can't understand how to delete particulary one pricing condition from condition table.
    Can anybody help me?
    Tnank you!

    Hi,
    I used function module 'CRMXIF_CONDITION_SEL_DELETE' to delete condition records. Below is the sample code,
    Data:  ls_data           TYPE bapi_ct_sel_opt_msg,
           lt_range          TYPE TABLE OF bapi_ct_cond_rec_sel_range,
           ls_range          TYPE bapi_ct_cond_rec_sel_range,
           lt_return         TYPE bapirets,
           lt_ret            TYPE bapiret2.
        ls_data-object_representation   = 'E'.
        ls_data-sel_opt-ct_application  = 'CRM'.
        ls_data-sel_opt-object_task     = 'D'.
          ls_range-fieldname    = 'ZZOPPORTUNITY_GUID'.
          ls_range-r_sign       = 'I'.
          ls_range-r_option     = 'EQ'.
          ls_range-r_value_low  = lv_guid.   
          APPEND ls_range TO lt_range.
          ls_range-fieldname    = 'KSCHL'.
          ls_range-r_sign       = 'I'.
          ls_range-r_option     = 'EQ'.
          ls_range-r_value_low  = 'ZZNE'.    "cond type
          APPEND ls_range TO lt_range.
          ls_data-sel_opt-range = lt_range.
    CALL FUNCTION 'CRMXIF_CONDITION_SEL_DELETE'
          EXPORTING
            data   = ls_data
          IMPORTING
            return = lt_return.
    * Committing the transaction
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          IMPORTING
            return = lt_ret.
    Regards,
    Arun

  • Deleted PO conditions reappear

    Hi all,
    The deleted pricing conditions keeps appearing back the next time I go into change mode of the PO. Eg using tcode ME22N, I deleted a discount condition say RA00 and managed to save the PO. The next time i go into the PO again, this condition re-appears with the same value before it was deleted. If I change the value say from 5% to 3%, the condition retains the latest information ie 3%. Happens for header and item conditions, std SAP as well as customised condition types. Not related to parameter EVO as I have literally tried all possible combinations for this paarmeter. I am on ECC5.0. Hope someone can help. thanks.

    Hi
    <b>Check : Price Determination Procedure</b>
    In the Price determnation procedure, you have maintained this condition type and the procedure have been mintained for that vendor (as you know).
    You have to change/delete the condition type in the Price Determination Procedure.
    Pls Revert and Reward.
    Regards
    Vijay

  • Deleted Pricing Cond rec in MEK2 and added a new one, now no pricing in PO!

    Hello,
      we had a bad pricing Condition record for Stock Transport Order PO's that had to be deleted and we needed to add a new pricing condition record.
    We used MEK2 to delete the bad record (Purch. Info Rec Category was equal to a "space"), and then add a new pricing condition rec. with a "0" (Standard) in the Purch. Info Rec Category and a correct monetary amount.  Then saved.
    Now when we create a PO for the material we corrected the pricing condition rec, we get NO PRICING! 
    Even if I go into MEK1 to just add the new condition record and set the start date back further in the past and save ... nothing comes through on the PO for the material in question.
    Is there something wrong with Deleting Pricing Condition Records?  I can not find a note on this.  I can see the old deleted condition record in the KONP table and the new condition record, but the PO create program is not picking up the new condition record no matter what we do.
    Any one have a situation like this before?
    Scott.

    I did check the analysis before, but I took a closer look and the "Material Info Rec (Plant-Specific)" access was not defined.
    The problem is that on the Material info record, we did not have the info record extended to the plant, just the Purchase Org.
    Thanks.

Maybe you are looking for

  • DVDSP DVD's play fine in macs but not in standalone players...

    This might be attached to my previous problem, but I thought I would give it a new topic as it is now a new problem. The DVD's I have made in DVDSP play as they should in DVD Player when inserted into the two iMacs we have, however when we insert the

  • Best method for scrollable list of objects

    I was attempting to create a list of objects in a scrollable pane with the ScrollPane object. I am having a very hard time customizing what is actually scrolling in that pane, though. By using a custom renderer class, I am able to change what it look

  • Unwanted space within an extended JPanel

    Hello JDC I subclass the Jpanel and I draw an image inside. The problem is that I receive unwanted empty space in the canvas bounds. I tried to set the mini,maxi and preferred size of both the jframe and the canvas but its doesnt help. public class I

  • File Crashing on Output - printing/PDF/other

    Firstly - with any file that is repeatedly crashing make a backup of it Immediately! Option 1 Try to remove corruption using the Export/Save to IDML link to how to here Option 2 Determine how many pages in your document Export or Print your document

  • OS upgrade from windows 2000 to Windows 2003/ 2008

    Hi friends, We are planning to do an OS upgrade of our current production system from windows 2000 to Windows 2003/ 2008. Can you please refer me to any existing document /Forum link which has a detailed strategy outlaying the activites to be perform