Issue in pricing routine

Hi,
I have an issue while writing code in the pricing routine. while calculating KBETR if the value is 1.035 it is rounding off to 1.04.
Since KBETR has only two decimals it is rounding-off but client wants 1.035 only.
Please help me.
Regards,
Anvesh Gummadapu.

Hi Anvesh,
Table for decimal decimal places in currency is TCURX .
If ur currency does not supports 3 decimal places then may be u need to create a Z version of that currecny with 3 decimal places.
Please check SAP documentaion [Special Output Formats |http://help.sap.com/saphelp_470/helpdata/en/9f/dba1ef35c111d1829f0000e829fbfe/content.htm]   & 
[Defining Currencies|http://help.sap.com/saphelp_40b/helpdata/en/08/51410a43b511d182b30000e829fbfe/frameset.htm]

Similar Messages

  • IPC Java userexit-pricing routines

    Hi experts,
    I am new to IPC  java pricing routines and i have a requirement like this,
    1. The user enters manually in Quote the new price. (say cond type ZNEW)
    2. The cond record for ZTKE is available with the price as well as Max price and Min Price.
    3. The Routine formula should validate with ZTKEcondition record with maximum and minimum price available.
    4. If the new price is within the max/min range then pass it. System will do nothing and accept the manual price entered.
    5. If the price is not within the range then issue error message u2018Price not within the rangeu2019. The system does not accept the manual entry of the new price.
    Please let me know how to approach for the solution of the above.
    I know how to raise the error messages ,my main concern is to check the new price of condition type with the other condition type min n max values.
    Please provide me some pointers on it.
    Thanks.

    Hi Micheal,
    Thanks for the reply. I am not doing anything with ZTKE. I need to check with ZNEW.when user enters the new price in ZNEW condition type ,that price should be checked with the price in ZTKE with its min n max values. I.e if the entered new price is in the range between max n min values ,system will take that entered new value ,if its not it will through a error.
    So, for this i need to get the condition record value of min n max and compare with the entered new price in ZNEW and check for the above. I hope you got my point.
    Please let me knoe which way i can proced to do so....
    Thanks.

  • IPC Pricing routine for Product Family Margin in Quotation is not working

    Hi,
    I am working on the IPC Pricing Routine to calculate Item's Product Family Margin in the Quotation. 
    Process followed:
    Step 1:  Created a Group condition ZPFM for Product Family Margin and assigned to the pricing procedure. 
    Step 2:  Created a Value Routine to determine ZPFM's Condition Rate and Condition Value.
    Logic: 
              1.  Collect (Sum Of)  the Cost (ZSVC) and the Subtotal 3 of the items which are in same Material Group.
               2.  Assign the ZPFM Condition Value = Sum of Subtotal 3 - Cost.
    Issue:  The condition value for ZPFM is calculating correct for all line items except the last item.  I am getting some junk value always to the last item. If I delete the last time, again next last item is giving wrong value.  The calculation value in the routine debugging log (SM53) is showing correct value.  However, assigning the wrong value.  No other routines have been assigned to this condition type in the pricing procedure. 
    Routine Code:
    package stanley.pricing.userexits.val;
    import java.math.BigDecimal;
    import com.sap.spe.pricing.customizing.PricingCustomizingConstants;
    import com.sap.spe.pricing.transactiondata.PricingTransactiondataConstants;
    import com.sap.spe.pricing.transactiondata.userexit.IPricingConditionUserExit;
    import com.sap.spe.pricing.transactiondata.userexit.IPricingItemUserExit;
    import com.sap.spe.base.logging.UserexitLogger;
    import com.sap.spe.pricing.transactiondata.userexit.ValueFormulaAdapter;
    //import com.sap.spe.pricing.transactiondata.userexit.IPricingCondition;
    public class Z_CondValueRoutine730 extends  ValueFormulaAdapter{
       private static UserexitLogger uelogger =
              new UserexitLogger(Z_CondValueRoutine730.class);
      public BigDecimal overwriteConditionValue(IPricingItemUserExit pricingItem,
             IPricingConditionUserExit pricingCondition) {
      // Variable Declarations.
      BigDecimal conditionValueZCVC=PricingTransactiondataConstants.ZERO;
      BigDecimal conditionValueZCVCAccrual=PricingTransactiondataConstants.ZERO;
      BigDecimal subTotal3=PricingTransactiondataConstants.ZERO;
      BigDecimal subTotal3Accrual=PricingTransactiondataConstants.ZERO;
      if(pricingCondition.getConditionTypeName().equalsIgnoreCase("ZPFM")){
                IPricingItemUserExit[] prItems;
                prItems = pricingItem.getUserExitDocument().getUserExitItems();
                String materialGroup = pricingItem.getAttributeValue("MATL_GRP");
                uelogger.writeLogDebug("  Material Group  :"+materialGroup);
                for (int i=0;i<prItems.length;i++){
                     String materialGroup1 = prItems[i].getAttributeValue("MATL_GRP");
                     if (materialGroup1.equalsIgnoreCase(materialGroup)){
                          subTotal3 = prItems[i].getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_3).getValue();
                          subTotal3Accrual = subTotal3Accrual.add(subTotal3);
                          IPricingConditionUserExit[] conditionsForCumulation = prItems[i].getUserExitConditions();
                          for (int j = 0; j < conditionsForCumulation.length; j++) {
                               if(conditionsForCumulation[j].getConditionTypeName()==null) {
                                   continue;
                               else if ( conditionsForCumulation[j].getConditionTypeName().equalsIgnoreCase("ZCVC")){
                                    conditionValueZCVC = conditionsForCumulation[j].getConditionValue().getValue();
                                    conditionValueZCVCAccrual = conditionValueZCVCAccrual.add(conditionValueZCVC);
                BigDecimal conditionValueZPFM=PricingTransactiondataConstants.ZERO;
                conditionValueZPFM = subTotal3Accrual.subtract(conditionValueZCVCAccrual);
               BigDecimal conditionRateZPFM=PricingTransactiondataConstants.ZERO;
               conditionRateZPFM = conditionValueZPFM.multiply(new BigDecimal ("100"));
              conditionRateZPFM = conditionRateZPFM.divide(subTotal3Accrual,7,BigDecimal.ROUND_FLOOR);
             uelogger.writeLogDebug(subTotal3Accrual+"-"+conditionValueZCVCAccrual+" = "+conditionValueZPFM);
             uelogger.writeLogDebug("Condition Rate  :"+conditionRateZPFM);
           pricingCondition.setConditionRateValue(conditionRateZPFM.setScale(2,BigDecimal.ROUND_HALF_UP));
           pricingCondition.setConditionValue(conditionValueZPFM.setScale(2,BigDecimal.ROUND_HALF_UP));
              return null;
           return null;

    Hi,
    I think you should change xkwert variable instead of komv-kwert.
    Standard routines does the same.
    Aslo check in SPRO settings that routine is attached and
    getting triggered by putting break-point.
    Regards,
    Vishal

  • IPC  java user exit- pricing routines

    Hi experts,
    I am new to IPC  java pricing routines and i have a requirement like this,
    1. The user enters manually in Quote the new price. (say cond type ZNEW)
    2. The cond record for ZTKE is available with the price as well as Max price and Min Price.
    3. The Routine formula should validate with ZTKEcondition record with maximum and minimum price available.
    4. If the new price is within the max/min range then pass it. System will do nothing and accept the manual price entered.
    5. If the price is not within the range then issue error message u2018Price not within the rangeu2019. The system does not accept the manual entry of the new price.
    Please let me know how to approach for the solution of the above.
    I know how to raise the error messages ,my main concern is to check the new price of condition type with the other condition type min n max values.
    Please provide me some pointers on it.
    Thanks.

    Hi Faiq,
    I am facing the same problem as you.
    I tried to solve it via the following code sample:
    throw new PricingRuntimeException([MessageClass], [MessageNumber], [Attributes], [RootCauseException]);
    throw new PricingRuntimeException("ZTEST", 0, new String[] {"test2"}, null);
    But no error appeared.
    Another possibility can be the following method!?
    But I do not know how to use it:
    pricingItem.getUserExitDocument().setStatusMessage(new StatusEvent());
    Perhaps meanwhile you have found another solution.
    If yes it will be nice if you post it.
    Greets Ruben

  • Issue in Pricing Formulae

    Hi Sap gurus,
    I am facing one issue in pricing. I am getting this error in my effective pricing condition.
    "Inactive via formulae of incorrect". Can any body please give me some lights on the issue?
    Thanks.
              chetali

    Hi Chetali,
    As per your error mssage I came to know that this is related to some routine issue which is assigned to that 'effective pricing condition'
              So, Please check the settings related to the requirement ,alternative calculation type and alternative condition base value routines of that condition type.
    Also check the logic involed in the routines with the ABAPer help.
    I hope it will help you
    Regards,
    Murali.

  • Pricing routine 901 in the pricing procedure

    Can you tell me in detail (step by step) How to write pricing routine 901 in the pricing procedure?
    I know ABAP coding. I am new to SD (pricing).
    The only thing I know is the VOFM 901 Pricing Routine development is in ABAP program RV64A901.
    Purpose : Pricing Routine for calculating the price difference due to increase or decrease in the copal contract price from the copal actual price
    Description :
    Routine 901 : Copal Difference Calculation
    The formula to be used is : Copal Adjustment = ( Copal Contract Price + Copal Actual Price ) x Amount of Copal / 1000
    Where
    Copal Contract price is the condition type Y001 from the pricing procedure Z00003.
    Copal Actual price is the condition type Y002 from the pricing procedure Z00003.
    Amount of Copal is the condition type Y005 from the pricing procedure Z00003.
    Copal Adjustment is the condition type Y003 from the pricing procedure Z00003.

    Hi,
    Go to the transaction VOFM.
    In the menu..Choose...Formulas -> Condition value
    At the of the table ..Enter 901 and give the description..
    Then select that row and press source text button or F5.
    It will ask for the access key...
    Get the access key for the corresponding object
    R3TR PROG RV64A901
    Then in the code..
    READ TABLE XKOMV INTO LWA_Y001 WITH KEY KSCHL = 'Y001'
                                                      KPOSN = KOMP-POSNR.
    READ TABLE XKOMV INTO LWA_Y002 WITH KEY KSCHL = 'Y002'
                                                      KPOSN = KOMP-POSNR.
    READ TABLE XKOMV INTO LWA_Y005 WITH KEY KSCHL = 'Y005'
                                                      KPOSN = KOMP-POSNR.
    Sum up the values in LWA_Y001, LWA_Y002 & LWA_Y005
    And then move it to XKWERT
    Thanks,
    Naren

  • Pricing routine is not called even after assigning it in pricing procedure.

    Hi
    I created a pricing routine (Condition value) for one ZCondition type. I saved it in the workbench request. Functional consultant assigned this pricing routine to condition in Pricing Procedure. The routine was called while creating a PO. It works perfect in development system. But after we transported to quality server the routine is not getting called. Routine is displayed in pricing procedure in quality server. Routine program also exists in quality server. But the program include statement is not found in standard program RV64ANNN in quality. But in development the include statement appears in this program. How this program was not modified in quality server after transport? Its a SAP standard program and it was not saved in any request and was not modified manually too.
    Can anyone explain me what could be the reason that the program RV64ANNN is not updated in quality server to include the routine?
    How can we update this program without modifying it manually?
    Would deleting the pricing routine and recreating it help resolve this problem?

    Hi,
    Refer to the following Notes:
    [Note 22808 - Transferring formulas|https://service.sap.com/sap/support/notes/22808]
    [Note 388998: VOFM: Check report for entries in TFRM/TFRMT|https://service.sap.com/sap/support/notes/388998]
    [Note 28683: PERFORM_NOT_FOUND: VOFM routine is not active|https://service.sap.com/sap/support/notes/28683]
    Note 22808 - Transferring formulas is the first place you should look.  FYI, there is a lot of information on this topic available by searching for SAP Notes that have "RV80HGEN" and/or "VOFM" as keywords.
    Regards,
    Jamie
    Edited by: James Gaddis on Mar 19, 2008 10:59 AM - Added an additional SAP Note number and comment about searching for more Notes.

  • BAPI_PO_CREATE1 - Overriding standard pricing routine with fixed price

    Hi,
    I have to post a purchase order with BAPI_PO_CREATE1. It's important that the price in BAPIMEPOITEM-NET_PRICE is relevant for posting this purchase order and nothing else. I don't want to search for the price in any pricing routines of SAP, I want to take the price that I input explicitly.
    How can I tell BAPI_PO_CREATE1 that I want to use the fixed price in BAPIMEPOITEM-NET_PRICE?
    Thank you very much!
    Ralf

    Hi,
        if u have code for bapi_po_create1     ( purchase order creation bapi ) can u send me when i write the prog. it gave the error
           No instance of object type PurchaseOrder has been created. External reference:
    Thanks,
    mukesh

  • Get Delivery date(EKET-EINDT) in MM Pricing routine(group condition)

    Hi All,
    I have created an MM pricing routine RV65A092 in VOFM. So when creating PO(ME21n), this routine will trigger..
    Now the problem is I need EKET-EINDT for grouping condition. It was mentioned to call program SAPLMEPO and get EKET data.
    Please help me how to get delivery date in that routine  which is filled in Item level during PO creation
    Thanks
    Ram

    Hi Ram,
    For SD you have the SAP Note 531835 - Using field PSTYV in the condition access. For MM is simmilar, although you must use the enahncements. Instead use the userexits that note says, use the enhancement LMEKO001 (EXIT_SAPLMEKO_001) to populate fields ZZ in KOMK and LMEKO002 to populate KOMP.
    I hope this helps you
    Regards
    Eduardo

  • Issue on Pricing

    HI SAP Gurus,
    Could any one help me out with an Issue on Pricing
    The need is
    Our company sells consumer goods through our website store. We introduced a coupon system. The coupn system is that if u r a coupn member (means employees of the organisation) and if u put ur coupon no then the customer will be entitled for a discount of fixed Percentage.
    How i put the values of coupn in pricing procedure,
    Could any one help me out in this procedure
    Thanks in advance
    EDIE
    Edited by: Edie Edie on Jan 8, 2008 11:24 PM

    hi warwick,
    we r not using condition records, so no acess sequence, we r manualy updating the conditions value in  the pricing.
    Is there any way to create  a service material and put in the item level of Sales  order with the name coupn, so 2 items in  sales order, 1 is the main item and 2nd the coupon
    1st item we put the price, 2nd item we put the percent discount for coupons, because we dont want to see this coupon discount in first item pricing
    thanks in advance
    Edie

  • Replicate pricing routine in CRM

    Hi all,
    I'm trying to replicate pricing routine from R3 to CRM 5.0 without using IPC.
    Most of the master data and copy control is done already, pricing routine is the only one that I'm having a problem with since we don't use IPC here.
    Have anyone experienced this before?  Appreciate all the help.
    Thanks
    Gilbert

    Gilbert
    1. <a href="http://help.sap.com/saphelp_crm50/helpdata/en/8b/06f837aea75351e10000009b38f8cf/frameset.htm">How Pricing is done in CRM ?</a>
    2. <a href="http://help.sap.com/saphelp_crm50/helpdata/en/f6/6f6d28bf197247918ae66002feec75/frameset.htm">Differences in Pricing in SAP CRM and SAP R/3</a>
    3. Pricing in crm
    Happy Working !
    Thanks
    <b>Allot pointzs if this helps!</b>

  • Multiple calls of same pricing routine while saving sale order

    Hi,
    I have a requirement where I have to modify a pricing routine 9XX for sale order. In pricing procedure, I observed that this routine 9XX is assigned to multiple pricing conditions (ZNN, ZMM, ZDD etc). I saw that this routine is getting called many times in debugging for each of these assigned pricing conditions. May I know on what basis this pricing routine gets triggered multiple times for the corresponding pricing condition?
    Thanks in advance.
    Regards,
    Sri

    Sri,
    For everychange at ITEM level,Pricing mechanism will be repeated.
    You can check in debugging as below
    1.FM Pricing.
    2.Subroutine perform xkomv_aufbauen_aus_komt1.
    3.Check for the below code
      * L O O P Pricing Procedure
        loop at komt1 from komk-ix_komt1_v to komk-ix_komt1_b.
    4.Within this loop you will find a subroutine
       perform (bedingung_pruefen) in program saplv61a if found.
    Put a break point on this LOOP and check what is happening at the desired condition type while it is running through all the condition types of that Pricing Procedure.
    K.Kiran.

  • REFERENCE DOCUMENT TYPE IN PRICING ROUTINE

    HI ABAP GURUS,
    i am modifying pricing routine.
    i need to get reference docuemnt type for validation purpose . how do i get it..
    Thanks,
    Neo

    Hi
    check the KOMK-VBTYP field , which is document type of the document
    First see what are the structures available there in that routine
    like KOMP,KOMK like that structures
    double click them and see the different fields in those strutures
    I am sure you will find it.
    Regards
    Anji

  • VOFM pricing routine

    I have a requirement where I need to check pricing condition for BOM material.The requirement is that,if the material is a BOM in a sales order,then the pricing routine should trigger for its sub material. The problem we are facing is that the pricing routine is not getting triggered for the sub material. If anybody have worked on such requirement ,please give some input.I want the pricing routine to be triggered for the submaterial.

    Hi ,
          Whatever logic u write in ur routine .The final value which will go out from the routine is xkwert which is condition value .so in ur logic you will have to populate a value to the field xkwert .

  • I have an issue with pricing condition ZPRO (basic price )

    Hello gurus
    I have an issue with pricing condition ZPRO (basic price ).
    users created a sales order, and the basic price ZPRO which is mannual is added twice ,now i want to put a check so that condition tpye zpro is not accepted twice by the system. please let me know how can i restrict  system from accepting condition type zpro  twice during sales order.
    regds
    Edited by: sapuser09 on Jul 26, 2011 8:44 AM

    Hi,
    Solution for this is very simple. Don't make any changes to the sales order user exit. Use condition exclusion  for the condition type.
    Do customization in the following path of IMG
    Sales and distribution---- > Basic Functions--- > Pricing--
    > Condition exclusion -- > Condition exclusion for groups of conditions
    First  In Define condition exclusion groups you have to define condition exclusion group (ZXXX)
    Then  in Assign condition types to the exclusion groups you have to assign condition type to the exclusion group (ZXXX   ZPRO)
    Then in Maintain Condition exclusion for pricing procedures select the pricing procedure where you have the problem and click Exclusion box present in Dialog structure box
    You will be faced with Change view exclusion overview screen Click new entries
    You will be faced with New entries overview of added entries screen.
    Take serial no as 10 Condition exclusion procedure  as B (Best condition with in condition type) In the exclusion group1 add the exclusion group ZXXX.
    Save it and create order.
    In the order pricing you will again observe that ZPRO appearing twice but only one will be active.
    Changing user exit for this issue is not at all required and it must be only the last resort Try replicating the issue in your sand box system. As I had mentioned it will be picked twice but only one will be active.
    Hope this helps.
    Edited by: mokirala tilak on Aug 10, 2011 10:19 AM

Maybe you are looking for

  • Assigning a new value to Float objects

    Hi, With BigDecimals, you can assign a value without explicitly creating a new object like this: BigDecimal b = new BigDecimal(5.23f); b = BigDecimal.valueOf(625, 2); As far as I can see, the only ways of doing this with Float is: Float f = new Float

  • Print and Softproof colors are bad for "Application managed color"

    Hello... Not sure if my problem is a Mac OS X issue, or a Lightroom issue. Either way I hope it is just user error. While printing, my prints look good using "printer managed color", both preview and printed output look good. I am used to using "appl

  • Webutil problems

    I follow the steps in the manual to configuring webutil to application server and deploying a form, but i´m having a problem when i run the form gives this following error oracle.forms.webutil.clientinfo bean not found . I having a problem generating

  • OLE Excel file upload method

    hi we have the requirement to download data in excel file in unicode format for which the OLE FM EXCEL_OLE_STANDARD_DAT in used for the download. We now want to upload the same file after modification. GUI_DOWNLOAD uplaods the file wsith gibberish ch

  • SRM HTML Template Creation

    Hi, I created one interface program.  I want to creat the HTML templet for that progame to visible the <b>SRM Web page</b>(front-end). Can any one please help me out how to crate the HTML templet for the Report progame. Thanks and Regards, Senthil