Creation of a new Formula Routine for condition base value calculation

hello people,
i am stuck up in a situation where SAP has itself said that nothing can be done.
but i know you all can guide me to some way or the other
see, the scenario is like this
1. i have to calculate the base value for a pricing condition.
which will follow the formula
net value + excise duty + freight
2. in standard routines two things are normally bieng used
xkwert for the value that has to be finally calculated(taking reference of routine 004)
komp-netwr for the net value
3. i have to calculate the excise duty by adding up all the base values of existing pricing conditions like JMOP, JEC1 etc that i have which i saw in internal table
XKOMV on debugging
4. now freight is to be calculated from all the values of condition types that are in KOMP which is a structure and no internal table is defined in standard main program
now ppl
can you guide me by looking at the standard program
what is this xkwert field and where it is assigning the value.
how to get field from other structure and table.
please guide as to how to approach the problem.
thanks and regards
Nitin

HI,
the scenario u r talking abt is condition based value formuls of VOFM transaction.
here the data is retrieved as 'X' structures and will hold normal tables with respective names. and in this case all the pricing data is in KOMV ie XKOMV
Final amount including tax
form frm_kond_basis_004.
  xkwert = komp-netwr + komp-mwsbp.
endform.
always calulation is done in xkwert field and final value is stoerd in xkomv.
*.................. text ............................................. *
Condition base value formula to get the assessable value of the     *
saleable material from j_1iassval. If the value is not maintained   *
then the selling price will be taken as the base                    *
TABLES: J_1IASSVAL.
DATA XXKOMV LIKE KOMV .
XXKOMV = XKOMV.
SELECT SINGLE * FROM J_1IASSVAL WHERE J_1IWERKS = KOMP-WERKS AND
                                     J_1IMATNR = KOMP-MATNR.
IF SY-SUBRC EQ 0.
    IF J_1IASSVAL-J_1IVALNDP NE 0.
    XKWERT = J_1IASSVAL-J_1IVALNDP * KOMP-MGLME / 1000.
    ENDIF.
    IF J_1IASSVAL-J_1IVALASS NE 0.
    XKWERT = J_1IASSVAL-J_1IVALASS * KOMP-MGLME / 1000.
    ENDIF.
ELSE.
   XKWERT = XXKOMV-KAWRT .
ENDIF .
XKOMV = XXKOMV .
ENDFORM.
and as far as ur  req select allthe condition type data and sum and take the average value and pass it.

Similar Messages

  • MM Routines for Condition Base Value

    Dear friends,
    I want pass values from Tax Procedure to MM pricing procedure. Here the requirement is to calculate discount after considering the excise. The excise value resides in Tax Procedure(TAXINN) and the discount value is in MM Pricing Procedure(ZLOCAL).
    Even if i pass the value through subtoal KZWI6 the value gets cleared while moving to another procedure.
    Kindly suggest.
    Regards,
    Praveen Lobo

    Dear friends,
    I want pass values from Tax Procedure to MM pricing procedure. Here the requirement is to calculate discount after considering the excise. The excise value resides in Tax Procedure(TAXINN) and the discount value is in MM Pricing Procedure(ZLOCAL).
    Kindly suggest.
    Regards,
    Praveen Lobo

  • Alternative formula for condition base value -correct  routine

    Hi ,
    We need  correct standard routine number in "Alt. formula  for condition base value " in transaction V/08 pricing control .
    Requirement As follow :
    We have one header freight condition which is header condition and group condition in V/06 condition type setting . Lets Say " ZFRIG " the value in this condition should equally approtionate to all the items in SO .
    Ex: ZFRIG = $100 in SO header
    item 10 = ZFRIG should be  $20
    item 20 = ZFRIG should be  $20
    item 30 = ZFRIG should be  $20
    item 40 = ZFRIG should be  $20
    item 50 = ZFRIG should be  $20
    Suitable standard  routine solution  will be appreciated.
    Thanks in Advance
    Sunil

    Hi ,
    Without any Routine it adds $100 to all the line iteam , so total fright discount becomes $500.
    Thanks and regards.
    Sunil

  • Alternative formula for condition base value in cross-application

    Hi,
    I need inputs regarding an issue as:-
    In "TAXINJ" Tax pricing procedure, for a ZXXX  excise related condition type the alternate condition base value (Alternative formula for condition base value) must be of  YXXX condition type of MM Purchase pricing Procedure.
    How to acheive Alternative formula for condition base value in cross-application area as both condition type belongs to different Application area i.e.  ZXXX belongs to TX and YXXX belongs to M.
    One way or only way is thro' routine but I do not know How it works? 
    Thanking you.
    Prashant

    routine is only the best way for u in this case
    u will have to use subtot may be 6 or 4 in MM pricing procedure
    and write a routien in Tax procedure, i n that u will have to write a code where in ur sustem will featch this value in sub total and act a a base for ur cond type in Tax proc for ue condition type.
    what is your excat requirement
    there might be other work around that can help u around
    hope this works
    or write t routines one in MM and Other in Tax proc for ur issues

  • Used of 362 & 363 Alternative formula for condition base value in Define Procedures (Tcode obyz)

    Dear
             what is the  used of 362 & 363 Alternative formula for condition base value in Define Procedures (Tcode obyz)

    362 is used for to pick base value to BASB condition type from MM pricing procedure
    363 is used for all sales tax {VAT (Inventory or set -off) & CST}.
    Tax Calculation on Freight - Different Scenarios
    Please  go through this  link  and  you will know  very well a bout  362 and  363  usage

  • Differance betwwen alternative calculation type & condition base value.

    dear expert
    wats the differance betwwen alternative calculation type & condition base value in pricing.
    vicky

    Hi,
    AltCty - Condition formula for alternative calculation type:
    It is an alternative formula for the condition type that can be used instead of standard formulas.
    For example, let us take the Profit Margin which can be both + / - , so here this routine will help us in generating the value which can be either + or -. Profit margin is not a condition type so it cannot be classified as +ve or -ve in the V/06.Ex.: 950 0 Profit Margin 11. So we assign 11 - Profit Margin.
    AltCBV - Alternative formula for condition base value:
    Formula for determining the condition basis as an alternative to the standard.
    It is used as a basis to calculate value of the condition type instead of using it from the "FROM" column.
    Ex.: Freight - KF00. Freight is calculated based on weight, volume etc. and not on the base price. In pricing there is no entry of weight from which the value can be referred like we do for discounts using base price. We have to get the value from the Material master. In this column we can mention the value as 12 - Gross Weight or 13 - Net Weight.
    During pricing, the system will consider the value that is mentioned in this column and determine the freight based on this value.
    Suppose we have Net weight: 100 kgs and Gross Weight: 150 kgs. And if we mention 13 in this column then the Freight condition KF00 will be calculated using the weight as 100 kgs.
    And both of them are routines written by APABers in VOFM.
    Reg,
    JJ

  • Alternative calculaton type/ condition base value/requirement

    Hi
    What is the role of alternative calculaton type, condition base value,requirement in pricing procedure.?
    2) Where do we define value for alternative condition base value and alternative calculation type so that system picks up different value,when the value for alternative condition base value and alternative calculation type is mention in pricing procedure.

    Dear,
    *Alternative Calculation Type:*
    This function allows you use a formula as an alternative in finding the value of the condition type, instead of standard condition technique. this can be used to calculate complex tax structures.
    Alternative  condition base value
    The alternative condition base value is a formula assigned to a condition type in order to promote an alternative base value for the calculation of a value.
    Example
    An absolute header discount is, for example, distributed in the standard system according to the cumulative value of the items.
    If the system distributes the absolute header discount according to volume based on the Alternative formula for condition base value , a header discount of $30 results in the following discounts:
    Item Value Volume .
    1 $1000 2 cbm
    2 $500 4 cbm
    Stand. disc. Volume disc.(With Formula)
    $20 $10
    $10 $20
    Condition formula for alternative calculation type
    Alternative formula to the formula in the standard system that determines a condition.
    Requirement
    This function is used to assign a requirement to the condition type. This requirement can be used to exclude the system from accessing the condition type and trying to determine the value. This can be used to specify that the condition type should only be accessed if the customer has a low risk credit.
    with regards

  • Request for the creation of a new Unemployment account for tax

    Hi Guys,
    This is a question with regard to US tax. We have received a request for the creation of a new Unemployment account for the payment of taxes. This is because the account assignment number has changed for a particular company code in Tennassee state. Please let me know where this change could be made in SAP.
    Thanks,
    Subbaiah

    Subbaiah,
    Table T5UTL is used for New Tax Company Codes. If this is a new legal entity, youu2019ll need to set up the Tax Company here. Youu2019ll also need to assign at least one Personnel Area to this new Tax Company. This must be established in order to update the next table shown below, but only if itu2019s a new legal entity. The user will know.
    Table T5UTH is for establishing the account number to be used in BSI. It must be established in order to update the next table shown below.
    Table T5UTI is for assigning account numbers by Tax Company Code. Youu2019ll need one for Tax Authority TN, Tax Type 10. The user will need to supply this information to you.
    Table BTXRATE will need to be updated with the Tax Company Code, year, and the State Unemployment Insurance rate & taxable wage amount.
    Once this is done, youu2019ll need to update BSI.
    If Tennessee is a new state, youu2019ll have work to do with the tax models.
    Regards,
    Howard

  • Condition Base Value Routine

    Hello all,
    I am currently facing an issue where we have created a Custom Condition Base value routine for a Tax Condition type.
    In our scenario, we have Sales Tax condition type ZZTX which has the following parameters:
    Cond. class       D Taxes
    Calculat.type     A Percentage
    Cond.category  D Tax
    Rounding rule       Commercial
    Also since its a tax condition type, it is set to D - cannot be modified manually.
    Also in the pricing procedure, the condition type is pointing row 301 to pickup the condition value basis. This is for the normal scenarios. However when a particular condition is satisfied (which is coded in routine 902 for ZZTX) the code in 902 is supposed to change the condition base value for ZZTX.
    800     0     ZZTX     Tax for Sales     301                       10          902     MWS
    This functionality is not working at this point. When I debug, I can see the code appending the calculated value to the condition base value for ZZTX.
    However on the screen, I still see the condition base value being picked up from row 301.
    I need some input from you guys so as to find it the condition type zztx should have some parameters set to allow the change or is there a problem in the 902 routine ?
    Kindly advise
    Thanks
    Vin

    Hi Vin,
      Please check with your ABAP expert if he has done below to fetch calculated value to hold it correctly,
       l_val_190    TYPE kwert,   l_val_210    TYPE kbetr,
    I guess it is to do with Data type only in your 902 routine
    Hope this will solve your probelm,
    Regards,
    Siva

  • Condition base value...

    Hi,
    We have two basic price condition types called
    ZLAB and ZLTR. At any point of time only one condition type will be executed and fetch the price.
    We also have ZLAD is the discount based on whichever availble on the above one.
    ZLAB
    ZLTR
    ZLAD
    Now I need execute this discount rate based on which is active condtion record.
    To cater this can I make use of altenative condition base value formula ?
    or any other config set up will help?

    Hi,
    Which pricing schema look better out of given 2 here
                    Schema 1
    ZLAB Basic price
    ZLTR Basic Price
    ZLAD Discount on any one of ZLAB or ZLTR, which is available
    ZLVR Discount on any one of ZLAB or ZLTR, which is available
    ======
    Net value
    =======
                    Schema 2
    ZLAB
    ZLTR
    ======
    sum value
    =====
    ZLAD
    ZLVR
    ===========
    Net value
    ========
    Here the schema 1 is looks better and as per Standard SAP way. I got the answer for how to writte the cond. base value routine.
    Step 1: - Assign subtotal to ZLAB (say "A)
    Step 2: - Assign subtotal to ZLTR (say "B")
    Step 3: - create new cond. base value , write a code
                 as
                      if Value for A is not equal to zero, pass the value to xkwert
                   else
                   pass the value of B to xkwert.
    Step 4: - Assign this routine to ZLAD
    step 5: - Create ZLAD condition record.
    Results: - System takes either A or B value as base value and for the discoun of ZLAD.
    Thanks, good learning
    Laxman

  • How to display modified condition base value in Pricing Procedure?

    Hi everyone:
    I used a formula to change the condition base value (via the VOFM transaction) of various price conditions that are assigned to the same material. In this way, I can distribute the total quantity of the item line in smaller quantities for each price condition.
    Now the problem is that in the conditions tab of the sales order, I can not see the Condition Base Value of each Price Condition, and that's a little confusing.
    Did Anyone know's a way to show the modified Condition Base Value in the Pricing Procedure of the Condition Tab?
    Thanks a lot,
    Ginno Giuffra

    Thanks JJ:
    Yes,  I can found the modified base value in the condition details, but I still need to show it in the Pricing Procedure scheme.
    It is curious that the table options does not allow you to add that field to the escheme.
    Does anyone knows a user exit wich can modifye the table?
    Thanks again,
    Ginno Giuffra

  • VOFM: Condition Base Value(Urgent)

    Hi All,
    I created  Condition Base Value and transported it with a breakpoint. In the revision I removed the breakpoint but there was syntax error so object was not imported and the error shown for transport was 8. In another try an error occured again. In last import, everything went fine but the condition base value include program is not updated. it is remianing in the last state.
    Do I need to do something extra or there is problem in the steps I am following.
    Regards
    Vijai

    Hi,
    Now make sure that break points are removed and activate the routine by running RV80HGEN program in SE38.After this transport the fresh request.
    Reward points if useful
    Regards,
    Amrish Purohit

  • Wrong condition base value when an order is copied from another order

    I am copying sale order to sale order and encounter an issue with pricing .
    I have an excise condtion for which the condition basis is the price condition . I copy the order and update the pricing in the new document (  I have to do this because the pricing type in copy controls is A ) . The price is being copied and the value calcualated as per the order quantity . But the same value is not flowing as the condition base value for the excise condition type mentioned above. It is taking some different value as the base value . There is no alt base value assigned in the procedure.
    As per the settings in the procedure , the condtion value of the price should be the base value for the excise condition type and this is not happening
    Could somebody throw light as to what is going wrong ?
    Thanks in advance
    Regards
    Mahesh

    Many thanks for this.
    I can see entirely why it's designed as such, but I just find it slightly frustrating that there's no way to break the link between the order and the shipment out to the depot. Just to clarify, we're not requiring the orders to change - they will still be made and will come in - but just that the orders themselves don't specifically need to be the stock that is used for the replenishment.
    So -
    1. Min Max identifies depot needs replenishing.
    2. Central distribution does not have (enough) stock to replenish.
    3. Order is made to replenish central distributions stock.
    4. We ship whatever we've got, when we've got it, to depot to replenish.
    It's the bit where Min-Max is trying to replensih a specific depot rather than our central distribution centre that's my problem.
    I suspect that, as you say, that specific issue is not directly fixable without getting our IT contractors to do a customisation.
    I'm going to look into your Supply Date Offset suggestion now, though I'm not sure how this affects the shipping after the orders are placed. The orders themselves are approved manually after we've checked our stock position (i.e. what's in with the recycling team), but we recycle & refurb probably 60% of our maint stock so there'll always be kit turning up after the order has been made because of the long lead times.
    Thanks again.

  • VOFM Condition base value not updating(Urgent)

    Hi All,
    I have created a Condition Base Value 901 for Sales Order in Transaction VOFM.
    Following is the code when I enter the Sorce text.
    FORM FRM_KOND_BASIS_901.
    *{   INSERT         DEVK901384                                        1
    DATA: XXKOMV TYPE KOMV,
          XAKOMV TYPE KOMV,
          VKAWRT LIKE KOMV-KAWRT.
    IF KOMP-VKAUS = 'YAB'.
    XXKOMV = XKOMV.
    CLEAR VKAWRT.
    LOOP AT XKOMV INTO XAKOMV WHERE KSCHL = 'YIPR'.
    IF XAKOMV-KAWRT > 0.
    VKAWRT = XAKOMV-KWERT.
    ENDIF.
    ENDLOOP.
    XKAWRT = VKAWRT.
    CLEAR XKOMV.
    XKOMV = XXKOMV.
    ENDIF.
    *}   INSERT
    ENDFORM.
    But this code is not updating the Condition screen for items condition value.
    Regards
    Vijai

    no, the code contains the logic to determine the base value, then the value has to be passed to xkwert.
    take some other base formula as template.
    pls. rewad if helpful
    Roberto

  • CONDITION BASE VALUE / ALT CALCULATION TYPE Pricing

    Dear All,
    I have a scenario where in I want the condition base value for calculating the value for a condition type to be based on
    Gross weight -  Net weight value of a material.
    Is it possible and if yse how do I acheive the same.
    Deepak

    Deepak,
    Alternative Calculation Type:
    Normally if you want to calculate a value you have to use a calculation type for determinating the value. This calculation type is either addition, subtraction or multiplication. Similarly SAP also has got a default calculation type in the control data of the condition type. There you have the options of either Qty based , Fixed Amount Based or Percentage based.  
    Here what happens is suppose if you define Your condition type that calculates the base price of a material on Qty based. Then the calculation will be done based on the quantity of the material. If the customer orders 10 Nos and you have maintained a unit price of 100 Rs for each material then the value determined is 1000 INR. Similarly if the discount condition type , you maintain the calculation type as %. This means if you maintain the value of 10  % in the condition record. Then this percentage is taken as the calculation type  and the condition value is determined.
    In some cases you have to forego the default calculation types and use the customer specific method for calculating a value. For ex if you are calculating the Freight charges for a Material . it depends on so many criteria like, the weight, volume  and also the minimum amount etc etc, in those cases, you forego the default value and then use the alternative calculation type in calculating the condition value against the particular condition.
    Alternative Condition Base value :
    If you have to calculate any value then you have to have a base value for it. For ex if you want to calculate the  discount of 10 % for a material then you have to have a base value on which this 10% is calculated. Normally you take the  condition value of the base price of the material to calculate the value.
    Now you don't want to take the base value and take other values as base value which are derived on some formulae. So you create a routine which will do the mathematical operations in the routine and derive you a value which is now used as the base value for calculating the condition value for a particular condition type.
    Reward poitns if u finds this helpful....
    Regds
    MM

Maybe you are looking for

  • Unresponsive keyboard Windows 7 Boot camp install

    Im trying to install Windows 7 onto my mid 2010 MacBook and seem to hit every problem possible. Now after I partitioned the hard drive and clicked continue, the "Windows is reading files" comes up and eventually an error occurs. "Windows has encounte

  • HP 5500 will not print in Yosemite

    After installing Yosemite on my MacBook Pro (13"), my HP 5500 will no longer print. I have noticed that many users have also reported printer problems with Yosemite. I have tried implementing some of those suggested solutions to date --to no avail: I

  • Today, while working in Photoshop CC 2014

    I found that I couldn't change my file from 16 bit to 8 bit, even after flattening all the layers. I even saved the file as a jpeg and re-opened the file in Photoshop, and still couldn't change to 8 bit. Both Image mode and adjustment options are gra

  • Case Insensitive search

    I've managed to make this work. I load a cf query which is turned into an xml document. I then create a dynamic spry table which can be filtered using a text input using the following function on keyup.Works great for one exception, the fullname sear

  • How to create UTL file from on Unix server

    Hi, I have created a stored procedure in Oracle (8.0.6) which will create a flat file using UTL_File. The oracle server is running on unix system. When I am executing the PL/SQL procedure from Unix's Sql Plus, it is creating the file properly. When I