<?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: Calculating difference in SAP Script in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-difference-in-sap-script/m-p/2811396#M657201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi indrajit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot perform any arithmetic operations in Layout set text elements.&lt;/P&gt;&lt;P&gt;But we can acheive this using the PERFORM command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the window :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;NET_AMOUNT&amp;amp; = '0'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: PERFORM F_CALC_DIFF IN PROGRAM ZREP01&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;REGUP-WRBTR&amp;amp;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;REGUP-SKNTO&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;NET_AMOUNT&amp;amp;&lt;/P&gt;&lt;P&gt;/: ENDPERFORM&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Net amount =  &amp;amp;NET_AMOUNT&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the program ZREP01  define the Subroutine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM  F_CALC_DIFF TABLES INTAB STRUCTURE ITCSY&lt;/P&gt;&lt;P&gt;                                               OUTTAB STRUCTURE ITCSY.&lt;/P&gt;&lt;P&gt;DATA : V1 TYPE REGUP-WRBTR,&lt;/P&gt;&lt;P&gt;           V2 TYPE REGUP-WRBTR,&lt;/P&gt;&lt;P&gt;           V3 TYPE REGUP-WRBTR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE INTAB INDEX 1.&lt;/P&gt;&lt;P&gt; V1 = INTAB-VALUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE INTAB INDEX 2.&lt;/P&gt;&lt;P&gt; V2 = INTAB-VALUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V3 = V1 - V2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE V3 TO OUTTAB-VALUE LEFT-JUSTIFIED.&lt;/P&gt;&lt;P&gt;MODIFY OUTTAB INDEX 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give you the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if Helpful.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Sep 2007 13:56:04 GMT</pubDate>
    <dc:creator>varma_narayana</dc:creator>
    <dc:date>2007-09-27T13:56:04Z</dc:date>
    <item>
      <title>Calculating difference in SAP Script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-difference-in-sap-script/m-p/2811393#M657198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 variables &amp;amp;REGUP-WRBTR&amp;amp; and &amp;amp;REGUP-SKNTO&amp;amp; passed to sap script from print program. I want to calculate thier difference in the script and display the value. I am using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;NET_AMOUNT&amp;amp; = &amp;amp;REGUP-WRBTR&amp;amp; - &amp;amp;REGUP-SKNTO&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not working. Could anyone please suggest how to solve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Indrajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2007 13:39:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-difference-in-sap-script/m-p/2811393#M657198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-27T13:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating difference in SAP Script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-difference-in-sap-script/m-p/2811394#M657199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Indrajit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;NET_AMOUNT&amp;amp; &lt;/P&gt;&lt;P&gt;&amp;amp;NET_AMOUNT&amp;amp; = &amp;amp;REGUP-WRBTR&amp;amp; - &amp;amp;REGUP-SKNTO&amp;amp;&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;&lt;/P&gt;&lt;P&gt;Allan Cristian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2007 13:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-difference-in-sap-script/m-p/2811394#M657199</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-27T13:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating difference in SAP Script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-difference-in-sap-script/m-p/2811395#M657200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You only have limited commands in SAPscript, and they do not include arithmatic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You either have to perform the subtraction in your print program, or call a subroutine from your SAPscript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2007 13:45:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-difference-in-sap-script/m-p/2811395#M657200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-27T13:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating difference in SAP Script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-difference-in-sap-script/m-p/2811396#M657201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi indrajit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot perform any arithmetic operations in Layout set text elements.&lt;/P&gt;&lt;P&gt;But we can acheive this using the PERFORM command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the window :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;NET_AMOUNT&amp;amp; = '0'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: PERFORM F_CALC_DIFF IN PROGRAM ZREP01&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;REGUP-WRBTR&amp;amp;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;REGUP-SKNTO&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;NET_AMOUNT&amp;amp;&lt;/P&gt;&lt;P&gt;/: ENDPERFORM&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Net amount =  &amp;amp;NET_AMOUNT&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the program ZREP01  define the Subroutine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM  F_CALC_DIFF TABLES INTAB STRUCTURE ITCSY&lt;/P&gt;&lt;P&gt;                                               OUTTAB STRUCTURE ITCSY.&lt;/P&gt;&lt;P&gt;DATA : V1 TYPE REGUP-WRBTR,&lt;/P&gt;&lt;P&gt;           V2 TYPE REGUP-WRBTR,&lt;/P&gt;&lt;P&gt;           V3 TYPE REGUP-WRBTR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE INTAB INDEX 1.&lt;/P&gt;&lt;P&gt; V1 = INTAB-VALUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE INTAB INDEX 2.&lt;/P&gt;&lt;P&gt; V2 = INTAB-VALUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V3 = V1 - V2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE V3 TO OUTTAB-VALUE LEFT-JUSTIFIED.&lt;/P&gt;&lt;P&gt;MODIFY OUTTAB INDEX 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give you the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if Helpful.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2007 13:56:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calculating-difference-in-sap-script/m-p/2811396#M657201</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-09-27T13:56:04Z</dc:date>
    </item>
  </channel>
</rss>

