<?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: Math Functions in SAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/math-functions-in-sap/m-p/3351431#M803918</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Following maths functionas are there in SAP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;abs&lt;/STRONG&gt; -Absolute value of the argument arg &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sign&lt;/STRONG&gt;- Plus/minus sign of the argument arg: -1, if the value of arg is negative; 0 if the value of arg is 0; 1 if the value of arg is positive. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ceil&lt;/STRONG&gt; -Smallest integer number that is not smaller than the value of the argument arg. &lt;/P&gt;&lt;P&gt;f&lt;STRONG&gt;loor&lt;/STRONG&gt;- Largest integer number that is not larger than the value of the argument arg. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;trunc&lt;/STRONG&gt;- Value of the integer part of the argument arg &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;frac&lt;/STRONG&gt;- Value of the decimal places of the argument arg &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;acos&lt;/STRONG&gt; -Arcuscosinus [-1,1] &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;asin&lt;/STRONG&gt;- Arcussinus [-1,1] &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;atan&lt;/STRONG&gt;- Arcustangens &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cos&lt;/STRONG&gt;- Cosinus &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sin&lt;/STRONG&gt;- Sinus &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tan&lt;/STRONG&gt;- Tangens &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cosh&lt;/STRONG&gt;- Hyperbelcosinus &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sinh&lt;/STRONG&gt; -Hyperbelsinus &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tanh&lt;/STRONG&gt; -Hyperbeltangens &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;exp&lt;/STRONG&gt; -Exponential function for basis e [-709, 710] &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;log&lt;/STRONG&gt; -Natural logarithm &amp;gt; 0 &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;log1&lt;/STRONG&gt;0 -Logarithm for basis 10 &amp;gt; 0 &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sqrt&lt;/STRONG&gt; -Square root&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Feb 2008 09:56:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-07T09:56:46Z</dc:date>
    <item>
      <title>Math Functions in SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/math-functions-in-sap/m-p/3351430#M803917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are the math functions in SAP?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 09:51:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/math-functions-in-sap/m-p/3351430#M803917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T09:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Math Functions in SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/math-functions-in-sap/m-p/3351431#M803918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Following maths functionas are there in SAP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;abs&lt;/STRONG&gt; -Absolute value of the argument arg &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sign&lt;/STRONG&gt;- Plus/minus sign of the argument arg: -1, if the value of arg is negative; 0 if the value of arg is 0; 1 if the value of arg is positive. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ceil&lt;/STRONG&gt; -Smallest integer number that is not smaller than the value of the argument arg. &lt;/P&gt;&lt;P&gt;f&lt;STRONG&gt;loor&lt;/STRONG&gt;- Largest integer number that is not larger than the value of the argument arg. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;trunc&lt;/STRONG&gt;- Value of the integer part of the argument arg &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;frac&lt;/STRONG&gt;- Value of the decimal places of the argument arg &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;acos&lt;/STRONG&gt; -Arcuscosinus [-1,1] &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;asin&lt;/STRONG&gt;- Arcussinus [-1,1] &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;atan&lt;/STRONG&gt;- Arcustangens &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cos&lt;/STRONG&gt;- Cosinus &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sin&lt;/STRONG&gt;- Sinus &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tan&lt;/STRONG&gt;- Tangens &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cosh&lt;/STRONG&gt;- Hyperbelcosinus &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sinh&lt;/STRONG&gt; -Hyperbelsinus &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tanh&lt;/STRONG&gt; -Hyperbeltangens &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;exp&lt;/STRONG&gt; -Exponential function for basis e [-709, 710] &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;log&lt;/STRONG&gt; -Natural logarithm &amp;gt; 0 &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;log1&lt;/STRONG&gt;0 -Logarithm for basis 10 &amp;gt; 0 &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sqrt&lt;/STRONG&gt; -Square root&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 09:56:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/math-functions-in-sap/m-p/3351431#M803918</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T09:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Math Functions in SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/math-functions-in-sap/m-p/3351432#M803919</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;This is what u want may be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathematical Functions &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP contains a range of built-in functions that you can use as mathematical expressions, or as part of a mathematical expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[COMPUTE] &amp;lt;n&amp;gt; = &amp;lt;func&amp;gt;( &amp;lt;m&amp;gt; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The blanks between the parentheses and the argument &amp;lt;m&amp;gt; are obligatory. The result of calling the function &amp;lt;func&amp;gt; with the argument &amp;lt;m&amp;gt; is assigned to &amp;lt;n&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functions for all Numeric Data Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following built-in functions work with all three numeric data types (F, I, and P) as arguments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functions for all numeric data types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function&lt;/P&gt;&lt;P&gt; Result&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ABS&lt;/P&gt;&lt;P&gt; Absolute value of argument.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SIGN&lt;/P&gt;&lt;P&gt; Sign of argument:                      1 X &amp;gt; 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                              SIGN( X) = 0 if X = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                                               -1 X &amp;lt; 0&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CEIL&lt;/P&gt;&lt;P&gt; Smallest integer value not smaller than the argument.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FLOOR&lt;/P&gt;&lt;P&gt; Largest integer value not larger than the argument.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TRUNC&lt;/P&gt;&lt;P&gt; Integer part of argument.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FRAC&lt;/P&gt;&lt;P&gt; Fraction part of argument.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The argument of these functions does not have to be a numeric data type. If you choose another type, it is converted to a numeric type. For performance reasons, however, you should use the correct type whenever possible. The functions itself do not have a data type of their own. They do not change the numerical precision of a numerical operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA N TYPE P DECIMALS 2.&lt;/P&gt;&lt;P&gt;DATA M TYPE P DECIMALS 2 VALUE '-5.55'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N = ABS( M ).   WRITE:   'ABS:  ', N.&lt;/P&gt;&lt;P&gt;N = SIGN( M ).  WRITE: / 'SIGN: ', N.&lt;/P&gt;&lt;P&gt;N = CEIL( M ).  WRITE: / 'CEIL: ', N.&lt;/P&gt;&lt;P&gt;N = FLOOR( M ). WRITE: / 'FLOOR:', N.&lt;/P&gt;&lt;P&gt;N = TRUNC( M ). WRITE: / 'TRUNC:', N.&lt;/P&gt;&lt;P&gt;N = FRAC( M ).  WRITE: / 'FRAC: ', N.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output appears as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABS:              5.55&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SIGN:             1.00-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CEIL:             5.00-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FLOOR:            6.00-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRUNC:            5.00-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FRAC:             0.55-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: T1(10),&lt;/P&gt;&lt;P&gt;T2(10) VALUE '-100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1 = ABS( T2 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE T1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This produces the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two conversions are performed. First, the contents of field T2 (type C) are converted to type P. Then the system processes the ABS function using the results of the conversion. Then, during the assignment to the type C field T1, the result of the function is converted back to type C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Floating-Point Functions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following built-in functions work with floating point numbers (data type F) as an argument.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functions for floating point data types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function&lt;/P&gt;&lt;P&gt; Meaning&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ACOS, ASIN, ATAN; COS, SIN, TAN&lt;/P&gt;&lt;P&gt; Trigonometric functions.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;COSH, SINH, TANH&lt;/P&gt;&lt;P&gt; Hyperbolic functions.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;EXP&lt;/P&gt;&lt;P&gt; Exponential function with base e (e=2.7182818285).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOG&lt;/P&gt;&lt;P&gt; Natural logarithm with base e.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOG10&lt;/P&gt;&lt;P&gt; Logarithm with base 10.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SQRT&lt;/P&gt;&lt;P&gt; Square root.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For all functions, the normal mathematical constraints apply (for example, square root is only possible for positive numbers). If you fail to observe them, a runtime error occurs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The argument of these functions does not have to be a floating point field. If you choose another type, it is converted to type F. The functions themselves have the data type F. This can change the numerical precision of a numerical operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 09:57:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/math-functions-in-sap/m-p/3351432#M803919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T09:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Math Functions in SAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/math-functions-in-sap/m-p/3351433#M803920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this example from abapdocu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* numeric datatypes

DATA n TYPE p DECIMALS 2.
DATA m TYPE p DECIMALS 2 VALUE '-5.55'.

n = abs( m ).   WRITE:   'ABS:  ', n.
n = sign( m ).  WRITE: / 'SIGN: ', n.
n = ceil( m ).  WRITE: / 'CEIL: ', n.
n = floor( m ). WRITE: / 'FLOOR:', n.
n = trunc( m ). WRITE: / 'TRUNC:', n.
n = frac( m ).  WRITE: / 'FRAC: ', n.

ULINE.

* floating points

DATA: result TYPE f,
      pi(10) TYPE c VALUE '3.14159265'.

result = cos( pi ).

WRITE result.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 09:58:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/math-functions-in-sap/m-p/3351433#M803920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-07T09:58:07Z</dc:date>
    </item>
  </channel>
</rss>

