<?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: select stmt in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711866#M628701</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;#149;	Values can be passed through PERFORM to FORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;	Giving the flexibility to use the same subroutine multiple number of times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax1:  PERFORM  &amp;lt;XXXX&amp;gt; using  &amp;lt;YYY&amp;gt; &lt;/P&gt;&lt;P&gt;				    changing &amp;lt;MMM&amp;gt;&lt;/P&gt;&lt;P&gt;             &lt;/P&gt;&lt;P&gt;            FORM  &amp;lt;XXXX&amp;gt; using &amp;lt;YYY&amp;gt; like &amp;lt;ZZZ&amp;gt;    &lt;/P&gt;&lt;P&gt;        changing &amp;lt;MMM&amp;gt; like &amp;lt;NNN&amp;gt;  - Pass by reference&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM  &amp;lt;XXXX&amp;gt; using value (YYY) like &amp;lt;ZZZ&amp;gt;     - Pass by value, creates another copy of the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example1:&lt;/P&gt;&lt;P&gt;	PERFORM date-invert using in-date&lt;/P&gt;&lt;P&gt;				   Changing out-date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	FORM date-invert using in-date like datum&lt;/P&gt;&lt;P&gt;				&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax2: PERFORM function-name(program) IF FOUND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example2: PERFORM HEADER(FORMPOOL) IF FOUND.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Aug 2007 06:14:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-29T06:14:19Z</dc:date>
    <item>
      <title>select stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711861#M628696</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;Can any one suggest me how to place the below select statement in a subroutine currently which was executing in a loop .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single kappl objky kschl into wa_otype&lt;/P&gt;&lt;P&gt;            from nast&lt;/P&gt;&lt;P&gt;            where kappl = wa_vbrk-kappl&lt;/P&gt;&lt;P&gt;            and objky = wa_vbrk-objky.&lt;/P&gt;&lt;P&gt;            wa_vbrk-kschl = wa_otype-kschl.&lt;/P&gt;&lt;P&gt;we can get wa_... from the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of writing multiple time the same code i want to move this to subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Cheritha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 06:04:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711861#M628696</guid>
      <dc:creator>former_member807739</dc:creator>
      <dc:date>2007-08-29T06:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: select stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711862#M628697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;perform selection using wa.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when u double click on the perform statement, it 'll create a form.&lt;/P&gt;&lt;P&gt;between form and endform statements copy ur code of select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward points if it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        abapuser&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 06:08:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711862#M628697</guid>
      <dc:creator>former_member188827</dc:creator>
      <dc:date>2007-08-29T06:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: select stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711863#M628698</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;from Performance point of view It is better to Write this select statement directly in the LOOP instead of calling a subroutine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so no need to change ur code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if Helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 06:11:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711863#M628698</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-08-29T06:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: select stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711864#M628699</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;there is no need of writing the code in the way u are expecting.the way u have written is the efficient one...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;reward if helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 06:11:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711864#M628699</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T06:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: select stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711865#M628700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;it think that it wud be better for performance if u do the select before the loop by using select for all entries.&lt;/P&gt;&lt;P&gt;then in loop, you just do a read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 06:11:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711865#M628700</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-08-29T06:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: select stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711866#M628701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;#149;	Values can be passed through PERFORM to FORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;	Giving the flexibility to use the same subroutine multiple number of times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax1:  PERFORM  &amp;lt;XXXX&amp;gt; using  &amp;lt;YYY&amp;gt; &lt;/P&gt;&lt;P&gt;				    changing &amp;lt;MMM&amp;gt;&lt;/P&gt;&lt;P&gt;             &lt;/P&gt;&lt;P&gt;            FORM  &amp;lt;XXXX&amp;gt; using &amp;lt;YYY&amp;gt; like &amp;lt;ZZZ&amp;gt;    &lt;/P&gt;&lt;P&gt;        changing &amp;lt;MMM&amp;gt; like &amp;lt;NNN&amp;gt;  - Pass by reference&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM  &amp;lt;XXXX&amp;gt; using value (YYY) like &amp;lt;ZZZ&amp;gt;     - Pass by value, creates another copy of the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example1:&lt;/P&gt;&lt;P&gt;	PERFORM date-invert using in-date&lt;/P&gt;&lt;P&gt;				   Changing out-date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	FORM date-invert using in-date like datum&lt;/P&gt;&lt;P&gt;				&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax2: PERFORM function-name(program) IF FOUND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example2: PERFORM HEADER(FORMPOOL) IF FOUND.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 06:14:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711866#M628701</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T06:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: select stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711867#M628702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Cheritha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Writing Select statement in a loop is not suggestable... it will kill performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use SELECT... FOR ALL ENTRIES IN itab. It will fetch all the related data for itab. Don't use loop... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any way i'm giving procedure for that  also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform routine.&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;form routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single kappl objky kschl into wa_otype&lt;/P&gt;&lt;P&gt;from nast&lt;/P&gt;&lt;P&gt;where kappl = wa_vbrk-kappl&lt;/P&gt;&lt;P&gt;and objky = wa_vbrk-objky.&lt;/P&gt;&lt;P&gt;wa_vbrk-kschl = wa_otype-kschl.&lt;/P&gt;&lt;P&gt;we can get wa_... from the loop.&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;Reward If Helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Sasidhar Reddy Matli.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 06:15:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711867#M628702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T06:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: select stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711868#M628703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cheritha,&lt;/P&gt;&lt;P&gt;Try the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop At t_vbrk into wa_vbrk.&lt;/P&gt;&lt;P&gt; Perform sub_select using wa_vbrk&lt;/P&gt;&lt;P&gt;                              changing wa_otype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt; Form sub_select    p_wa_vbrk type ty_vbrk&lt;/P&gt;&lt;P&gt;                             p_wa_otype type ty_otype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select single kappl objky kschl into p_wa_otype&lt;/P&gt;&lt;P&gt;from nast&lt;/P&gt;&lt;P&gt;where kappl =p_ wa_vbrk-kappl&lt;/P&gt;&lt;P&gt;and objky = p_wa_vbrk-objky.&lt;/P&gt;&lt;P&gt;wa_vbrk-kschl = p_wa_otype-kschl.&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 p_wa_otype will be replicate as wa_otype inthe loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 06:51:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt/m-p/2711868#M628703</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T06:51:16Z</dc:date>
    </item>
  </channel>
</rss>

