IPC condition value userexit - wrong condition rate

Hi Pricing-gurus,
I have a java condition value userexit to calculate the value for the very first price condition.
The condition value is calculated correctly, however, the price per unit is wrong which is due to the condition rate that was not changed, also.
If I change condition rate also in this formula, the entire pricing is wrong because the IPC carries out the pricing run multiple times (SAP: for internal reasons) resulting in a rate and value that is too high, as the changes are adding up.
How can I change the condition rate just once? Or how how can I make sure that the formula is carried out only once during a pricing update?
Regards,
Michael

Hi Pricing-gurus,
I have a java condition value userexit to calculate the value for the very first price condition.
The condition value is calculated correctly, however, the price per unit is wrong which is due to the condition rate that was not changed, also.
If I change condition rate also in this formula, the entire pricing is wrong because the IPC carries out the pricing run multiple times (SAP: for internal reasons) resulting in a rate and value that is too high, as the changes are adding up.
How can I change the condition rate just once? Or how how can I make sure that the formula is carried out only once during a pricing update?
Regards,
Michael

Similar Messages

  • IPC: How to read the Condition Rate(KBETR) in Java checkRequirement method.

    Hi Experts,
    As part of an IPC development, we need to read the Condition Type Rate (KBETR) in a Requirement Formula. The condition rate is the rate for the current record of the pricing procedure, e.g. Condition Type ZAB1.
    I can successfully read the condition rate in a Value formula using this piece of code:
    public BigDecimal overwriteConditionValue(IPricingItemUserExit pricingItem,IPricingConditionUserExit pricingCondition) {
                      BigDecimal ZConditionRate = pricingCondition.getConditionRate().getValue();
    In a Value Formula "IPricingConditionUserExit pricingCondition" is a input parameter of the overwriteConditionValue() method. However in a Requirement formula the standard method checkRequirement(IConditionFindingManagerUserExit item, IStep step, IAccess access) does not have any parameter which can give me the rate.
    I wrote the following logic in the requirement class, but line 2 is not executed.
    1. public boolean checkRequirement(IConditionFindingManagerUserExit item, IStep step, IAccess access) {
         2.  IPricingConditionUserExit pricingHeader = (IPricingConditionUserExit) item;
         3.  BigDecimal ZConditionRate = pricingHeader.getConditionRate().getValue();
    Please suggest how we can retrieve the condition rate in a requirement formula class using teh standard methods & classes.

    Hi,
    I have to set the condition rate as percentage in one of my codition value formula routine which i am developing based on java.
    I have overwritten  the method overwriteConditionValue() in my pricing routine which is 927. My logic is below.
    When I open my quotation using crmd_order, condition rate is not being displayed with % for unit condition rate coulmn in my pricing conditions.
    If I try to change my quotation for ex: Agrred price: xworke, then 927 formula is called and condition rate is displayed as %.
    So condition rate value is displayed perfectly , but when my quotation is in display mode condition rate value is coming as USA, but it should be % irrespective of my quotation is in display mode or change mode. I have attached the two screen shots for quotation display mode and change mode.
    Can some body throw insight what is wrong in my pricing routine logic in setting % condition rate rather than USD for the Condition rate value.
    public BigDecimal overwriteConditionValue(IPricingItemUserExit pricingItem,
      IPricingConditionUserExit pricingCondition) {
      BigDecimal condValue = null;
      BigDecimal discountValue = null;
      try{ 
        BigDecimal xworkg = pricingItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_G).getValue();
        userexitlogger.writeLogDebug(" 927 formula, Date=["+new Date()+"] , xworkg=["+xworkg+"]");
        BigDecimal xworke = pricingItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_E).getValue();
        userexitlogger.writeLogDebug(" 927 formula, Date=["+new Date()+"],  xworke=["+xworke+"]");
        pricingCondition.setCalculationType(PricingCustomizingConstants.CalculationType.PERCENTAGE); 
        if (xworkg.compareTo(PricingTransactiondataConstants.ZERO) != 0) {   
        condValue =  xworkg.subtract(xworke);
        pricingCondition.setConditionValue(condValue); 
        // Calculate percentage with 3-decimal-precision (as does ABAP-Version by multiplying with 100.000 instead of 100)
        pricingCondition.setConditionRate(condValue.multiply(PricingTransactiondataConstants.HUNDRED).divide(xworkg,
          3, BigDecimal.ROUND_HALF_UP), "%");
        pricingCondition.setPricingUnit(new BigDecimal(0), null);
        else {
        pricingCondition.setConditionRate(PricingTransactiondataConstants.ZERO, "%");
        pricingCondition.setPricingUnit(new BigDecimal(0), null);
      catch (Exception ex) {
        //pricingCondition.setInactive(PricingCustomizingConstants.InactiveFlag.INACTIVE_DUE_TO_ERROR);
        userexitlogger.writeLogError("Error Occured in 927 formula, reason code=["+ex.getMessage()+"]");
        return null;
      //return condValue;
      return null;
    Thanks
    Srikar

  • Condition rate/Amount (KONV- KBETR) is showing wrongly for Japanse currency

    Dear Friends,
    The Table data for the Condition rate/Amount (KONV- KBETR) is showing wrongly for Japanse currency(JPY).For ex-The invoice is showing correctly as 3 JPY but the Invoice output shows 300 JPY.This data being fetched from the KBETR shows 300JPY instead of 3JPY.Pl help to resolve this.
    Thanks
    Isaac

    Dear Isaac,
    This may due to condition record maintainenance for that condition type in the VK11 transaction so please go to VK12 transaction check the condition value for that condition type.
    KBETR -- Means Rate (condition amount or percentage) where no scale exists, it exists in KONP table(Condition record table).
    Also Check anybody change the values in the sales order or in invoice from 300 to 3.
    I hope this will help you,
    Regards,
    Murali.

  • Tax condition value is not calculating based on condition rate maintained

    Hi,
    I have maintained the condition rate as 4% for a condition type against a tax code in FV11. and also the validity period is correct.
    But when I select the tax code in purchase order and click on taxes button, some other condition value is coming in condition value field for that condition type. for example the PO price is 100Rs. the condition value has to  be 4% on 100Rs that is 4Rs. but some constant value is coming 5, even if change the condition rate in FV11 as 0%, the condition value is coming as 5 only.
    Does anybody faced this issue.??

    Hi
    for example the PO price is 100Rs. the condition value has to be 4% on 100Rs that is 4Rs. but some constant value is coming 5, even if change the condition rate in FV11 as 0%, the condition value is coming as 5 only.
    try this
    change your PO value and then observed the changes ,IF then  your are getting value different than 5 ,then i think there is no problem in your tax  procedure because you are saying after 0% in FV11 also your are get 5 only in PO
    as per me you can not put any constant value in tax procedure ,we only map how tax calculation will below for condition
    and check your condition record for that vat condition again in FV13
    Regads
    Kailas ugale

  • COMMPR01 Condition Rate vs ERP Moving Average Price

    Hi,
    Can someone please explain how the COMMPR01 product u2018condition rateu2019 is maintained in SRM?
    The reason Iu2019m asking is that the ERP moving average for the same material is different from the SRM COMMPR01 u2018condition rateu2019 value.
    This causes a problem because we source our MDM catalog data from ERP instead of SRM. If a shopper shops via the SRM internal catalog for a material that also resides in MDM, the shopping cart will show two different prices. The
    Is this a bug or are we doing something wrong?
    Thanks,
    Jerry

    Hi,
    You cannot maintain the condition rate in SRM for the materials which are replicated from backend, it will be applicabel only for the locally maintained materials.
    Regards
    Jagadheesh

  • When line item materials are same add the condition rate.

    HI!
    Im my smartform I am trying to get the unit price for the line items. There are are certain scenerions where my code faisl because the billing doc is prepared with multiple sales order which has several materials eneterd twice or thrice . SO as per my code the net value is getting added up for the identical materials but the condition rate is not adding up so when I do teh calculation to get the unit price it gives me wrong values. Like if theer are 3 materials in the billing doc with net price as 5000 each with eachs condition value for the tax is 500  then my code calucltes teh total for 3 items (identical ) as 150000 which is right but I have to substeract the condition value from this as teh condtion value is a tax and that is alreday included in teh net price so   we substarct, hence in this case it should do 15000 - 3*500 but unfortunately it does only 15000 - 500 , I beleive it takes the condition rate only for the last item found and substract that but i need to include all teh three items value so I get correct unit price.
    Following is teh code I used. I need to add functionality such that the gs_it_kond_w-kwert  gets added up each time the material number is same. so that i get the correct unit price.
    loop at  is_bil_invoice-it_kond into gs_it_kond_w where
          bil_number = wa_it_gen-bil_number and
          itm_number = wa_it_gen-itm_number .
        if gs_it_kond_w-kntyp = 'D'.
          gs_unit_price = ( gs_it_cont-netwr - gs_it_kond_w-kwert ) / gs_it_cont-fkimg.
          gs_it_cont-netwr = gs_unit_price * gs_it_cont-fkimg.
          is_bil_invoice-hd_gen-bil_netwr =  is_bil_invoice-hd_gen-bil_netwr  -  gs_it_kond_w-kwert .
        else.
          gs_unit_price = gs_it_cont-netwr / gs_it_cont-fkimg.
          is_bil_invoice-hd_gen-bil_netwr = is_bil_invoice-hd_gen-bil_netwr.
        endif.
      endloop.
      endif.
    Thanks

    Hi Aarav,
    I am not sure how your code behaves but, you can try following ways:
    1.  To ensure that if material for different line item is same, you can put a join on KONV, VBAK and VBAP as KONV-KNUMV = VBAK-KNUMV and VBAK-VBELN = VBAP-VBELN and KONV-KPOSN = VBAP-POSNR. After this, you can loop through the data extracted, sort it with material number and check for repeated materials and from KONV, you can get condition value and condition type etc.
    2.  To ensure that you are considering tax deductions each time a certain material is repeating, you can calculate net value at each material using its calculation type (KONV-KRECH) (percentage or fixed value) and condition value (KONV-KBETR or KONV-KWERT) without checking whether it is repeated or not. So, in the end, you will have exact net value and you will not miss any deduction.
    Let me know if this helps and also, for any clarifications.
    Gouri.

  • Condition rate in table KONV

    I have made a PO for an item with rate of a particular condition set to 89733 JPY per unit. However, when I check the condition rate in the table KONV for this particular item, it is showing a condition rate of 893.77 JPY per unit. Can somebody please explain what is going wrong here?

    I guess since JPY (Japanese Yen has no sub currency i.e. like we have paise below a rupee or pence below a pound) ,
    SAP stores JPY 1000 as 10.00 so in order to get the correct value for any currency use function module
    CURRENCY_AMOUNT_SAP_TO_DISPLAY
    Pass your currency and amount returned by KONV to get the actual value
    Regards
    Dheeraj..

  • Condition Rates(KBETR) from Subtotals KZWI2/KZWI6

    Hello All
    Base : I am implementing Condition Value Formula Routines in VOFM in order to Price Material.
        In a Pricing Procedure, they are two step numbers defined that displays the Subtotals( one with field 2 and other with 6).
         In a dummy condition type, I want to copy the subTotals and Condition Rates.
         For this dummy condition Type, I have implemented the CalType rountine and able to get the Subtotal as follows :
         xkwert      = komp-kzwi6.  (for first dummy condition type)
         xkwert      = komp-kzwi2.  (for 2nd dummy condition type)
         But I do not know how to find the Condition Rates associated separately for these subtotals and save it into the dummy conditions types.(both Condition Rates and Subtotal).
       Please guide to achive this !
    Cheers
    RJ

    Found myself!

  • UK VAT - MWST Condition Rate in Sales Order different to Billing Document

    We are testing the UK VAT Rate Change.
    Condition MWST has a rate of 15% until today and 17.5% from tomorrow.
    When I create a sales order with a requested delivery date of tomorrow and a pricing date of today the MWST Condition is shown as 17.5% at both header and lin eitem.
    If I create a delivery, post goods issue and create a billing document today, the billing document correctly shows the MWST Condition rate as 15%%.
    But the Sales document still displays the MWST Condition rate as 17.5% .
    ?? How can I get the sales document to display the actual condition rate ??
    I cannot find a solution to this anywhere and would be grateful for any help.
    Regards,

    Hi Michael,
    If the pricing date for the Sales Order and the Billing Document are the same, the VAT should be also be the same.
    But the pricing date for both document does not always have to be the same.
    If the real goods issue date is different from the planned goods issue date and you use it as a reference for the pricing date, then both dates will be different & that's OK. The same would happen if a discount is changed after the Sales Order is introduced but before billing & a new price determination takes place during billing.
    IMHO the Billing Document is the critical document and needs to have the right VAT rate.
    The Sales Order should have the data calculated based on the best information available at creation time, but does not need to be corrected after Billing.
    Best Regards,
    Franck

  • BADI for updating condition rate in CRMD_ORDER

    Hi Gurus,
    I am creating a sales order using CRMD_ORDER and trying to update the condition rate in ABAP. I need to know how exactly i can do the same.
    I have identified CRM_COND_COM_BADI and CRM_PRICING_I_BADI but I don't know which parameters to alter in order to update the condition rate.
    Regards.

    Hi Charles,
    Here is a piece of code which i used to update pricing conditions.
    From here you can see what all fields are to be passed to maintain price conditions.
                          y_lwa_pric_cond_change-stunr = y_lwa_pric_cond-stunr.
                          y_lwa_pric_cond_change-zaehk = y_lwa_pric_cond-zaehk.
                          y_lwa_pric_cond_change-waers = y_lwa_pric_cond-waers.
                          y_lwa_pric_cond_change-kbetr = y_lwa_pridoc-ypriccndp.
                          INSERT y_lwa_pric_cond_change INTO TABLE y_li_pric_cond_change.
                    y_lwa_pridoc-cond_change = y_li_pric_cond_change.
                    INSERT y_lwa_pridoc INTO TABLE p_it_pridoc.
                    y_lwa_input_fields-ref_guid = y_lwa_pridoc-ref_guid.
                    y_lwa_input_fields-ref_kind = 'B'.
                    y_lwa_input_fields-objectname = 'PRIDOC_COM'.
                    y_lwa_field_names-fieldname = 'LIST_PRICE'.
                    INSERT y_lwa_field_names INTO TABLE y_li_field_names.
                    y_lwa_field_names-fieldname = 'DISCOUNT'.
                    INSERT y_lwa_field_names INTO TABLE y_li_field_names.
                    y_lwa_field_names-fieldname = 'NET_PRICE'.
                    INSERT y_lwa_field_names INTO TABLE y_li_field_names.
                    y_lwa_input_fields-field_names = y_li_field_names.
                    INSERT y_lwa_input_fields INTO TABLE y_ct_input_fields.
                    REFRESH y_li_field_names.
                    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
                      EXPORTING
                        it_pridoc       = p_it_pridoc
                      CHANGING
                        ct_orderadm_i   = p_it_orderadm_i
                        ct_input_fields = y_ct_input_fields.
    Let me know if you need any clarrification.
    Regards,
    Vinay Sah
    Edited by: Vinay Sah on May 26, 2009 11:17 AM

  • Updating Condition Rate in SO using BAPI 'BAPI_SALESORDER_CHANGE'

    Hi,
    I want to update the price related to condtions(both automatic and manual) in Sales Order items from input file. I am using bapi 'BAPI_SALESORDER_CHANGE' to for this.
    I used follwing code,
    wa_so_cond-itm_number = wa_input-so_item.
    wa_so_cond-cond_type  = wa_input-kschl.
    wa_so_cond-cond_st_no = '011'.
    wa_so_cond-cond_count = '00'.
    wa_so_cond-cond_value = wa_input-kbetr.
    APPEND wa_so_cond TO i_so_cond.
    CLEAR wa_so_cond.
    wa_so_condx-itm_number = wa_input-so_item.
    wa_so_condx-cond_type  = wa_input-kschl.
    wa_so_condx-cond_st_no = '011'.
    wa_so_condx-cond_count = '00'.
    wa_so_condx-updateflag = c_u.
    wa_so_condx-cond_value = c_x.
    APPEND  wa_so_condx TO i_so_condx.
    CLEAR wa_so_condx.
    But this is creating a new line in conditions instead of updating the existing line, even though the existing line is a inactive by crerating a new line I want to update the exsting line with new condition rate instead of creating a new line. Please help me if you have any soultion for this.
    Thanks in Advance,
    Prasad JVV.

    Hi Sandipan,
    I used APPEND to fill the conditions_in & conditions_inx, without filling the tables how can I modify?
    Thanks,
    Prasad JVV.

  • (Condition rate not showing in sales order correctly.

    Condition rate not showing correctly in Sales order. it has maintained  perfect in condition record. Please provide me the programe which can retrive the correct rate in sales order.

    Hi,
    Including above suggestions, try if Pricing date is coming. If not, this may be one of the cause. Go to VOV8, select your doc type and in "Pricing date/purchase order date" section, check the "prop for valid-to" and "valid-from" settings. Buth should be blank.
    Reward if sorts out your issue
    Regards
    SD

  • FM to change condition rate (konp-kbetr)

    Hi ALL,
    I need to change the condition rate field (KONP-KBETR) . I am using FM SD_CHANGE_COND_REC_NUMBER and MAP2I_BAPICONDIT_TO_KONP
    but unable to get the expected output.
    Kindly advice on the solution.
    Regards,
    Bharat.

    Moved to ABAP Forum.
    Regards,
    RIch Heilman

  • Wrong exchange rate is transferred from CRM to ERP R3 via BDoc.

    Hi All,
    In CRM system, whenever quantity contract(QC) is created, it is sent to R3 with all details via Bdocs
    Exchange rate of QC which is present in CRM  is different than in R3.
    But when same contract is opened in R3 in change moce and do some changes it re determine the correct exchnage rate and updates the same in contract.
    But again when same contract is changed in CRM then again updates are sent to R3 with previous wrong exchnage rate.
    Please tell how to see which exchnage rate is available in Bdocs at the time of sending.
    Why is it not updating as per the exchange rates in R3.
    Please give your valuable inputs on this.
    Regards,
    Prashant

    Hi,
    Yes We checked the Bdoc. Currency rate is correct in CRM side but when it is sent to ECC, it changed to something else value which does not exist in TCURR table of both systems.
    Regards,
    Prashant

  • Wrong Exchange rate on the Contract (ME31K

    Dear Sap Guru
    I am writing to you in order to know if there is a solution to our problem.
    The scenario is quite easy:
    1 u2013 Suppose to insert a wrong exchange rate during the Contract creation (tcode ME31K)
    2 u2013 When you will create the scheduling agreement (ME31L) based on the Contract, the wrong exchange rate will be copied to the SK.
    3 u2013 The GR based on the SK will be valuated to the wrong exchange rate.
    About the point 1 and 3 there is a way to check the difference with the current exchange rate, like a tolerance limit for the Exchange rate?
    About the point 3 is it possible to set the system in order to value the GR based on the current exchange rate instead to use the exchange rate stored in the purchase order.
    Please let me know if you need more information in order to find a solution.
    Regards
    marco

    hi,
    try following sites:
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/3d/60c9d9302611d28dbc0000e82852b4/frameset.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/3a/55b424dae511d3978a006094b969cf/frameset.htm
    Hope it helps..
    Regards
    Priyanka.P
    AWARD IF HELPFULL

Maybe you are looking for

  • The update "Mac OS X update combined (powerpc)" can't be installed?

    I recently upgraded from OS X 10.3.9 to Tiger (10.4.6) and encountered a weird problem. My system is a Dual 1GHz G4 (mirror drive door) with 768 MB RAM. When I try to launch iTunes, I get an error telling me that "iTunes requires Mac OS X 10.4.7 or l

  • Adjusting Brightness on a Second Monitor

    I have a 17" Samsung LCD I use with my iMac (extended desktop). How can I adjust the brightness on that screen? My controls seem to only affect the primary monitor (the iMac).

  • How to I transfer my Itunes on my Iphone 3gs to my new mac?

    How do i transfer my itunes on my Iphone 3gs to my new mac? My old laptop died so I am unable to access my itunes on my computer but would like to retrieve the songs I purchased previously.

  • All records don't get updated in Data Target

    Hi, I am loading data from PSA to Cube. I see 2000 records in PSA but cube gets onlt 3 records? I have checked all the routines in TR and UR there are no restrictions. Any idea why its happening. Regards

  • System copy NW04S ABAP+Java same host

    Hi All I have this dev system ECC 6.0 (SAP_SID and DB_SID: D01) ABAPJava system and enterprise portal 7.0 (SAP_SID and DB_SID: P01) on the same host (hostname: host1). Now I need to do a system copy of the D01 ABAPJava system to build new system D02