New pricing routine

Hi guys,
   I am new with all this IPC stuff and I was wondering if you could help me with some questions.
I need to implement the following code:
   if XKOMV-KSCHL != ZPCO
     get the value from condition VPRS
   else
     value from condition XKOMV-KWERT
my questions are:
  1. What method-object can I use to point condition ZPCO for my item to get its value??
  2. Is there any standard to ge the value from VPRS?
Your help is highly appreciated as I do not see the exit of this problem!!
Thanks
Alicia

Hi Alicia
If you have access to the IPC directory on the files system, there is great API documentation available.
For the XKOMV structure, you can use the following java interface to access the various fields.
\ipc\doc\spe\apidocs\com\sap\spe\pricing\transactiondata\application\IPricingConditionUserExit.html
I think you use the method getConditionTypeName() to pull the XKOMV-KSCHL.
And you can use getConditionValue() to pull the XKOMV-KWERT as well as VPRS
Finally, to set the value when you are finished, you will simply do a "return <your value/variable>;"
Hope this helps!
Regards,
Ajay S Gupta

Similar Messages

  • MM PO - New Pricing Routine / user exit / at Line item

    Hi
    When ever a line item data gets chnaged, we need to do the Update Pricing / New pricing Automatically.
    Currently we are doing this manually and would prefer to automate -
    request for possible suggestions / solutions OSS notes for this functionality.
    cheers
    Nandu

    Hi
    Look at using BADI ME_DEFINE_CALCTYPE  to select the pricing type B (carry out new pricing) whenever you make a change to PO item.
    You need to go through the documentation of this BADI before you use it to make the correct program changes.
    Hope this helps.
    PP

  • 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

    Hi all,
    I have created new pricing user routines. I am trying to create the JAVA code by myself, so can anyone helps me letting me know how the following code would be in Java?:
    Data: va_value type type komp-wavwr,
             wa-xkomv like xkomv.
             if sy-subrc = 0.
                clear wa_xkomv.
                read table xkomv into wa_xkomv with key KSCHL = 'ZPCO'
                if wa_xkomv-KBETR = 0.
                  clear wa_xkomv.
                  read table xkomv into wa_xkomv with key KSCHL = 'VPRS'.
                  wa_value= wa_xkomv-kwert.
               else.
               wa_value = wa_xkomv-kwert.
               endif.
            endif.
            xkwert= komp-kzwi3-va-va_import.
    Should I use jave methods to get that information for the tables or a connection to the database and a select?
    Thanks,

    Hi Max:
       Thanks very much for your quick response.
       Following your instrucctions, we understand that we can use getConditionTypeName()to check as follows:
       prCondition.getConditionTypeName() == "ZPCO"
       But we I'm not sure how I could check the followinf sentence: if wa_xkomv-KBETR = 0.
       Thanks in advance.
    Abel

  • 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

  • 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

  • To write new pricing type at the copy control

    None of the pricing types meet my need at the copy control (from the delivery to the billing document at item level). At which transaction code can I write a new pricing type? I couldn't find it at VOFM (maybe because I couldn't see).
    Thanks in advance for the answers...

    In VOFM, from top menu bar, if you click "Copying requirements", you can see various selection options like Sale Order, Delivery, Billing etc.  You need to select Billing and create a new routine there.
    thanks
    G. Lakshmipathi

  • How to: not to carry new pricing when plant is change

    Hi,
    How can I prevent the system from carrying out new pricing when the plant is changed.
    Also,
    I have a quotation in which users can change the prices, I want to finalize the pricing in the quotation and have my sales order with fixed pricing. What is the best way to do this.
    Thanks.

    Hi,
    Try this user exit.
    Include: MV45AFZB
    USEREXIT_NEW_PRICING_VBAP
    This userexit can be used to perform new pricing, dependant   *
          on the change of datafields.                                  *
          This routine is not called, when the material number has been *
          changed.                                                      *
          Available data-fields:                                        *
            vbak - header data                                          *
            vbap - item data     (changed)                              *
            *vbap - item data (old, before the change)                  *
          Parameter new_pricing controls the new pricing in the calling *
          form. It can be filled according the the allowed values       *
          of domain KNPRS (Pricing type), for example:                  *
          ' ' = no new pricing                                          *
          B   = Carry out new pricing                                   *
          C   = Copy manual pricing elements and redetermine the others
    It should work for you.
    Reward points if it works for you.
    Rajesh S.

  • What is pricing routine?

    hi all
        what is pricing routine for currency conversion and why that concept is used.im new to it .please can anyone explain..i read thro many docs but it gave a vague explanation.
    regards
    asha

    Hi Asha,
      Routines are small ABAP code which is assigned in the pricing procedure, this carries out additional check before processing/updating the document.
    If the document currency and local currency are different, SAP has provided standard function module for currency conversion, "CONVERT_TO_LOCAL_CURRENCY". Based on your requirement you can use this FM to achieve at the correct price in local currency.
    Hope this helps.
    Regards
    Raj

  • Creating a Invoice with reference to another invoice with new pricing proce

    Hi People,
    I want to raise a supplimentary excise invoice for the differential price.
    I want to do it by raising a supplimentary commercial invoice with reference to the old invoice but with a new pricing procedure assigned to it.later on raise the supplimentary excise invoice with Tcode j1iin wrt the new commercial invoice.
    Although i have done all the necessary configurations such as determination of new pricing procedure, Doc pricing Procedure and changing the pricing type at the copy control settings of the item category to "B".
    i am unable to get the new pricing procedure when i am creating the supplimentary commercial invoice.
    Can u people suggest me in this regard

    Dear Nagabhushan
    Normally for price difference, there is an order type RK for "Invoice Correction Request" which should be created in reference to F2 billing document.  Based on this, you can issue credit memo (document type G2). 
    This being the case, you cannot create supplimentary invoice with reference to original invoice.  Moreover, for all excise related adjustments, you should not use j1iin.  You should run j1ih - Other adj.
    thanks
    G. Lakshmipathi

  • On Macbook Pro 13" Retina new pricing

    Hey guys...
    This can might as well be a far cry, but I will ask it anyway. With the new pricing of several Macbooks as announced by Apple last week, does anyone here know of any plans or incentives Apple gives to those who bought the rMBP13 when it was on its original price ($1699)? I bought my unit here in the Philippines at PhP82,990. It is just now at PhP69,990. The price difference (> PhP10,000) is just too huge to overlook. I just feel cheated...or should I say I just feel like a fool getting a unit on the month (November) it was released here. Note that the 256-GB model is now just at PhP79,990 which is still lower than the price of my 128-GB unit.
    Thanks,
    mervz05
    Manila, Philippines, Macbook Pro 13" with Retina Display (late 2012), 128GB, 8MB RAM, 2.7 GHz Intel Core i5

    You obviously felt the MacBook was worth the money in November, why would you feel cheated?

  • Error while processing sales order as new pricing carried out.

    "new pricing procedure carried out".iam getting this error while processing the sales order.

    Hi Gopal,
    This message will come generally when we changed the fright relevant data or any other data system will display this message.
    Ram

  • Creation of a new pricing procedure by copying existing one (for sale order

    Hi,
    Existing pricing procures are here below:
    1000     10     00     1     1     ZBRI01     Pricing Proc_Under Con                            1000     10     00     1     2     ZBRI02     Pricing upgradationFlat                           
    Now I need to create a new pricing procedure for the following combination :
    1000     10                 00                 1                     3                   ZBR103        Pricing_single sale
    Please let me know the steps to follow.
    With regards,
    Parijatha

    Dear JP,
    Based on your last direction,  I created a pricing procedure.  It is hitting the right GL and everything looks ok.  My problem is " ZCAR (car park value which is a  ZFREE item  should get added to the "Net value"  which is not happening.    Control data -reference step overview is herebelow.   From step 50 to 300 all are ticked for Statistics.
    50     0     ZBAV     Base Value for Calc     0     0               0     0     0
    110     0     ZTCO     Apartment Value     0     0               0     0     0
    115     0     ZDSQ     Discount on ApT     0     0               0     0     0
    120     0     ZDVA     Discount on ApT_Lump     0     0               0     0     0
    150     0     ZTGR     Terrace/garden Stat     0     0               0     0     0
    160     0     ZDTG     Discount on Terrace     0     0               0     0     0
    210     0     ZCAR     Car Park (booking)     0     0               0     0     0
    250     0          Total Consideration     110     210               0     0     0
    270     0     ZGOV     Govt Rate_Reg     0     0               0     0     164
    300     0          Upgradation Value - Billing     250     270               0     0     0
    310     0     ZBLD     Building - For Bill     270     0               0     0     164     ZBB
    320     0     ZSDT     Reg and Stamp Duty     0     0               0     0     0     ZSD
    330     0     ZSDA     Stamp duty-Agr-Sell     0     0               0     0     0     ZSA
    340     0     ZECH     Power Consump. Chgs     0     0               0     0     0     ZEC
    350     0     ZLFE     Legal Fees     0     0               0     0     0     ZLF
    360     0     ZPTX     Property Tax     0     0               0     0     0     ZPT
    Can you please help me what should I do to add ZCAR (item category is ZFREE) value to  Net value.
    With regards,
    Parijatha

  • Do not carry out new pricing when plant change in sales order

    Hi,
    I have one z field in additional data tab in sales order. This field store the original plant if anyone has changed plant in Sales order. My requirement is to trigger the pricing in sales order with this old plant. I am not getting any exit for this.
    Suggest me the solution.

    Hi
    In the comments for the subroutine, it says:
    *       Parameter new_pricing controls the new pricing in the calling *
    *       form. It can be filled according the the allowed values       *
    *       of domain KNPRS (Pricing type), for example:                  *
    *       ' ' = no new pricing                                          *
    *       B   = Carry out new pricing                                   *
    *       C   = Copy manual pricing elements and redetermine the others
    So, you must write:
    If VBAP_WERKS NE *VBAP_WERKS.
      new_pricing = 'B'.
    Endif.
    Regards
    Eduardo
    Edited by: E_Hinojosa on Aug 25, 2011 8:21 AM

Maybe you are looking for

  • Working on 2 Posting Periods at a time

    Hi, Is it possible to work on different posting periods at a time.My client closes his month in 10th of every month but the posting date will be in previous month In this case he wants to work on existing month as well as previous month. i have set t

  • How to handle multiple / dual MRP in RMS , RPM ?

    hi all , can some one share how to handle dual MRPs in RPM & RMS. regards, deepak

  • Dynamic creation of column in database table

    Can I create columns in a database table dynamically? Let's say I have two columns in a table. Users requested to have dynamic columns in the table. They wanted to create any no. of fields in the table dynamically. We can't alter the table every now

  • QM QASE table

    Hi ALL, I am working in SAP ECC 6.0. I want to know the settings by which QASE table is updated? Regards, Santosh

  • Splitting Long Footnotes

    Does anyone know how to divide up long footnotes so that they run over two pages? My thesis has several very long footnotes and Pages puts the entire footnote at the bottom of the relevant page (which is fine and good most of the time). But if the fo