<?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/2555182#M582284</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     if you are talking about Function modules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then first OPEN_FORM "used to open the form&lt;/P&gt;&lt;P&gt;WRITE_FORM "used to write the content to form&lt;/P&gt;&lt;P&gt;CLOSE_FORM "used to close the form which is opened.&lt;/P&gt;&lt;P&gt;START_FORM "used to start a form&lt;/P&gt;&lt;P&gt;"you can call different layout&lt;/P&gt;&lt;P&gt;END_FORM "used to end the form which was started&lt;/P&gt;&lt;P&gt;CONTROL_FORM "using this you can call control commands&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to find out is through sql trace or runtime analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to read data from &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to check if entries exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Single &lt;/P&gt;&lt;P&gt;You need to mention all the key fields of the table. &lt;/P&gt;&lt;P&gt;No END SELECT required.&lt;/P&gt;&lt;P&gt;More performance compared to upto 1 row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where as UP to 1 row.&lt;/P&gt;&lt;P&gt;YOu can use if you do not have all the primiary key fields available. &lt;/P&gt;&lt;P&gt;END SELECT requeired.&lt;/P&gt;&lt;P&gt;Since all keys are not passing, possiblities of have other rows which satisfies the condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Statement with EndSelect is a loop, which in a single run retrieves a single Record. This Record has to be stored in a Work Area and then appended into an Internal Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Statements without EndSelect is not a loop and it retrieves the whole Record set matching the Criteria in a single shot and has to be Stored in an Internal Table Directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The most important thing to remember about the SELECT SINGLE is&lt;/P&gt;&lt;P&gt;There are several things to remember:&lt;/P&gt;&lt;P&gt;1) It retrieves only one row&lt;/P&gt;&lt;P&gt;2) It does not need an ENDSELECT statement&lt;/P&gt;&lt;P&gt;3) THE FULL KEY OF THE TABLE MUST BE INCLUDED IN &lt;/P&gt;&lt;P&gt;THE WHERE CLAUSE OF THE SELECT STATEMENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points&amp;lt;/b&amp;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>Mon, 09 Jul 2007 07:25:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-09T07:25:49Z</dc:date>
    <item>
      <title>sap script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2555180#M582282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what are the events in sap script print progam.&lt;/P&gt;&lt;P&gt;What is the difference between 'Select single * ' and 'Select upto 1 rows'?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2007 07:22:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2555180#M582282</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-09T07:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: sap script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2555181#M582283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;difference between select single and select up to 1 row&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="1788182"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm" target="test_blank"&gt;http://www.sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2007 07:24:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2555181#M582283</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-09T07:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: sap script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2555182#M582284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     if you are talking about Function modules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then first OPEN_FORM "used to open the form&lt;/P&gt;&lt;P&gt;WRITE_FORM "used to write the content to form&lt;/P&gt;&lt;P&gt;CLOSE_FORM "used to close the form which is opened.&lt;/P&gt;&lt;P&gt;START_FORM "used to start a form&lt;/P&gt;&lt;P&gt;"you can call different layout&lt;/P&gt;&lt;P&gt;END_FORM "used to end the form which was started&lt;/P&gt;&lt;P&gt;CONTROL_FORM "using this you can call control commands&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to find out is through sql trace or runtime analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to read data from &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to check if entries exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Single &lt;/P&gt;&lt;P&gt;You need to mention all the key fields of the table. &lt;/P&gt;&lt;P&gt;No END SELECT required.&lt;/P&gt;&lt;P&gt;More performance compared to upto 1 row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where as UP to 1 row.&lt;/P&gt;&lt;P&gt;YOu can use if you do not have all the primiary key fields available. &lt;/P&gt;&lt;P&gt;END SELECT requeired.&lt;/P&gt;&lt;P&gt;Since all keys are not passing, possiblities of have other rows which satisfies the condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Statement with EndSelect is a loop, which in a single run retrieves a single Record. This Record has to be stored in a Work Area and then appended into an Internal Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Statements without EndSelect is not a loop and it retrieves the whole Record set matching the Criteria in a single shot and has to be Stored in an Internal Table Directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The most important thing to remember about the SELECT SINGLE is&lt;/P&gt;&lt;P&gt;There are several things to remember:&lt;/P&gt;&lt;P&gt;1) It retrieves only one row&lt;/P&gt;&lt;P&gt;2) It does not need an ENDSELECT statement&lt;/P&gt;&lt;P&gt;3) THE FULL KEY OF THE TABLE MUST BE INCLUDED IN &lt;/P&gt;&lt;P&gt;THE WHERE CLAUSE OF THE SELECT STATEMENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points&amp;lt;/b&amp;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>Mon, 09 Jul 2007 07:25:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2555182#M582284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-09T07:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: sap script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2555183#M582285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;done&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jan 2011 05:16:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2555183#M582285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-21T05:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: sap script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2555184#M582286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;User ID's all deleted for answering lazy questions...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jan 2011 07:10:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2555184#M582286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-21T07:10:06Z</dc:date>
    </item>
  </channel>
</rss>

