<?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: SAPSCRIPT Math? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565309#M585229</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Math functions can be done in SAPSCRIPT itself&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
/:   DEFINE &amp;amp;A&amp;amp; := 10
/:   DEFINE &amp;amp;B&amp;amp; := 20
/:   ADD &amp;amp;B&amp;amp; TO &amp;amp;A&amp;amp;
*    A = &amp;amp;A&amp;amp;
*    B = &amp;amp;B&amp;amp;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jul 2007 15:24:28 GMT</pubDate>
    <dc:creator>Pawan_Kesari</dc:creator>
    <dc:date>2007-07-23T15:24:28Z</dc:date>
    <item>
      <title>SAPSCRIPT Math?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565305#M585225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to do math functions to field values in the SAPSCRIPT text editor?&lt;/P&gt;&lt;P&gt;In this case I am looking to divide and multiply. Else, does the math need to be done in ABAP and passed to the SAPSCRIPT editor?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                  Thank-You.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 15:14:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565305#M585225</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T15:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAPSCRIPT Math?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565306#M585226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yes you need to do this in the ABAP and pass back to the SCRIPT ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the regular example which you get in the WEB&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to write the same perform and in the program do the MATH operations and pass back the OUTTABLE with the values, then this values will be available in the SCRIPT&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; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 15:17:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565306#M585226</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T15:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAPSCRIPT Math?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565307#M585227</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;    Yes, the Math functions are to be performed in the Subroutine Pool and get back to the script using the ITCSY structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepu.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 15:18:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565307#M585227</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T15:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAPSCRIPT Math?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565308#M585228</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;You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax in a form window: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: PERFORM  TABLES IN_TAB STRUCTURE ITCSY&lt;/P&gt;&lt;P&gt;OUT_TAB STRUCTURE ITCSY.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (&amp;#145;First page&amp;#146;, &amp;#145;Next page&amp;#146;, &amp;#145;Last page&amp;#146;) is printed as local variable symbol. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definition in the SAPscript form: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &amp;amp;PAGE&amp;amp;
/: USING &amp;amp;NEXTPAGE&amp;amp;
/: CHANGING &amp;amp;BARCODE&amp;amp;
/: ENDPERFORM
/
/ &amp;amp;BARCODE&amp;amp;
Coding of the calling ABAP program: 

REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number 
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY &amp;#145;PAGE&amp;#146;.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY &amp;#145;NEXTPAGE&amp;#146;.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY &amp;#145;BARCODE&amp;#146;.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = &amp;#145;|&amp;#146;. "First page 
ELSE.
OUT_PAR-VALUE = &amp;#145;||&amp;#146;. "Next page 
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = &amp;#145;L&amp;#146;. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward all helpful points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ameet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 15:21:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565308#M585228</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T15:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAPSCRIPT Math?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565309#M585229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Math functions can be done in SAPSCRIPT itself&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
/:   DEFINE &amp;amp;A&amp;amp; := 10
/:   DEFINE &amp;amp;B&amp;amp; := 20
/:   ADD &amp;amp;B&amp;amp; TO &amp;amp;A&amp;amp;
*    A = &amp;amp;A&amp;amp;
*    B = &amp;amp;B&amp;amp;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 15:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sapscript-math/m-p/2565309#M585229</guid>
      <dc:creator>Pawan_Kesari</dc:creator>
      <dc:date>2007-07-23T15:24:28Z</dc:date>
    </item>
  </channel>
</rss>

