<?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: reports in SAPScripts in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reports-in-sapscripts/m-p/1882359#M370429</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;Using PEFORM....ENDPERFORM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can call a report to execute a subroutine in the report.&lt;/P&gt;&lt;P&gt;report fetches a matnr from the script and modify by supressing zeroes in the matnr&lt;/P&gt;&lt;P&gt;ex: ltap-matnr = 00000000000000034&lt;/P&gt;&lt;P&gt;gv_matnr = 34&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;/: perform TEST in program ZPROGRAM&lt;/P&gt;&lt;P&gt;/: using &amp;amp;ltap-matnr&amp;amp;&lt;/P&gt;&lt;P&gt;/: changing &amp;amp;gv_matnr&amp;amp;&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;REPORT ZPROGRAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM TEST TABLES tab_in STRUCTURE itcsy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab_out STRUCTURE itcsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : gv_matnr(18).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR gv_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE tab_in WITH KEY 'ITAP_MATNR'.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;input = tab_in-value&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;output = gv_matnr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE tab_out WITH KEY 'GV_MATNR'.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;tab_out-value = gv_matnr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY tab_out INDEX sy-tabix.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u want to run another report then use SUBMIT command in subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;SAB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Feb 2007 16:24:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-05T16:24:57Z</dc:date>
    <item>
      <title>reports in SAPScripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reports-in-sapscripts/m-p/1882358#M370428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please anybody tell me how to call reports in SAP Scripts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Feb 2007 15:58:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reports-in-sapscripts/m-p/1882358#M370428</guid>
      <dc:creator>Sultanuddin</dc:creator>
      <dc:date>2007-02-05T15:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: reports in SAPScripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reports-in-sapscripts/m-p/1882359#M370429</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;Using PEFORM....ENDPERFORM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can call a report to execute a subroutine in the report.&lt;/P&gt;&lt;P&gt;report fetches a matnr from the script and modify by supressing zeroes in the matnr&lt;/P&gt;&lt;P&gt;ex: ltap-matnr = 00000000000000034&lt;/P&gt;&lt;P&gt;gv_matnr = 34&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;/: perform TEST in program ZPROGRAM&lt;/P&gt;&lt;P&gt;/: using &amp;amp;ltap-matnr&amp;amp;&lt;/P&gt;&lt;P&gt;/: changing &amp;amp;gv_matnr&amp;amp;&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;REPORT ZPROGRAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM TEST TABLES tab_in STRUCTURE itcsy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab_out STRUCTURE itcsy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : gv_matnr(18).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR gv_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE tab_in WITH KEY 'ITAP_MATNR'.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;input = tab_in-value&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;output = gv_matnr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE tab_out WITH KEY 'GV_MATNR'.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;tab_out-value = gv_matnr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY tab_out INDEX sy-tabix.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u want to run another report then use SUBMIT command in subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;SAB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Feb 2007 16:24:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reports-in-sapscripts/m-p/1882359#M370429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-05T16:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: reports in SAPScripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reports-in-sapscripts/m-p/1882360#M370430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&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;The system does not execute the PERFORM command within SAPscript replace modules, such as TEXT_SYMBOL_REPLACE or TEXT_INCLUDE_REPLACE. The replace modules can only replace symbol values or resolve include texts, but not interpret SAPscript control commands.&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;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 (&amp;#145;First page&amp;#146;, &amp;#145;Next page&amp;#146;, &amp;#145;Last page&amp;#146;) 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;&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;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;Regards,&lt;/P&gt;&lt;P&gt;Vara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Feb 2007 18:40:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reports-in-sapscripts/m-p/1882360#M370430</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-05T18:40:56Z</dc:date>
    </item>
  </channel>
</rss>

