<?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: SAP Scripts in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651666#M611248</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Calling ABAP Subroutines: PERFORM &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;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;Syntax in a form window:&lt;/P&gt;&lt;P&gt;/: PERFORM &amp;lt;form&amp;gt; IN PROGRAM &amp;lt;prog&amp;gt;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;INVAR1&amp;amp;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;INVAR2&amp;amp;&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;OUTVAR1&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;OUTVAR2&amp;amp;&lt;/P&gt;&lt;P&gt;......&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;Regards,&lt;/P&gt;&lt;P&gt;Suruchi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Aug 2007 09:43:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-20T09:43:49Z</dc:date>
    <item>
      <title>SAP Scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651663#M611245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ho we can use subroutines in SAP scripts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyoine help with some examples&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 09:33:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651663#M611245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-20T09:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651664#M611246</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;&lt;/P&gt;&lt;P&gt;Syntax in a form window:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: PERFORM &amp;lt;form&amp;gt; IN PROGRAM &amp;lt;prog&amp;gt;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;INVAR1&amp;amp;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;INVAR2&amp;amp;&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;OUTVAR1&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;OUTVAR2&amp;amp;&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;/: ENDPERFORM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM &amp;lt;form&amp;gt; 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;...&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;&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;&lt;/P&gt;&lt;P&gt;Reward if it helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Omkar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 09:35:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651664#M611246</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-20T09:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651665#M611247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;for calling subroutines in script form by using PERFORM --- ENDPERFORM control commandS..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/:PERFORM &amp;lt;name&amp;gt; IN PROGRAM &amp;lt;program_name&amp;gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;/:USING &amp;lt;parameter&amp;gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;/:CHANGING &amp;lt;parameter&amp;gt;&lt;/P&gt;&lt;P&gt; &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;while calling subroutine you must pass one parameter only for one line.&lt;/P&gt;&lt;P&gt;you mus specifies the program name in which subroutine is available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while declaring subroutine, you must define subroutine formal parameters of type structure ITCSY, otherwise error will be raised..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM &amp;lt;name&amp;gt; TABLES &amp;lt;input&amp;gt;  STRUCTURE ITCSY&lt;/P&gt;&lt;P&gt;                                            &amp;lt;output&amp;gt;  STRUCTURE ITCSY.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;here write the logic...&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;Refer this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://aiokeh.wdf.sap.corp:50000/SAPIKS2/contentShow.sap?_SCLASS=IWB_STRUCT&amp;amp;_SLOIO=D2CB3D07455611D189710000E8322D00&amp;amp;IWB_INDUSTRY=SAP_BW&amp;amp;TMP_IWB_TASK=DISPLAY&amp;amp;RELEASE=710&amp;amp;LANGUAGE=EN&amp;amp;_SEQNUM=80&amp;amp;_LOIO=D180318F454211D189710000E8322D00&amp;amp;_CLASS=IWB_EXTHLP" target="test_blank"&gt;http://aiokeh.wdf.sap.corp:50000/SAPIKS2/contentShow.sap?_SCLASS=IWB_STRUCT&amp;amp;_SLOIO=D2CB3D07455611D189710000E8322D00&amp;amp;IWB_INDUSTRY=SAP_BW&amp;amp;TMP_IWB_TASK=DISPLAY&amp;amp;RELEASE=710&amp;amp;LANGUAGE=EN&amp;amp;_SEQNUM=80&amp;amp;_LOIO=D180318F454211D189710000E8322D00&amp;amp;_CLASS=IWB_EXTHLP&lt;/A&gt;&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;Priyanka.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 09:37:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651665#M611247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-20T09:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651666#M611248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Calling ABAP Subroutines: PERFORM &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;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;Syntax in a form window:&lt;/P&gt;&lt;P&gt;/: PERFORM &amp;lt;form&amp;gt; IN PROGRAM &amp;lt;prog&amp;gt;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;INVAR1&amp;amp;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;INVAR2&amp;amp;&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;OUTVAR1&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;OUTVAR2&amp;amp;&lt;/P&gt;&lt;P&gt;......&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;Regards,&lt;/P&gt;&lt;P&gt;Suruchi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 09:43:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651666#M611248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-20T09:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651667#M611249</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;Calling Subroutine from Layout set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Detailed procedure: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. IN THE LAYOUT SET MAIN WINDOW&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: TOP&lt;/P&gt;&lt;P&gt;/E ELE_TOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;PAGE_TOTAL&amp;amp; = '0'&lt;/P&gt;&lt;P&gt;/: ENDTOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: MAIN&lt;/P&gt;&lt;P&gt;/E E&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: PERFORM GET_PAGE_TOTAL IN PROGRAM &amp;lt;YOUR PRINT PROGRAM&amp;gt;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;STVBAK-NETWR&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;PAGE_TOTAL&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;/: BOTTOM&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;'Page total for NETWR = ' , &amp;amp;PAGE_TOTAL&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: ENDBOTTOM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE THIS SUBROTINE IN YOUR PROGRAM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GET_PAGE_TOTAL &lt;/P&gt;&lt;P&gt;TABLE 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 : L_AMT TYPE P DECIMALS 2,&lt;/P&gt;&lt;P&gt;L_TOTAL TYPE P DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read Table INTAB with KEY NAME = 'STVBAK-NETWR'.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;L_AMT = INTAB-VALUE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read Table OUTTAB with KEY NAME = 'PAGE_TOTAL'.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;L_TOTAL = OUTTAB-VALUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ADD L_AMT TO L_TOTAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE L_TOTAL TO OUTTAB-VALUE LEFT-JUSTIFIED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY OUTTAB INDEX SY-TABIX.&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;ENDFORM.&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, 20 Aug 2007 09:49:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/2651667#M611249</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-08-20T09:49:59Z</dc:date>
    </item>
  </channel>
</rss>

