<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: creating new formula via tcode VOFM, Formulas-&amp;gt;Condition base value in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-new-formula-via-tcode-vofm-formulas-gt-condition-base-value/m-p/3378209#M811138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Take the Access Key with the help of BASIS people&lt;/P&gt;&lt;P&gt;and create aroutine with the Number above 900&lt;/P&gt;&lt;P&gt;and copy the code of the existing routine and modify it as per your changes&lt;/P&gt;&lt;P&gt;VOFM is the transaction where you can maintain Requirement routines, which are assigned through cusomization.&lt;/P&gt;&lt;P&gt;To create a routine you need access key &amp;amp; routine no. starts with "9".for ex. 901,902 etc.&lt;/P&gt;&lt;P&gt;one important thing to note that even if you have some syntax errors inside your routine, it will get activated without errors. So, you need to do Main Program check before activation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to SAP Note no : 327220,381348,156230.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goto VOFM tcode for wrting the Routines&lt;/P&gt;&lt;P&gt;from menu Requirements-&amp;gt; pricing&lt;/P&gt;&lt;P&gt;You can create the pricing related routines here&lt;/P&gt;&lt;P&gt;Use the Number from 900 only&lt;/P&gt;&lt;P&gt;take the acess key and try to copy the existing routine and change the code to your requirement  and keep a break point and see&lt;/P&gt;&lt;P&gt;Activate it before execution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Feb 2008 08:06:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-12T08:06:13Z</dc:date>
    <item>
      <title>creating new formula via tcode VOFM, Formulas-&gt;Condition base value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-new-formula-via-tcode-vofm-formulas-gt-condition-base-value/m-p/3378208#M811137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create new formula via tcode VOFM, &lt;STRONG&gt;Formulas-&amp;gt;Condition base value&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for this I have:&lt;/P&gt;&lt;P&gt;1. number of this new formula &lt;/P&gt;&lt;P&gt;2. rule of calculations of the formula (ABAP code)&lt;/P&gt;&lt;P&gt;3. developer key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will reward,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mindaugas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2008 07:57:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-new-formula-via-tcode-vofm-formulas-gt-condition-base-value/m-p/3378208#M811137</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-12T07:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: creating new formula via tcode VOFM, Formulas-&gt;Condition base value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-new-formula-via-tcode-vofm-formulas-gt-condition-base-value/m-p/3378209#M811138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Take the Access Key with the help of BASIS people&lt;/P&gt;&lt;P&gt;and create aroutine with the Number above 900&lt;/P&gt;&lt;P&gt;and copy the code of the existing routine and modify it as per your changes&lt;/P&gt;&lt;P&gt;VOFM is the transaction where you can maintain Requirement routines, which are assigned through cusomization.&lt;/P&gt;&lt;P&gt;To create a routine you need access key &amp;amp; routine no. starts with "9".for ex. 901,902 etc.&lt;/P&gt;&lt;P&gt;one important thing to note that even if you have some syntax errors inside your routine, it will get activated without errors. So, you need to do Main Program check before activation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to SAP Note no : 327220,381348,156230.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goto VOFM tcode for wrting the Routines&lt;/P&gt;&lt;P&gt;from menu Requirements-&amp;gt; pricing&lt;/P&gt;&lt;P&gt;You can create the pricing related routines here&lt;/P&gt;&lt;P&gt;Use the Number from 900 only&lt;/P&gt;&lt;P&gt;take the acess key and try to copy the existing routine and change the code to your requirement  and keep a break point and see&lt;/P&gt;&lt;P&gt;Activate it before execution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2008 08:06:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-new-formula-via-tcode-vofm-formulas-gt-condition-base-value/m-p/3378209#M811138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-12T08:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: creating new formula via tcode VOFM, Formulas-&gt;Condition base value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-new-formula-via-tcode-vofm-formulas-gt-condition-base-value/m-p/3378210#M811139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechsolutions.com/pdf/VOFMFormulaRoutines.pdf" target="test_blank"&gt;http://www.saptechsolutions.com/pdf/VOFMFormulaRoutines.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2008 08:09:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-new-formula-via-tcode-vofm-formulas-gt-condition-base-value/m-p/3378210#M811139</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-12T08:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: creating new formula via tcode VOFM, Formulas-&gt;Condition base value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-new-formula-via-tcode-vofm-formulas-gt-condition-base-value/m-p/3378211#M811140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To define Custom Z routine in Sales and Distribution module please follow the following steps.&lt;/P&gt;&lt;P&gt;o Transaction Code - VOFM (Maintain: Requirements and Formulas)&lt;/P&gt;&lt;P&gt;o Menu Path - Formulas --&amp;gt; Condition value.&lt;/P&gt;&lt;P&gt;o Go to bottom of the table control,&lt;/P&gt;&lt;P&gt;o Enter the routine number for Ex. 900 and some meaningful description,&lt;/P&gt;&lt;P&gt;o It will ask the Access key, enter the available access key. Now ABAP editor will be opened, you can switch off Modification Assistant from Menu EDIT &amp;amp;#56256;&amp;amp;#56518; Modification operation &amp;amp;#56256;&amp;amp;#56518; Switch off Assistant.&lt;/P&gt;&lt;P&gt;o In custom routine we can use KOMP structure, where we can get the pricing value,&lt;/P&gt;&lt;P&gt;o To access the whole condition record, we can use structure XKOMV. But to access this XKOMV structure we have to define one internal table of type &amp;#145;INDEXED_KOMV&amp;#146; and pass the structure XKOMV value to the new defined internal table.&lt;/P&gt;&lt;P&gt;o Depending upon the requirement you can refer KOMP or XKOMV structure in your code.&lt;/P&gt;&lt;P&gt;o The calculated result we have to pass to XWERT field, which will be display to the condition record.&lt;/P&gt;&lt;P&gt;o To activate the subroutine we have to first save the code and come out from the routine. In Maintain: Formulas Condition value screen, select routine to activate and select Edit menu &amp;amp;#56256;&amp;amp;#56518; Activate.&lt;/P&gt;&lt;P&gt;o After activating the custom routine, functional person will attach this custom routine to the condition type of the pricing procedure at AltCty column.&lt;/P&gt;&lt;P&gt;o Function person can define one field at Subto column for condition type, which we can use in our custom routine.&lt;/P&gt;&lt;P&gt;o For ex. We require to calculate the % discount depending upon the two condition type. To get the condition value for the both the condition type we have to select one field at Subto column. There are two types of fields, one is &amp;#145;Copy value to&amp;#146; and another one is &amp;#145;Carry over value to&amp;#146;. One store the condition value whereas second store Condition rate. Depending upon the requirement we can select the field type. Before using the Subto field please make sure that it is not referring to other condition type.&lt;/P&gt;&lt;P&gt;o To calculate the % you have to divide or multiply by 10000 not by 100 due to SAP current type.&lt;/P&gt;&lt;P&gt;This is an example of a code sample:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: WORKFIELD(16) TYPE P DECIMALS 2.&lt;/P&gt;&lt;P&gt;CHECK KOMP-KZWI1 NE 0.&lt;/P&gt;&lt;P&gt;IF XWORKJ NE 0.&lt;/P&gt;&lt;P&gt;WORKFIELD = ( KOMP-KZWI1 - XWORKJ ) * 10000 / KOMP-KZWI1.&lt;/P&gt;&lt;P&gt;XKWERT = WORKFIELD.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;XKWERT = 0.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2008 08:11:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-new-formula-via-tcode-vofm-formulas-gt-condition-base-value/m-p/3378211#M811140</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-12T08:11:19Z</dc:date>
    </item>
  </channel>
</rss>

