<?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: script in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012170#M410808</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;  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; Example:&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;test-form&amp;gt; IN PROGRAM &amp;lt;prog&amp;gt;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;land1&amp;amp;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;spras&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;descpt&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;You can write a select statement within the subroutine of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form test-form using p_land1 p_spras&lt;/P&gt;&lt;P&gt;                    changing p_desc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single descp into p_desc&lt;/P&gt;&lt;P&gt;                            from &amp;lt;table&amp;gt;&lt;/P&gt;&lt;P&gt;                          where land1 = p_land1&lt;/P&gt;&lt;P&gt;                              and spras = p_spras.&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;  Jayaram...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Mar 2007 09:16:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-09T09:16:16Z</dc:date>
    <item>
      <title>script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012167#M410805</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;i have two fields  i.e land1 and spras i want to get the description for that field&lt;/P&gt;&lt;P&gt;(land1).both fields are stored in adrs table only.how to write the perform statemet&lt;/P&gt;&lt;P&gt;to fetch the description  of the field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 09:03:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012167#M410805</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T09:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012168#M410806</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;U need to make use of the table T005T, u get the desription of the land1and T002T for getting the language text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
/: PERFORM DATE IN PROGRAM ZLAND
/: USING &amp;amp;LAND1&amp;amp;
/: USING &amp;amp;SPRAS&amp;amp;
/: CHANGING &amp;amp;LAND1T&amp;amp;
/: CHANGING &amp;amp;SPRAS&amp;amp;
/: ENDPERFORM

In program ZLAND,


form Date tables intab structure itcsy
                 outab structure itcsy.
 
DATA: L_land1 TYPE land1,
      L_spras TYPE SPTXT.

 
read table intab with key name = 'LAND1'.
if sy-subrc = 0.
L_land11 = intab-value. " Select the country text ftom T005T
ENDIF.
 
read table intab with key name = 'SPRAS'.
if sy-subrc = 0.
L_SPRAS = intab-value. " Select the langaue text ftom T002T
ENDIF.

move the values to outtab.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If useful reward.&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 09:13:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012168#M410806</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T09:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012169#M410807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In script write :&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;A1&amp;amp; = ' '&lt;/P&gt;&lt;P&gt;/:PERFORM GET_LANDX IN PROGRAM &amp;lt; Prog Name&amp;gt;&lt;/P&gt;&lt;P&gt;/:USING &amp;amp;Table/Structure -LAND1&amp;amp;&lt;/P&gt;&lt;P&gt;/:CHANGING &amp;amp;A1&amp;amp;&lt;/P&gt;&lt;P&gt;/:ENDPERFORM&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;amp;A1&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In the program write:&lt;/P&gt;&lt;P&gt;form get_landx tables in_par structure itcsy out_par structure itcsy.&lt;/P&gt;&lt;P&gt;data v_landx like t005t-landx, v_land1(3).&lt;/P&gt;&lt;P&gt;clear: v_land1, v_landx.&lt;/P&gt;&lt;P&gt; read table in_par with key &amp;lt;field of Land1).&lt;/P&gt;&lt;P&gt; if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;   v_land1 = in_par-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select landx from t005t&lt;/P&gt;&lt;P&gt;      into v_landx&lt;/P&gt;&lt;P&gt;       where land1= v_land1 and&lt;/P&gt;&lt;P&gt;                spras = sy-langu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      out_par-name = 'A1'.&lt;/P&gt;&lt;P&gt;      out_par-value = v_landx.&lt;/P&gt;&lt;P&gt;      append out_par.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 09:15:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012169#M410807</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T09:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012170#M410808</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;  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; Example:&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;test-form&amp;gt; IN PROGRAM &amp;lt;prog&amp;gt;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;land1&amp;amp;&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;spras&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;descpt&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;You can write a select statement within the subroutine of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form test-form using p_land1 p_spras&lt;/P&gt;&lt;P&gt;                    changing p_desc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single descp into p_desc&lt;/P&gt;&lt;P&gt;                            from &amp;lt;table&amp;gt;&lt;/P&gt;&lt;P&gt;                          where land1 = p_land1&lt;/P&gt;&lt;P&gt;                              and spras = p_spras.&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;  Jayaram...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 09:16:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012170#M410808</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T09:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012171#M410809</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;    If you still have doubts..just go thru this example.&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;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;&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;&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;Regards,&lt;/P&gt;&lt;P&gt;  Jayaram...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 09:20:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/script/m-p/2012171#M410809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T09:20:05Z</dc:date>
    </item>
  </channel>
</rss>

