<?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 script in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2486216#M560682</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;It is not a problem to print table data in the main window of the script. Here is an example code snippet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT * FROM &amp;lt;dbtab&amp;gt;&lt;/P&gt;&lt;P&gt;INTO TABLE itab&lt;/P&gt;&lt;P&gt;WHERE.................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'OPEN_FORM'&lt;/P&gt;&lt;P&gt;...............................................&lt;/P&gt;&lt;P&gt;...............................................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ELEMENT = ' '&lt;/P&gt;&lt;P&gt;FUNCTION = 'SET'&lt;/P&gt;&lt;P&gt;TYPE = 'BODY'&lt;/P&gt;&lt;P&gt;WINDOW = 'MAIN'&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;ELEMENT = 1&lt;/P&gt;&lt;P&gt;FUNCTION = 2&lt;/P&gt;&lt;P&gt;TYPE = 3&lt;/P&gt;&lt;P&gt;UNOPENED = 4&lt;/P&gt;&lt;P&gt;UNSTARTED = 5&lt;/P&gt;&lt;P&gt;WINDOW = 6&lt;/P&gt;&lt;P&gt;BAD_PAGEFORMAT_FOR_PRINT = 7&lt;/P&gt;&lt;P&gt;SPOOL_ERROR = 8&lt;/P&gt;&lt;P&gt;CODEPAGE = 9&lt;/P&gt;&lt;P&gt;OTHERS = 10&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;ENDLOOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CLOSE_FORM'&lt;/P&gt;&lt;P&gt;.................................................&lt;/P&gt;&lt;P&gt;.................................................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the script you can refer to this itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the same process will not work for a variable window in script. This is because unlike the main window, whenever we call write_form FM for variable window, values are not mapped to script from print program immediately, but when &lt;/P&gt;&lt;P&gt;close_form/end_form FM is called. This means if we loop at an internal table from print progeam and call a variable window inside the loop, only the last row of internal table will be mapped to that variable window of the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more info check this URL.&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;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jul 2007 12:21:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-19T12:21:46Z</dc:date>
    <item>
      <title>sap script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2486215#M560681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can we use tables in sap scripts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 12:18:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2486215#M560681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T12:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: sap script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2486216#M560682</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;It is not a problem to print table data in the main window of the script. Here is an example code snippet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT * FROM &amp;lt;dbtab&amp;gt;&lt;/P&gt;&lt;P&gt;INTO TABLE itab&lt;/P&gt;&lt;P&gt;WHERE.................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'OPEN_FORM'&lt;/P&gt;&lt;P&gt;...............................................&lt;/P&gt;&lt;P&gt;...............................................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ELEMENT = ' '&lt;/P&gt;&lt;P&gt;FUNCTION = 'SET'&lt;/P&gt;&lt;P&gt;TYPE = 'BODY'&lt;/P&gt;&lt;P&gt;WINDOW = 'MAIN'&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;ELEMENT = 1&lt;/P&gt;&lt;P&gt;FUNCTION = 2&lt;/P&gt;&lt;P&gt;TYPE = 3&lt;/P&gt;&lt;P&gt;UNOPENED = 4&lt;/P&gt;&lt;P&gt;UNSTARTED = 5&lt;/P&gt;&lt;P&gt;WINDOW = 6&lt;/P&gt;&lt;P&gt;BAD_PAGEFORMAT_FOR_PRINT = 7&lt;/P&gt;&lt;P&gt;SPOOL_ERROR = 8&lt;/P&gt;&lt;P&gt;CODEPAGE = 9&lt;/P&gt;&lt;P&gt;OTHERS = 10&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;ENDLOOP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CLOSE_FORM'&lt;/P&gt;&lt;P&gt;.................................................&lt;/P&gt;&lt;P&gt;.................................................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the script you can refer to this itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the same process will not work for a variable window in script. This is because unlike the main window, whenever we call write_form FM for variable window, values are not mapped to script from print program immediately, but when &lt;/P&gt;&lt;P&gt;close_form/end_form FM is called. This means if we loop at an internal table from print progeam and call a variable window inside the loop, only the last row of internal table will be mapped to that variable window of the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more info check this URL.&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;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 12:21:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2486216#M560682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T12:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: sap script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2486217#M560683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;refer &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;material regd script&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/sapscripts.htm" target="test_blank"&gt;http://www.sap-img.com/sapscripts.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/sapscripts/a-sample-sap-scripts-reports.htm" target="test_blank"&gt;http://www.sap-img.com/sapscripts/a-sample-sap-scripts-reports.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_crm40/helpdata/en/16/c832857cc111d686e0000086568e5f/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_crm40/helpdata/en/16/c832857cc111d686e0000086568e5f/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;transporting a script&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3705995"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;to test a script&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="484719"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*&lt;STRONG&gt;reward for useful answers&lt;/STRONG&gt;*&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 12:25:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2486217#M560683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T12:25:41Z</dc:date>
    </item>
  </channel>
</rss>

