<?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: Use Operands + or * for calculation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494589#M1746512</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Van Thao. You link was very much useful &amp;amp; it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Satty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jun 2013 07:01:30 GMT</pubDate>
    <dc:creator>sathish_kumar92</dc:creator>
    <dc:date>2013-06-13T07:01:30Z</dc:date>
    <item>
      <title>Use Operands + or * for calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494580#M1746503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have few mathematical operands stored in SAP custom fields. How do i use it for calculation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please take this as example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ztest-field1 = '100'.&lt;/P&gt;&lt;P&gt;ztest-field2 = '*'.&lt;/P&gt;&lt;P&gt;ztest-field3 = N+n&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my requirement is i need to pass numeric values to N &amp;amp; n. Since we have addition operand in between them values of N &amp;amp; n needs to be summed &amp;amp; then i need to have formula like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ztotal = ztest-field1 ztest-field2 ztest-field3. (Here ztest-field2 will again be a mathematical operand * ). So that I will get total of field1 &amp;amp; field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Satty&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 05:39:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494580#M1746503</guid>
      <dc:creator>sathish_kumar92</dc:creator>
      <dc:date>2013-06-13T05:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Use Operands + or * for calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494581#M1746504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satish ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to perform Mathematical Operations to your fields declare them with integer characteristics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : num1 type int1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num2 type int2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result type int4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result&amp;nbsp; = num1 + num2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Pavan.N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 06:09:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494581#M1746504</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-13T06:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Use Operands + or * for calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494582#M1746505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sathish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to use the &lt;STRONG&gt;eval()&lt;/STRONG&gt; function in Javascript, in ABAP the Javascript processor is wrapped in class is &lt;STRONG&gt;CL_JAVA_SCRIPT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out this useful link for an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://zevolving.com/2011/10/javascript-in-abap/"&gt;http://zevolving.com/2011/10/javascript-in-abap/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps! Cheers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 06:18:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494582#M1746505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-13T06:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Use Operands + or * for calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494583#M1746506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My case is field value itself an operand&amp;nbsp; which may be + or *. How will i calculate in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope u understand. field1 will have value 100, field2 will value +, field3 will have value 200.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i need to get the total of field1 &amp;amp; field3 by using operand in field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Satty&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 06:24:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494583#M1746506</guid>
      <dc:creator>sathish_kumar92</dc:creator>
      <dc:date>2013-06-13T06:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Use Operands + or * for calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494584#M1746507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sathish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where exactly are you stuck? If I understand you correctly, you have the operands and operators stored in a database table and you need to perform calculations based on them. That should be doable using IF/CASE statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Akshat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 06:30:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494584#M1746507</guid>
      <dc:creator>kakshat</dc:creator>
      <dc:date>2013-06-13T06:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Use Operands + or * for calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494585#M1746508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello satish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can simply use &lt;STRONG&gt;CASE&lt;/STRONG&gt; statement and get your result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example : -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Case &lt;/STRONG&gt;ztest-field2.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;when&lt;/STRONG&gt; '*'.&lt;/P&gt;&lt;P&gt;ztotal = (ztest-field1) * (ztest-field3).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;when&lt;/STRONG&gt; '+'.&lt;/P&gt;&lt;P&gt;ztotal = (ztest-field1) + (ztest-field3).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;when&lt;/STRONG&gt; others.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endcase.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 06:37:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494585#M1746508</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-13T06:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Use Operands + or * for calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494586#M1746509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can have a maximum of 4 operations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE Field2. " [OPERATOR]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When '+'.&lt;/P&gt;&lt;P&gt;Result = field1 + Field3.&lt;/P&gt;&lt;P&gt;When '-'.&lt;/P&gt;&lt;P&gt;Result = field1 - Field3.&lt;/P&gt;&lt;P&gt;When '*'.&lt;/P&gt;&lt;P&gt;Result = field1 * Field3.&lt;/P&gt;&lt;P&gt;When '/'.&lt;/P&gt;&lt;P&gt;Result = field1 / Field3.&lt;/P&gt;&lt;P&gt;Endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 06:39:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494586#M1746509</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-13T06:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use Operands + or * for calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494587#M1746510</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;Read the first field contents in 3 different variables and a CASE.. ENDCASE to select the operation as per the operand( Its few in numbers). For the 3rd field is the format always like N+n, N*n, N-n.. Then i guess this can be read by offset and processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you also clarify the datatypes of the fields and the context.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Arindam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 06:40:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494587#M1746510</guid>
      <dc:creator>arindam_m</dc:creator>
      <dc:date>2013-06-13T06:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Use Operands + or * for calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494588#M1746511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sathish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you are trying to archieve this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ztotal =&amp;nbsp;&amp;nbsp; 100 * (N + n)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ztest-Field2 = N + n.&lt;/P&gt;&lt;P&gt;Ztotal = Ztest-field1 * Ztest-field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Meenachi.R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 06:43:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494588#M1746511</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-06-13T06:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Use Operands + or * for calculation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494589#M1746512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Van Thao. You link was very much useful &amp;amp; it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Satty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 07:01:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-operands-or-for-calculation/m-p/9494589#M1746512</guid>
      <dc:creator>sathish_kumar92</dc:creator>
      <dc:date>2013-06-13T07:01:30Z</dc:date>
    </item>
  </channel>
</rss>

