<?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: convert string to arithmatic expression in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149778#M992372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;reading the formula from the table will be very tricky... &lt;/P&gt;&lt;P&gt;as You'll need your field values i.e. A and  B's values in following g format... &lt;/P&gt;&lt;P&gt;Itab-fld_name = 'A' &lt;/P&gt;&lt;P&gt;itab-fld_val    = '1' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this case.. you can read the string from the custom table and then divide it into &lt;/P&gt;&lt;P&gt;fld1 operator fld2... &lt;/P&gt;&lt;P&gt;and then crosscheck these values with the itab values... &lt;/P&gt;&lt;P&gt;and perform arithmetic function specified by operator.. which you  need to compare manually... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string = 'A + B' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-fld_name itab-fld_val &lt;/P&gt;&lt;P&gt;A                    1 &lt;/P&gt;&lt;P&gt;B                    2 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after segregating the screen &lt;/P&gt;&lt;P&gt;fld1 = 'A' &lt;/P&gt;&lt;P&gt;operator = '+' &lt;/P&gt;&lt;P&gt;fld2 = 'B' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now take the values of these fields from itab &lt;/P&gt;&lt;P&gt;and do the calculation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*this logic will work if all your formulates are of fixed format&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jul 2008 10:01:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-11T10:01:54Z</dc:date>
    <item>
      <title>convert string to arithmatic expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149775#M992369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any function module that can convert a string containing Formula into arithmatic expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example : &lt;/P&gt;&lt;P&gt;if I have string "( A + B ) * 100" &lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;A = 1&lt;/P&gt;&lt;P&gt;B = 2&lt;/P&gt;&lt;P&gt;so that by entering both A  and B value, I can get the result  of 300 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;William Prawira&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2008 08:46:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149775#M992369</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-11T08:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: convert string to arithmatic expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149776#M992370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For that you don't need a FM.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM f_formula USING a TYPE i b TYPE i CHANGING res TYPE i.
  res = ( a + b ) * 100.
ENDFORM.
PERFORM f_formula USING var1 var2 CHANGING result.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2008 08:56:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149776#M992370</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-07-11T08:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: convert string to arithmatic expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149777#M992371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Valter Oliveira.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It could be done using that,  but since there are a lot of formulas, and they are really complex, I'm thinking of creating a table to store those formulas, and then read it using the formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hoping to save time if in the near future, i need to change the formula, I don't need to change the form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;William Prawira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2008 09:45:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149777#M992371</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-11T09:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: convert string to arithmatic expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149778#M992372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;reading the formula from the table will be very tricky... &lt;/P&gt;&lt;P&gt;as You'll need your field values i.e. A and  B's values in following g format... &lt;/P&gt;&lt;P&gt;Itab-fld_name = 'A' &lt;/P&gt;&lt;P&gt;itab-fld_val    = '1' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this case.. you can read the string from the custom table and then divide it into &lt;/P&gt;&lt;P&gt;fld1 operator fld2... &lt;/P&gt;&lt;P&gt;and then crosscheck these values with the itab values... &lt;/P&gt;&lt;P&gt;and perform arithmetic function specified by operator.. which you  need to compare manually... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string = 'A + B' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-fld_name itab-fld_val &lt;/P&gt;&lt;P&gt;A                    1 &lt;/P&gt;&lt;P&gt;B                    2 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after segregating the screen &lt;/P&gt;&lt;P&gt;fld1 = 'A' &lt;/P&gt;&lt;P&gt;operator = '+' &lt;/P&gt;&lt;P&gt;fld2 = 'B' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now take the values of these fields from itab &lt;/P&gt;&lt;P&gt;and do the calculation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*this logic will work if all your formulates are of fixed format&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2008 10:01:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149778#M992372</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-11T10:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: convert string to arithmatic expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149779#M992373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check if &lt;STRONG&gt;FIMA_FORMULA_CREATE&lt;/STRONG&gt; helps you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2008 10:06:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149779#M992373</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-11T10:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: convert string to arithmatic expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149780#M992374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sharayu Kumatkar  ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. I think I can use this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just need to try using it ^^.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;William Prawira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2008 10:24:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-string-to-arithmatic-expression/m-p/4149780#M992374</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-11T10:24:55Z</dc:date>
    </item>
  </channel>
</rss>

