<?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: DIVISION IN SAPSCRIPT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728396#M633254</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no&lt;/P&gt;&lt;P&gt;this is how u need to give value using define &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;symbol_name&amp;amp; = 'value'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;symbol1&amp;amp; = 'mail' &lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;symbol2&amp;amp; = 'SAP&amp;amp;symbol1&amp;amp;' &lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;symbol1&amp;amp; = 'script' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The purpose of the DEFINE command is to provide a means of making this value assignment a permanent part of the text, so that the values are available again when the text module is called again. This command can also be used to re-assign a new value to a text symbol half-way through the text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Sep 2007 09:14:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-17T09:14:35Z</dc:date>
    <item>
      <title>DIVISION IN SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728392#M633250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IS THIS SYNTAX CORRECT TO GIVE IN SCRIPT FORM. NOT IN THE DRIVER PROGRAM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;TMP&amp;amp;&lt;/P&gt;&lt;P&gt;/: &amp;amp;TMP&amp;amp; = &amp;amp;TABLE1-FIELD1&amp;amp;/&amp;amp;TABLE2-FIELD2&amp;amp;&lt;/P&gt;&lt;P&gt;  IS THIS RIGHT?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 09:02:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728392#M633250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-17T09:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: DIVISION IN SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728393#M633251</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;No, it will not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assigning a Value to a Text Symbol: DEFINE Locate the document in its SAP Library structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Text symbols acquire their values as a result of explicit assignment. To interactively assign text symbols, in the text editor choose Include ® Symbols ® Text. This method is available for all text symbols belonging to a text module as well as those of the associated form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Values defined in this way are lost when the transaction is left. If you want to print the text module again, then you must enter the symbol values again. The purpose of the DEFINE command is to provide a means of making this value assignment a permanent part of the text, so that the values are available again when the text module is called again. This command can also be used to re-assign a new value to a text symbol half-way through the text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;symbol_name&amp;amp; = 'value'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;subject&amp;amp; = 'Your letter of 7/3/95'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value assigned can have a maximal length of 60 characters. It may itself contain other symbols. A symbol contained within the value assigned to another symbol is not replaced with its own value at the point at which the DEFINE command is executed. Rather, this replacement is made when the symbol defined in the DEFINE command is called in the text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's all what DEFINE knows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you might try to write a small ABAP and call it with a perform:&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;P&gt;/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;PAGE&amp;amp;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;NEXTPAGE&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;BARCODE&amp;amp;&lt;/P&gt;&lt;P&gt;/: ENDPERFORM&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/ &amp;amp;BARCODE&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;Coding of the calling ABAP program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT QCJPERFO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY&lt;/P&gt;&lt;P&gt;OUT_PAR STRUCTURE ITCSY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: PAGNUM LIKE SY-TABIX, "page number&lt;/P&gt;&lt;P&gt;NEXTPAGE LIKE SY-TABIX. "number of next page&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE IN_PAR WITH KEY &amp;#145;PAGE&amp;#146;.&lt;/P&gt;&lt;P&gt;CHECK SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;PAGNUM = IN_PAR-VALUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE IN_PAR WITH KEY &amp;#145;NEXTPAGE&amp;#146;.&lt;/P&gt;&lt;P&gt;CHECK SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;NEXTPAGE = IN_PAR-VALUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE OUT_PAR WITH KEY &amp;#145;BARCODE&amp;#146;.&lt;/P&gt;&lt;P&gt;CHECK SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;IF PAGNUM = 1.&lt;/P&gt;&lt;P&gt;OUT_PAR-VALUE = &amp;#145;|&amp;#146;. "First page&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;OUT_PAR-VALUE = &amp;#145;||&amp;#146;. "Next page&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NEXTPAGE = 0.&lt;/P&gt;&lt;P&gt;OUT_PAR-VALUE+2 = &amp;#145;L&amp;#146;. "Flag: last page&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY OUT_PAR INDEX SY-TABIX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &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;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 09:08:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728393#M633251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-17T09:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: DIVISION IN SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728394#M633252</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;We cannot perform any Arithmetic operations on the Symbols in LAYOUT SET. bcoz they are treated as Character type only.&lt;/P&gt;&lt;P&gt;So you need to Call a subroutine in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Text Elements - Call the sub routine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;TMP&amp;amp;&lt;/P&gt;&lt;P&gt;/: PERFORM F_DIV  IN PROGRAM ZREP01&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;TABLE1-FIELD1&amp;amp;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;TABLE1-FIELD2&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;TMP&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; Result = &amp;amp;TMP&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_DEV TABLES INTAB STRUCTURE ITCSY &lt;/P&gt;&lt;P&gt;                                   OUTTAB STRUCTURE ITCSY .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : V1 TYPE I,&lt;/P&gt;&lt;P&gt;            V2 TYPE I,&lt;/P&gt;&lt;P&gt;            RESULT TYPE P DECIMALS 2.&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;CHECK V2 NE 0.  "for Division by 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESULT = V1 / V2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE RESULT TO OUTTAB-VALUE LEFT-JUSTIFIED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY OUTTAB TRANSPORTING VALUE WHERE NAME = 'TMP'.&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;&amp;lt;b&amp;gt;Reward if Helpful.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 09:10:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728394#M633252</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-09-17T09:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: DIVISION IN SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728395#M633253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It is just a separator... Field1 / Field2....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 09:11:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728395#M633253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-17T09:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: DIVISION IN SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728396#M633254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no&lt;/P&gt;&lt;P&gt;this is how u need to give value using define &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;symbol_name&amp;amp; = 'value'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;symbol1&amp;amp; = 'mail' &lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;symbol2&amp;amp; = 'SAP&amp;amp;symbol1&amp;amp;' &lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;symbol1&amp;amp; = 'script' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The purpose of the DEFINE command is to provide a means of making this value assignment a permanent part of the text, so that the values are available again when the text module is called again. This command can also be used to re-assign a new value to a text symbol half-way through the text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 09:14:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728396#M633254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-17T09:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: DIVISION IN SAPSCRIPT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728397#M633255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot do mathematical calculation inside the SAPASCript you have to do it in the following way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;define &amp;amp;TMP&amp;amp; := 0.
perform sub_calc_div in ZSCRIPT_DIVISION using &amp;amp;TABLE1-FIELD1&amp;amp;
                                                                          &amp;amp;TABLE2-FIELD2&amp;amp;
                                                            changing &amp;amp;TMP&amp;amp;.
Endperform. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and inside the Perform Routine u have to write the Logic for division..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope That Helps&lt;/P&gt;&lt;P&gt;Anirban M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2007 09:21:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/division-in-sapscript/m-p/2728397#M633255</guid>
      <dc:creator>former_member480923</dc:creator>
      <dc:date>2007-09-17T09:21:44Z</dc:date>
    </item>
  </channel>
</rss>

