<?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 sap script subroutine in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-subroutine/m-p/2774257#M646556</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my requirement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to divide the DMBTR field (currency) by MENGE field (quantity).I gave the perform endperform in script. Now i am coding the subroutine . this is what i've coded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form f_division&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 BSEG-DMBTR,&lt;/P&gt;&lt;P&gt;       V2 TYPE BSEG-MENGE,&lt;/P&gt;&lt;P&gt;       V3(13) TYPE C,&lt;/P&gt;&lt;P&gt;       RESULT TYPE P DECIMALS 2.&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;Replace "," with "." into v3.&lt;/P&gt;&lt;P&gt; v1  =  v3.&lt;/P&gt;&lt;P&gt;&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;Replace "," with "." into v3.&lt;/P&gt;&lt;P&gt; v2 = v3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF V2 NE 0 OR NOT V2 IS INITIAL. "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;ENDIF.&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;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i've assigned V1 to dmbtr and V2 to menge. The v3(13)  is a temporary variable i introduced so that the format of dmtbr is &amp;lt;b&amp;gt;12,98&amp;lt;/b&amp;gt; is changed to &amp;lt;u&amp;gt;&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;12.98&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt; .ie. the comma is changed to a point(fullstop). Now that i coded this i get an error stating "IN EXPECTED AFTER V1". plz temme how do i go abt this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Sep 2007 06:09:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-18T06:09:13Z</dc:date>
    <item>
      <title>sap script subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-subroutine/m-p/2774257#M646556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my requirement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to divide the DMBTR field (currency) by MENGE field (quantity).I gave the perform endperform in script. Now i am coding the subroutine . this is what i've coded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form f_division&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 BSEG-DMBTR,&lt;/P&gt;&lt;P&gt;       V2 TYPE BSEG-MENGE,&lt;/P&gt;&lt;P&gt;       V3(13) TYPE C,&lt;/P&gt;&lt;P&gt;       RESULT TYPE P DECIMALS 2.&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;Replace "," with "." into v3.&lt;/P&gt;&lt;P&gt; v1  =  v3.&lt;/P&gt;&lt;P&gt;&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;Replace "," with "." into v3.&lt;/P&gt;&lt;P&gt; v2 = v3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF V2 NE 0 OR NOT V2 IS INITIAL. "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;ENDIF.&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;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i've assigned V1 to dmbtr and V2 to menge. The v3(13)  is a temporary variable i introduced so that the format of dmtbr is &amp;lt;b&amp;gt;12,98&amp;lt;/b&amp;gt; is changed to &amp;lt;u&amp;gt;&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;12.98&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt; .ie. the comma is changed to a point(fullstop). Now that i coded this i get an error stating "IN EXPECTED AFTER V1". plz temme how do i go abt this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2007 06:09:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-subroutine/m-p/2774257#M646556</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-18T06:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: sap script subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-subroutine/m-p/2774258#M646557</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; IF USE THE FOLLWING CODE IT WORKS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 LIKE bseg-dmbtr,&lt;/P&gt;&lt;P&gt;       v2 LIKE bseg-menge,&lt;/P&gt;&lt;P&gt;       TEMP1(255) TYPE C,&lt;/P&gt;&lt;P&gt;       TEMP2(255) TYPE C,&lt;/P&gt;&lt;P&gt;       result TYPE p DECIMALS 2.&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;TEMP1 = intab-value+242(13).&lt;/P&gt;&lt;P&gt;v1 =  TEMP1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE intab INDEX 2.&lt;/P&gt;&lt;P&gt;TEMP2 = intab-value+242(13).&lt;/P&gt;&lt;P&gt; v2 = temp2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF v2 NE 0 OR NOT v2 IS INITIAL. "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;ENDIF.&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;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " f_division&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2007 08:31:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-subroutine/m-p/2774258#M646557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-18T08:31:10Z</dc:date>
    </item>
  </channel>
</rss>

