<?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: scripts in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/3582404#M862427</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Its an Abap prog of type sub routine pool, it is used for calculating certain variables, eg DUE date for an Invoice. You pass the values from the form thru ITCSY structure inthe prgram. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To calculate totals and sub totals in sap scripts you have to use subroutines. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;TOT_PRICE&amp;amp; &lt;/P&gt;&lt;P&gt;/: PERFORM F_GET_PRICE IN PROGRAM &amp;lt;subroutine prog name&amp;gt; /:USING &amp;amp;KOMVD-KBERT&amp;amp; /:CHANGING &amp;amp;TOT_PRICE&amp;amp; /:ENDPERFORM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then write the variable where ever you want it to be printed (mostly it will be in footer window) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then create subroutine pool program and you have to write the code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM F_GET_PRICE tables int_cond structure itcsy &lt;/P&gt;&lt;P&gt;                                    outt_cond structure itcsy. data : value type kbert. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;statics   value1 type kbert. &lt;/P&gt;&lt;P&gt;Read int_cond table index 1. &lt;/P&gt;&lt;P&gt;value = int_cond-value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value1 = value1 + value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read outt_cond table index 1. &lt;/P&gt;&lt;P&gt;outt_cond-value = value1. &lt;/P&gt;&lt;P&gt;Modify outt_cond index 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2008 05:15:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-25T05:15:05Z</dc:date>
    <item>
      <title>scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/3582402#M862425</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 a subroutine pool in SAP script, when it is used, &lt;/P&gt;&lt;P&gt;give me  with example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 05:08:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/3582402#M862425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T05:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/3582403#M862426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the links.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechnical.com/Tutorials/Smartforms/PassingTableData/Script1.htm" target="test_blank"&gt;http://www.saptechnical.com/Tutorials/Smartforms/PassingTableData/Script1.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.mynewblog.net/software/blogdetails-3710.html" target="test_blank"&gt;http://www.mynewblog.net/software/blogdetails-3710.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://abapprogramming.blogspot.com/2007/11/setting-header-text-in-main-window-top.html" target="test_blank"&gt;http://abapprogramming.blogspot.com/2007/11/setting-header-text-in-main-window-top.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/sapscripts/faq-for-sap-scripts.htm" target="test_blank"&gt;http://www.sap-img.com/sapscripts/faq-for-sap-scripts.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.abapcode.sapbrainsonline.com/2008/03/generate-abap-keyword.html" target="test_blank"&gt;http://www.abapcode.sapbrainsonline.com/2008/03/generate-abap-keyword.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;P&gt;sowjanya.b&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 05:14:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/3582403#M862426</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T05:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/3582404#M862427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Its an Abap prog of type sub routine pool, it is used for calculating certain variables, eg DUE date for an Invoice. You pass the values from the form thru ITCSY structure inthe prgram. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To calculate totals and sub totals in sap scripts you have to use subroutines. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;TOT_PRICE&amp;amp; &lt;/P&gt;&lt;P&gt;/: PERFORM F_GET_PRICE IN PROGRAM &amp;lt;subroutine prog name&amp;gt; /:USING &amp;amp;KOMVD-KBERT&amp;amp; /:CHANGING &amp;amp;TOT_PRICE&amp;amp; /:ENDPERFORM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then write the variable where ever you want it to be printed (mostly it will be in footer window) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then create subroutine pool program and you have to write the code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM F_GET_PRICE tables int_cond structure itcsy &lt;/P&gt;&lt;P&gt;                                    outt_cond structure itcsy. data : value type kbert. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;statics   value1 type kbert. &lt;/P&gt;&lt;P&gt;Read int_cond table index 1. &lt;/P&gt;&lt;P&gt;value = int_cond-value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value1 = value1 + value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read outt_cond table index 1. &lt;/P&gt;&lt;P&gt;outt_cond-value = value1. &lt;/P&gt;&lt;P&gt;Modify outt_cond index 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 05:15:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/3582404#M862427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T05:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/3582405#M862428</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 use Sub Routine Pool (Program) in Scripts when there is a requirement to extend the functionality of the Standard Print Program. ie., When the existing Print Program does not give you the desired output and you have included some new code in the ZForm, then we write the code in the Sub Routine Pool program in SE38. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From Forms--&amp;gt; Text Editor, we use the following stmt to call the Sub Routine code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM Calculate_amount IN PROGRAM Z_SR_FRM001&lt;/P&gt;&lt;P&gt; USING &amp;amp;VAR1&amp;amp; &lt;/P&gt;&lt;P&gt; CHANGING &amp;amp;VAR2&amp;amp;.&lt;/P&gt;&lt;P&gt;(Z_SR_FRM001 is the name of the Sub Routine Pool Program we write in SE38)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the SE38 Editor, we code as following : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  CALCULATE_AMOUNT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  VAR1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  VAR2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM calculate_amount TABLES in_tab STRUCTURE &lt;/P&gt;&lt;P&gt;itcsy out_tab STRUCTURE itcsy.&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;You have to write the required code in the above Form in order to get the desired result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 06:55:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/3582405#M862428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T06:55:21Z</dc:date>
    </item>
  </channel>
</rss>

