Pricing condition formula on IPC

Hi,
Here's the issue -
The freight for items is calculated using scale based rates for gross weight of the items.
For example, if the gross wt. for an item is 38 pounds, the rate is determined as $18 from the scale. However, if the quantity is increased to 2, a rate of say, $30 is taken from the scale corresponding to the gross wt. which is now 76 pounds.
However, the requirement is that the rate of $18 should be chosen and multiplied by the quantity for all quantities greater than 1. So the freight should have been $36 (18 x 2) instead.
The freight is calculated using a pricing formula in R/3 where the gross wt. is first divided by the quantity to get the base condition. Scale based rates are taken to calculate the freight condition value and multiplied by the quantity again.
AltCTy
  modify xkomv.
  read table xkomv with key kschl = 'ZABC'.
  xkomv-kwert = xkomv-kbetr * komp-mgame.
  modify xkomv.
  xkwert = xkomv-kwert / 1000.
AltCBV
  if komp-mgame ne space.
    komp-brgew = komp-ntgew.
    xkwert = ( komp-brgew / komp-mgame ) * 1000.
    komp-brgew = ( komp-brgew / komp-mgame ) * 1000.
  else.
    komp-brgew = komp-ntgew.
    xkwert = ( komp-brgew / komp-mglme ) * 1000.
    komp-brgew = ( komp-brgew / komp-mglme ) * 1000.
  endif.
The problem arises while implementing this formula in IPC. Unlike on the R/3 side, it is not possible to change the gross wt. of an item in IPC. Also, I couldn't find a way to explicitly specify the gross wt. to calculate the condition.
The other option was to implement a BADI to change the gross wt. of the items before calculating the conditions. I tried using the CRM_PRODUCT_I_BADI where it is possible to change the gross wt. when an item is entered, however, the quantity for the line item is not available in this BADI so as to divide it to get the appropriate gross wt. for an item.
Any help would be greatly appreciated.

Hello,
If this badi is executed inside order creation you can try call function CRM_ORDER_READ to get the item quantity.
It might work if the item data is updated before this badi is called.
Instead of pass the header like in the example below, pass the item guid to the function.
INSERT gc_object_name-orderadm_i INTO TABLE lt_requested_objects.
  INSERT gc_object_name-schedlin INTO TABLE lt_requested_objects.
  CALL FUNCTION 'CRM_ORDER_READ'
    EXPORTING
      it_header_guid       = lt_header_guid
      iv_mode              = gc_mode-display
      it_requested_objects = lt_requested_objects
    IMPORTING
      et_orderadm_i        = lt_orderadm_i
      et_schedlin          = lt_schedlin
    EXCEPTIONS
      document_not_found   = 1
      error_occurred       = 2
      document_locked      = 3
      no_change_authority  = 4
      no_display_authority = 5
      no_change_allowed    = 6
      OTHERS               = 7.
  IF sy-subrc <> 0.
    MOVE sy-msgty TO ev_type.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO ev_message.
    EXIT.
  ENDIF.
  LOOP AT lt_orderadm_i INTO ls_orderadm_i.
    MOVE ls_orderadm_i-number_int TO itens_vlr-numitem.
    MOVE ls_orderadm_i-ordered_prod TO itens_vlr-produto.
    MOVE ls_orderadm_i-description TO itens_vlr-descricao.
    READ TABLE lt_schedlin INTO ls_schedlin
        WITH KEY item_guid = ls_orderadm_i-guid.
    IF sy-subrc = 0.
      MOVE ls_schedlin-quantity TO itens_vlr-qtdprod.
    ENDIF.
    APPEND itens_vlr.
  ENDLOOP.
Regards,
Mauricio

Similar Messages

  • ABAP code in to JAVA for overwritting condition value for IPC pricing

    Dear experts i am an IPC JAVA developer and i am trying to translate an ABAP Routine in to JAVA code for overwriting condition value in the pricing user exit of IPC
    Here is the ABAPcode segment i am trying to transulate
      DATA: l_kdkg1  LIKE komk-kdkg1,
            l_work TYPE f,
            l_umren LIKE marm-umren,
            l_umrez LIKE marm-umrez.
      SELECT SINGLE peinh FROM mbew INTO mbew-peinh         
      WHERE matnr = komp-matnr
      AND bwkey = komp-werks.
      I need some  help in the following things
      1. I don't know how to transulate the following Line of ABAP code into JAVA
         " AND bwkey = komp-werks."
    Bwkey stands for plant details. I don't know how to get plant details from  Pricing Item.
      2. Someone please tell me weather the following JAVA transulation is correct
      Vector x = prItem.getUserExitConditions();
      db database = pricingEngine.getDatabase();
         // set table name
      String tableStart = "mbew";                                             
         // set query parameters
      sys_query_pair[] queryPair = null;
      //matnr = komp-matnr . Getting the material Number
      String materialNo= prItem.getProduct().toString();
      //bwkey = komp-werks.Getting plant.
      // TODO: werks stands for plant. Not sure how to get it from prItem
       String plant = "";
       queryPair = new sys_query_pair[2];                    
       queryPair[0] = new sys_query_pair("matnr", materialNo);
       queryPair[1] = new sys_query_pair("bwkey", plant);
      // set query columns
       String ZZFIELDStart = "peinh";
       String ZZFIELD_VALUEStart;                   
       String[] projectionStart;
       projectionStart = new String[];
       BigDecimal pricingUnit = null;
       try{     
          // execute query
          res resultSetStart = database.db_read_table(tableStart, queryPair,projectionStart) ;
          if (!res.db_empty_results_p(resultSetStart))
         ZZFIELD_VALUEStart = resultSetStart.db_get_row_element_string(0);
         pricingUnit = new BigDecimal(ZZFIELD_VALUEStart);
         resultSetStart.db_finish();
       else
         System.out.println("Coudn't find a value of field peinh in table mbew!");
       catch (exc_database_error e)
         e.printStackTrace();

    Please login to the server where IPC is installed. In the IPC folder u find libs folder  or search for docs in IPC folder. There it is dealt how ABAP routines are mapped to  user exits in java coding
    Thanks
    Surya

  • Pricing condition replicate on to IPC.

    We are using ECOM 5.0 with ECC 6.0
    Is there a standard program or FM for replicating any changes to pricing condition in ECC on to IPC?
    Whenever there is a change in config, we use standard program which would replicate the KB changes on to IPC.
    Similarly, do we have any thing for pricing changes?

    hi,
    After any change in the pricing condition do a VMC reset and/or ipc buffer  deletion.
    This will reflect the change to the ipc immediately.
    Otherwise changes will update to IPC as per the settings in VMC may be once in 12 hrs like that.
    To clear ipc buffer use the FM IPC_DET_CLEAR_CUST_BUFFER
    Thanks and Regards
    shanto aloor

  • Is there a  BAPI to create IS-Oil (formula) MM Pricing condition records

    Hi,
    Is there a standard BAPI to create IS-Oil (formula) MM Pricing condition records, which would include the maintaining of the formula?
    Regards
    Kasi

    no BAPI exists

  • BAPI  to create IS-Oil (formula) MM Pricing condition records

    Hi,
    Is there a standard BAPI  to create IS-Oil (formula) MM Pricing condition records, which would include the maintaining of the formula?
    Regards
    Kasi

    no BAPI exists

  • ECC Pricing Conditions to IPC

    Hi,
    Could someone please explain how IPC acquires the pricing conditions from ECC?
    What I'm currently experiencing is that when I create a new pricing condition in ECC and a condition record for a certain material and customer, I'm unable to view those changes in the IPC through ISA. Though, I am able to see the new pricing condition when I create a Sales Order of that material and for the same customer the ISA uses.
    Thanks,
    AYeung

    hi, the condition need to transfer to CRM, then IPC will fetch them from CRM condition record.
    The steps like this:
    1.you need to upload the ECC pricing configure, include condition table,  access sequence condtion type by middleware, check the sap menu - middleware - customizing object synchronize
    2.you need to upload the ECC condition record by a delta mode by middleware,  check the menu - middlware - delta upload
    then when you create or update condition record in ECC, it will bring to CRM automatically,  the ISA and read the condition in the CRM relative table.

  • CRM Pricing - BADI to Populate pricing conditions fields

    Hello All,
    We have CRM 5.0 installed in our customer.
    We are facing problems when we tried to replicate the pricing  from R/3.
    Basically, all Brazilian formulas we have in R/3 are Z. We tried to replicate them in JAVA (IPC) with no success. At this time, it is imposible for us to move to the standard because of the decision of the business.
    We are trying to find one BADI where we can populate all the pricing conditions retrieved via RFC from R/3. Unfortunatelly we don't have good luck with this.
    Our idea is to use this BADI to call R/3 and retrieve the conditions needed, and then populate the CRM pricing fields..
    Could you please help us? Do you have any other idea to solve this issue?
    This is very critical for us.
    Thanks in advance.
    Martin

    Hi Ntk,
    Thanks for your reply.
    I tried to search in se18. I found one BADI that runs when users enter new materials or changes the quantity of the sales order.
    This one  does not help us too much, because when you go to conditions tab (into CRMD_ORDER or via ICWEB) all conditions are redetermined with the pricing determined in IPC.
    We want to fill the conditions of the sales orders or the sales quotations at running time. In the BADI we would use the function module RFC SD_SALESDOCUMENT_CREATE (in simulation mode) in R/3 and retrieve all conditions fields and then populate the pricing conditions in CRM.
    Do you know any BADI with this behaviour? Or another similar?
    THANKS!

  • Pricing Condition in scheduling agreement

    Hi Gurus,
    I'm working with scheduling agreements and I figured that whenever I create scheduling agreements, pricing condition PB00 gets defaulted to the scheduling agreement,
    Can you guys be kind enough to tell me what configuration is driving this?? How can we make changes to the config settings so that I can have a condition type of my choice assinged to the scheduling agreenment??
    More over I have a requirement to have a tiered pricing in scheduling agreement. I do know that this is driven by SCALES in SAP however as per my requirements I need to have SCALES per formulas. In the condition type configuration we do have a field for SCALES where we can assign the formulas but whenever I click on this field a screen pops up with some ROUTINES.
    Can someone tell me how can I define the ROUTINES and the ABAP formula for this ROUTINE so that I can have my tiered pricing conditions accomplished??
    Any feedback on this will be highly appreciated!!
    Thanks folks,
    Dhaval Joshi

    Hi Ramesh,
    Thanks for the heads up. I looked at the config for the schema dtermination and I see that the pricing procedure RM0002 has not been assinged to any vendor POrg schema in this configuration.
    I then looked at the config for the condition type PB00 --> pricing procedure RM0002 has been assigned to the condition type PB00 and since we don't have any entries maintained for RM0002 in the schema determination config I was just wondering if this is what is influencing the automatic proposal of the condition type PB00 in my scheduling agreement.
    Also can you please tell me what is a difference between a Purchasing Document (BIG) and Purchasing Document (Small) in the schema determination config.
    All I wanted to accomlish here is my teired pricing to work when I assign scales on the condition type in the scheduling agreement ( not in the PIR)
    What currently happening in my case is ....
    Example: Scale From 1 pc - 100.00 USD
    from 50 pc - 90.00 USD
    from 100 pc - 80.00 USD
    Target quant. 100 pc
    schedule lines 30 pc
    20 pc
    The problem is  that the goods receipt of 30 pc is valuated at the price 80.00 USD It always takes a lowest price on the scale.
    I've tried looking for OSS notes and also looked enough on the forums but I could not get any resolution to this question.
    I would appreciate if I could get any heads up from your side.
    Cheers,
    Dhaval

  • 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

  • How to change pricing conditions

    Hello Experts,
    i'm trying to change pricing conditions in routines.
    SPRO --> SD --> System Modifications --> Routines --> Define Copying Requirements (double click any activities) -->  it will open "Maintain Requirement and Formula"
    select from menubar "Formulas --> Condition Value"
    Routine Number --> 36 - Cumulation condition.
    i want to change conditions in this Routine 36, so i copy this routine and create a new routine name
    901 - Cumulation condition
    i want to change Pricing Conditions in this routines. this standard routine adding all sub-total pricing values. but i want to display all sub-total pricing value separately in there respective field.
    i'm checking this result in VA11.
    any ideas? i know i have to change code in this copied rotines for this calculations. but i'm not finding any clue where this value is getting added in each sub-total field level.
    if any more clarification needed, please ask.

    Hi Rabindra
    For Net Price you can refer this Note 80183.
    Neha

  • Duplicate pricing conditions due to contract supplements

    Hi all,
    <br><br>
    We want our pricing conditions to appear automatically on a normal purchase order and on a purchase order with reference to contract, but they should only be on the purchase order once. We're experiencing difficulties since the condition is fetched and displayed twice (once coming from the condition supplement via the contract and a second time via the standard purchasing procedure).
    <br><br>
    Let me sketch the scenario.
    <br><br>
    We have two procedures used for purchasing:<br>
    - procedure ZM0000 as standard purchasing procedure<br>
    - procedure ZM000S as contract supplements procedure
    <br><br>
    Both procedures contain conditions ZA00, ZR01, ZR02, ZR03, ZR04, ZR05 and these conditions are not indicated as a manual condition.
    <br><br>
    For condition type ZA00 the pricing procedure ZM000S is defined so that condition supplements can be added in the purhcase contract. There is also an Access Sequence for this condition to prevent it from appearing twice on a purchase order with reference to a purchase contract.
    <br><br>
    When we create a normal purchase order, we get all conditions from the ZM0000 procedure without any problem.
    But when we create a purchase order with reference to a contract with condition ZA00 and condition supplements ZR01, ZR02, ZR03, ZR04, ZR05; then we see these ZRxx condition appearing twice instead of once.<br>
    It's displayed once coming from the ZM0000 procedure and a second time due to the ZM000S procedure.
    <br><br>
    I've had a look at the standard procedures, at sap notes and searched on the forums and can't find a feasible solution for this.
    <br><br>
    One way it is commonly solved is to make the ZRxx conditions a manual condition but that means the user will have to add these conditions manually to the purchase order. When we're talking about 50 or more conditions then it becomes a cumbersome to add all these conditions (if required) manually one by one for each purchase order that the user creates --> not feasible.
    <br><br>
    I guess another solution would be to create an access sequence for all ZRxx conditions based on purchase order type and then create condition records for all ZRxx conditions for the purchase documents without reference to a contract. That way the condition will be displayed once (from the condition record) on a normal purchase order and once (from the contract, since the condition record can't be found) in case of a purchase order with reference to a contract. When we're talking about 50 or more conditions and more then 2 document types, then maintaining all these condition records is quite some task --> not really feasible, not the prefered solution.
    <br><br>
    As an alternative to SAP standard we've found the following enhancement point in LV61AA11 where we could possibly delete the "duplicate" condition from KONV if the condition origin (KONV-KHERK) is not equal to "Condition supplement" (F) in case of purchase document type that references to a contract... but this is not the prefered solution.
    <br><br>
    <span style="font-family: Lucida Console">-----<br>
    get pricing result from database table<br>
    ENHANCEMENT-SECTION     KONV_EINLESEN_02 SPOTS ES_SAPLV61A.<br>
      select * into table hkomv<br>
               from konv<br>
               where knumv = komk-knumv<br>
               order by primary key.<br>
    END-ENHANCEMENT-SECTION.<br>
    </span>
    <br><br>
    Also, it's not a feasible solution to put a requirements formula on all these ZRxx condition because we're talking about more then 50 conditions.
    <br><br>
    Does anyone know a solution to this problem?<br>
    How can we make sure the condition is displayed only once? (be it on the standard purchase document or on the purchase document with reference to the contract)<br>
    Is there a standard approach for this?
    <br><br>
    Thanks in advance for your time.
    Edited by: Kevin Coquel on Apr 15, 2010 3:34 PM

    Bernhard, <br />
    Thank you, but as I mentioned in my starting post, this is not feasible as this is concerning over 50 conditions (some of which already have other requirements formulas). <br />
    Using requirement routine for all is an option we want to avoid at all costs.<br />
    It would mean we need to have edit our existing requirement routines to also include routine 15 (as you can only have one requirement routine per condition in a pricing procedure).<br />
    <br />
    Hardik, <br />
    Thank you for pointing us to EXIT_SAPMM06E_013.<br />
    Preferably we would like to solve this using SAP standard before turning to ABAP development.<br />
    <br />
    I'm a bit surprised not being able to find a SAP standard solution to this problem. Since it's not possible to define a different pricing procedure per purchasing document type I would expect a) there is a way to avoid duplicate conditions (coming from the contract supplements) when you're in a purchase document with reference to a contract and b) that the conditions will appear by default in a normal purchase document (instead of having to add them manually one by one when you use "Manual" in the pricing procedure).

  • Pricing : Condition type value need tog get from the lowest of 4 other cond

    Hi,
    I have one requirement in one pricing procedure.
    I need to calculate condition value of one condition type from the lowest value of other 4 condition tyeps. These condition types values are not defined as a subtotal.
    So if I decide to write a formula on condition values, is there
    any way to select these values and choose the lowest of them?
    Please also advice if there is any other way such as condition exclusion
    or so?
    Thanks and regards,
    Anand

    Anand,
    As you have mentioned you can use condition exclusion for such a requirement.
    here is a detailed description of how you can achieve this: use the menu path IMG> Sales & Distribution> Basic Functions> Pricing> Condition Exclusion> Condition exclusion for group of conditions.
    When you execute this IMG acitivity you get a window with three options
    1.Define Condition Exclusion Groups
    2.Assign condition types to the exclusion groups
    3.Maintain condition exclusion for pricing procedures
    We will use these three options one by one, we start with the first
    1. Define an exclusion group, lets say EX01 and give a description
    2 Assign the four condition types that you want to compare to this exclusion group under this option
       lets say EX01 ZK01
                   EX01 ZK02
                   EX01 ZK03
                   EX01 Zk04
    3. under this third step, select the pricing procedure that you are working on and from the left margin click on 'Exclusion'. click on 'New Entries' and make the following entries (example)
             Sno.   Cpr         ExGr1
              10      A            EX01                leave ExGr2 blank, Save your entries
    Check if your purpose has been met or not. Do give your feedback
    Regards,
    PATHIK

  • Pricing condition basis

    Hi Pricing experts,
    I want to use a pricing condition as a basis for other condition value calculation as below.
    Condition 1: Number of weeks (condition basis)
    Condition 2: Weekly pay (amount)
    Condition 3: Weekly pay x number of week (condition 1 x condition 2) (Value)
    How can we set this up in pricing procedure? Do we need to create three conditions? which formula to be assigned to condition 1 and 3?
    Thanks
    Umesh

    Simplest way to do this is store those condition values in different table and use a formula to multiply them. Assign this formula to third condition.
    Regards
    Umesh

  • Receive "The page cannot be displayed" for Pricing Conditions

    To all,
    I receive the message "The page cannot be displayed" for Pricing Conditions when I select the "Accesses" button.  I then received the message "HTML field saved to C:\temp\CRM_IPC.html". 
    This only seems to happen when using the pricing in the service order confirmation.

    Hi Bob,
    R u using IPC for pricing, if yes just check the connections to the IPC server.
    The error is because of the IPC connection not getting established.
    <b>Please reward points if it helps.</b>
    Regards,
    Amit Mishra

  • Pricing conditions in extended classic scenario

    Hello friends,
    I have a question about pricing conditions. There is a condition in R/3 where the price can be redetermined based on the G/R date. Is it to do something similiar in SRM. I mean redetermine the price at the time of confirmation.
    Thanks any help will be appreciated.

    Hello Chakradhar,
    IPC is required for extended classic scenario. Reach out to your basis practitioner, he should be able to perform this.
    Helpful links
    Re: IPC Configuration in Functional perspective.
    Re: IPC Configuration
    Hope this helps.
    Thanks
    Ashutosh

Maybe you are looking for

  • Error During Release to Accounting In VF02

    Hi, We are getting an error during <b>Release to Accounting</b> while doing Billing in VF01. We are getting the following error message while creating the Commercial Accounting Document. <b>Cause</b> No account was specified for account type ‘S’ in i

  • Which is better, a G4-450 Dual or a Mac Mini 1.42?

    which is better in terms of Sequencing and plug in performace, the G4-450 Dual or a Mac Mini 1.42?

  • How to call Link in Rejection mail

    Hi Experts, When a Approver rejects a Shopping Cart, i am sending an email.In that email i wnat to send a link using which the user can login and directly open the shopping cart in change mode. How do i create that Link or how do i call a transaction

  • Parent/Child "itemkey"

    I have a parent/child relatonship between 2 tables. Both tables have dataless keys (both just populated by different sequence numbers starting at 1). I want to create Parent and Child processes (in the same workflow itemtype) to represent the records

  • Problem in JOptionPane

    Hi, Here's my problem, I'm making a dialog box with a JOptionPane and I'm using a OK_CANCEL_OPTION and the method showOptionDialog(...). When I click on the Cancel button, the value returned is 1 but the constant JOptionPane.CANCEL_OPTION=2. I have t