<?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: Problem in dividing the value in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600935#M1276447</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try declaring all the three variables as type P (Packed decimals) and perform the division.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 May 2009 09:03:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-04T09:03:04Z</dc:date>
    <item>
      <title>Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600934#M1276446</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 have a problem in dividing the values, say example i want to divid n by n1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n = 1339.80&lt;/P&gt;&lt;P&gt;n1 =1914&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n2 = n/n1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i am getting the output value as 1 and i tried the DIVIDE statement as well, but still i am facing the same proble.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help to solve this problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know the FM to calculate the percentage value.&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;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 08:59:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600934#M1276446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T08:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600935#M1276447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try declaring all the three variables as type P (Packed decimals) and perform the division.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:03:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600935#M1276447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T09:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600936#M1276448</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;Take the Type of the N2 as Decimal or Packet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:05:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600936#M1276448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T09:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600937#M1276449</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;What is the data type of n and n1?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:05:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600937#M1276449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T09:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600938#M1276450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;seems like you have declared you variables of type i.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:05:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600938#M1276450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T09:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600939#M1276451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: n1 type p decimals 2,
      n2 type p decimals 2,
      n3 type p decimals 2.

  n1 = '1339.80'.
  n2 = '1914.00'.

  n3 = n1 / n2.

  write:/ n3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks\&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:06:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600939#M1276451</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-05-04T09:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600940#M1276452</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;Declare it of type p and after division you can store in the data type of your choice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:07:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600940#M1276452</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T09:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600941#M1276453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the problem may be that the variable n2 is int type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want an answer in decimal format then just make this variable of type p(packed decimal)  and i you want an integer output then in sap 5/10 is 1 not 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use ceil or other similar commands.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:09:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600941#M1276453</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T09:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600942#M1276454</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;  Please check the following code, it is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS:n type p decimals 2 DEFAULT  '1339.80',&lt;/P&gt;&lt;P&gt;           n1 type p decimals 2 default '1914',&lt;/P&gt;&lt;P&gt;           n2 TYPE p DECIMALS 2 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n2 = n / n1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE n2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:21:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600942#M1276454</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T09:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600943#M1276455</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 try using the one you suggested as well and all other ways. but i am not getting the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any FM to calculate the percentage.&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;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:44:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600943#M1276455</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T09:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600944#M1276456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Data: n type p decimals 5,
      n1 type p decimals 5,
      n2 type p decimals 5.

n = '1339.80'.
n1 = 1914.

n2 = n / n1.

write: n2.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:48:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600944#M1276456</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2009-05-04T09:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600945#M1276457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It gives percentage value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: n1 type p decimals 2,
      n2 type p decimals 2,
      n3 type p decimals 2.

  n1 = '1339.80'.
  n2 = 1914.

  n3 = n1 / n2 * 100.

  write:/ n3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And what's the error your getting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks\&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 09:54:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600945#M1276457</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-05-04T09:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600946#M1276458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i try hard code the value with the solution given is working. but the problem in my case is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: n TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;      n1 TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;      n2 TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;     n3(10) type c value '1339.80',&lt;/P&gt;&lt;P&gt;    n4(15) type numc valu '1914'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note for n3 and n4 is hardcode for examplet, but in real time , the value will be passed from the field directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n = n3 .&lt;/P&gt;&lt;P&gt;n1 = n4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n2 = n/ n1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write n2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check and let me know the solution for this case.&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;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 10:46:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600946#M1276458</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T10:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600947#M1276459</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 have tested the code and it is giving the output as 0.70.(i.e. N2 hold 0.70 value)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 10:54:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600947#M1276459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T10:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600948#M1276460</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;&lt;/P&gt;&lt;P&gt;Yes its coming correct if you pass the value without decimal for n4 and the field type CURR.Please find the logic below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: n TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;n1 TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;n2 TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;n3(10) type c value '1339.80',&lt;/P&gt;&lt;P&gt;n4 type netwr value '1914.50'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note for n3 and n4 is hardcode for examplet, but in real time , the value will be passed from the field directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n = n3 .&lt;/P&gt;&lt;P&gt;n1 = n4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n2 = n/ n1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write n2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly check and help me out to solve this.&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;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2009 12:48:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600948#M1276460</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-04T12:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in dividing the value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600949#M1276461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: n1 type p decimals 2,&lt;/P&gt;&lt;P&gt;      n2 type p decimals 2,&lt;/P&gt;&lt;P&gt;      n3 type p decimals 2.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  n1 = '1339.80'.&lt;/P&gt;&lt;P&gt;  n2 = '1914.50'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;n2 = n2 * 10.&lt;/P&gt;&lt;P&gt;n2 = n2 /1000.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  n3 = n1 / n2.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  write:/ n3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then it will work correct in the case of the field has different type like CURR,CHAR,INTE,etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any way thanks a lot for all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 06:41:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-dividing-the-value/m-p/5600949#M1276461</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-07T06:41:16Z</dc:date>
    </item>
  </channel>
</rss>

