<?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: syntax to call a subroutine in script in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056111#M969623</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;An example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-basis-abap.com/abap/how-to-call-a-subroutine-form-sapscripts.htm" target="test_blank"&gt;http://www.sap-basis-abap.com/abap/how-to-call-a-subroutine-form-sapscripts.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Keerthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Jul 2008 13:47:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-01T13:47:30Z</dc:date>
    <item>
      <title>syntax to call a subroutine in script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056107#M969619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;    How to call a subroutine in script with syntax? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;bbr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 13:40:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056107#M969619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-01T13:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: syntax to call a subroutine in script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056108#M969620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PERFORM &amp;lt;formname&amp;gt; program &amp;lt;progname&amp;gt; using&lt;/P&gt;&lt;P&gt;                                                                     changing.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajasekhar Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 13:42:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056108#M969620</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-01T13:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: syntax to call a subroutine in script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056109#M969621</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;In script, you have this logic:&lt;/P&gt;&lt;P&gt;/: PERFORM F_CALCULA IN PROGRAM ZRFIRFS05&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;FAEDE-NETDT&amp;amp;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;RF140-DATU2&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;DATAVENC&amp;amp;&lt;/P&gt;&lt;P&gt;/: ENDPERFORM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, refer to this link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 13:42:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056109#M969621</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-07-01T13:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: syntax to call a subroutine in script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056110#M969622</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 &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;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;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 (u2018First pageu2019, u2018Next pageu2019, u2018Last pageu2019) 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;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;/ &amp;amp;BARCODE&amp;amp;&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;FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY&lt;/P&gt;&lt;P&gt;OUT_PAR STRUCTURE ITCSY.&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;READ TABLE IN_PAR WITH KEY u2018PAGEu2019.&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;READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.&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;READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.&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 = u2018|u2019. "First page &lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;OUT_PAR-VALUE = u2018||u2019. "Next page &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF NEXTPAGE = 0.&lt;/P&gt;&lt;P&gt;OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;MODIFY OUT_PAR INDEX SY-TABIX.&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;raji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 13:45:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056110#M969622</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-01T13:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: syntax to call a subroutine in script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056111#M969623</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;An example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-basis-abap.com/abap/how-to-call-a-subroutine-form-sapscripts.htm" target="test_blank"&gt;http://www.sap-basis-abap.com/abap/how-to-call-a-subroutine-form-sapscripts.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Keerthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2008 13:47:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-to-call-a-subroutine-in-script/m-p/4056111#M969623</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-01T13:47:30Z</dc:date>
    </item>
  </channel>
</rss>

