<?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: Dynamic Where Clause in Loop/Endloop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811769#M41882</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;&lt;/P&gt;&lt;P&gt;Thanks for the suggestions. I have been able to solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arunava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Aug 2004 14:31:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2004-08-26T14:31:07Z</dc:date>
    <item>
      <title>Dynamic Where Clause in Loop/Endloop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811764#M41877</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;&lt;/P&gt;&lt;P&gt;We need to pick up a row from an internal Table but the Where Condition is dynamic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT LT_T_CACHE INTO LS_CACHE WHERE ( LS_CLAUSE ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But is not generating the code. How can we use a dynamic where clause in a Loop/Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we check the &lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Arunava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Aug 2004 11:31:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811764#M41877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-08-25T11:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Where Clause in Loop/Endloop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811765#M41878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo Arunava,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this type of selection is not possible. You can use "WHERE (LS_CLAUSE)" with a SELECT but not with LOOP. One way around this would be to use a transient routine i.e. you generate code for a routine with all your selection criterien and then call the routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's a Web-Log that describes this. If you look in the Web-Logs and look for "transient" you'll find it. Also, there was a message on this theme in this forum. I took part in it so you could either search for my name or for the word "transient".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gerard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Aug 2004 12:06:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811765#M41878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-08-25T12:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Where Clause in Loop/Endloop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811766#M41879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use an IF sentence...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT....&lt;/P&gt;&lt;P&gt;IF &amp;lt;--LS_CLAUSE.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Aug 2004 12:24:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811766#M41879</guid>
      <dc:creator>VXLozano</dc:creator>
      <dc:date>2004-08-25T12:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Where Clause in Loop/Endloop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811767#M41880</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 it is really required, you can generate subroutine pools dynamically at ABAP. Look for the statement &amp;lt;b&amp;gt;"GENERATE SUBROUTINE-POOL FROM..."&amp;lt;/b&amp;gt; at SAPHelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Serdar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Aug 2004 14:42:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811767#M41880</guid>
      <dc:creator>ssimsekler</dc:creator>
      <dc:date>2004-08-25T14:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Where Clause in Loop/Endloop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811768#M41881</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;For the Usage of Dynamic Where Clause in a program,Its better to use the Transient programs,A Transient program is a program written inside a program and ur requirement is met in that program,the syntax used for that program is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generate subroutine pool   &amp;lt;Internal table name&amp;gt;&lt;/P&gt;&lt;P&gt;                    Program_Name.   &lt;/P&gt;&lt;P&gt;                    &amp;#147; To Get the dynamically generated &lt;/P&gt;&lt;P&gt;                      Program Name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the following additions   :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message         &amp;#147;   Contains Error Message&lt;/P&gt;&lt;P&gt;Include         &amp;#147;   Name of the include program&lt;/P&gt;&lt;P&gt;Line            &amp;#147;   Line Number in Transient program&lt;/P&gt;&lt;P&gt;Word            &amp;#147;   Incorrect word that caused the error&lt;/P&gt;&lt;P&gt;Offset          &amp;#147;   Position of the incorrect word&lt;/P&gt;&lt;P&gt;Trace-file.     &amp;#147;   Trace output&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2004 02:05:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811768#M41881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-08-26T02:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Where Clause in Loop/Endloop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811769#M41882</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;&lt;/P&gt;&lt;P&gt;Thanks for the suggestions. I have been able to solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arunava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2004 14:31:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811769#M41882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-08-26T14:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Where Clause in Loop/Endloop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811770#M41883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A small example program in case it is needed: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lt_sflight TYPE TABLE OF sflight,&lt;/P&gt;&lt;P&gt;      ls_sflight TYPE sflight,&lt;/P&gt;&lt;P&gt;      lv_line    TYPE string,&lt;/P&gt;&lt;P&gt;      lt_code    TYPE STANDARD TABLE OF string,&lt;/P&gt;&lt;P&gt;      lv_prg     TYPE char8,&lt;/P&gt;&lt;P&gt;      lv_msg     TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: pa_carid TYPE sflight-carrid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM sflight&lt;/P&gt;&lt;P&gt;         INTO TABLE lt_sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_line = 'REPORT DYN_LOOP.'.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_line = 'FORM DYN_LH.'.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_line = 'data : ls_sflight type sflight.'.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;lv_line = 'data : lt_sflight type table of sflight.'.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_line = 'select * from sflight into table lt_sflight.'.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_line = 'loop at lt_sflight'.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;lv_line = 'into ls_sflight'.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF     pa_carid EQ 'LH'.&lt;/P&gt;&lt;P&gt;  lv_line = `where carrid eq 'LH'.`.&lt;/P&gt;&lt;P&gt;ELSEIF pa_carid EQ 'AA'.&lt;/P&gt;&lt;P&gt;  lv_line = `where carrid eq 'AA'.`.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_line = 'write:/ ls_sflight-carrid,ls_sflight-connid, ls_sflight-fldate.'.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;lv_line = 'endloop.'.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;lv_line = 'ENDFORM.'.&lt;/P&gt;&lt;P&gt;APPEND lv_line TO lt_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GENERATE SUBROUTINE POOL lt_code&lt;/P&gt;&lt;P&gt;                         NAME lv_prg&lt;/P&gt;&lt;P&gt;                         MESSAGE lv_msg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ  0.&lt;/P&gt;&lt;P&gt;  WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'Program', lv_prg, 'is generated'.&lt;/P&gt;&lt;P&gt;  PERFORM dyn_lh IN PROGRAM (lv_prg).&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  WRITE / 'error occured'.&lt;/P&gt;&lt;P&gt;  WRITE lv_msg.&lt;/P&gt;&lt;P&gt;ENDIF.&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;Sükrü&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2004 15:58:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-loop-endloop/m-p/811770#M41883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-09-06T15:58:33Z</dc:date>
    </item>
  </channel>
</rss>

