<?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 Problem with Select Statement. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/2948141#M695044</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written select statement in INITIALIZATION event, and trying to call that in &lt;/P&gt;&lt;P&gt;Start of Selection(Using LDB ). &lt;/P&gt;&lt;P&gt;I know that once we write select statement in INITIALIZATION then by using READ Table statement we can call where ever we required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done the same but its not picking the data from the Select statement which is decalred in INITIALIZATION event. can any one help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advanace.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Oct 2007 12:39:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-09T12:39:37Z</dc:date>
    <item>
      <title>Problem with Select Statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/2948141#M695044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written select statement in INITIALIZATION event, and trying to call that in &lt;/P&gt;&lt;P&gt;Start of Selection(Using LDB ). &lt;/P&gt;&lt;P&gt;I know that once we write select statement in INITIALIZATION then by using READ Table statement we can call where ever we required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done the same but its not picking the data from the Select statement which is decalred in INITIALIZATION event. can any one help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advanace.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2007 12:39:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/2948141#M695044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-09T12:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Select Statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/2948142#M695045</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;The INITIALIZATION event is run only once, so you should use this event to do something has to be done only once and before the program is completly loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Infact while running this event the SELECTION-SCREEN is not active, so you can't read the data passed to selection-screen:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT Z1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: P_BUKRS LIKE T001-BUKRS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM T001 WHERE BUKRS = P_BUKRS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if you call this report in another report:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUBMIT Z1 WITH P_BUKRS = 'Z001' AND RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The INITIALIZATION event doesn't work because it can't see the selection-screen, for this event P_BUKRS is null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can use this event to inizializate the selection-screen:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;P_BUKRS = 'Z001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this statament is the same of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS P_BUKRS LIKE T001-BUKRS DEFAULT 'Z001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you could initializate the SELECT-OPTION with many data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;SO_BUKRS(3) = 'IEQ'.&lt;/P&gt;&lt;P&gt;SO_BUKRS-LOW = 'Z001'.&lt;/P&gt;&lt;P&gt;APPEND SO_BUKRS.&lt;/P&gt;&lt;P&gt;SO_BUKRS-LOW = 'Z002'.&lt;/P&gt;&lt;P&gt;APPEND SO_BUKRS.&lt;/P&gt;&lt;P&gt;SO_BUKRS-LOW = 'Z003'.&lt;/P&gt;&lt;P&gt;APPEND SO_BUKRS.&lt;/P&gt;&lt;P&gt;..........&lt;/P&gt;&lt;P&gt;SO_BUKRS-LOW = 'Z00N'.&lt;/P&gt;&lt;P&gt;APPEND SO_BUKRS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can't do a select statament in order SELECTION-SCREEN: you should do it in AT SELECTION-SCREEN OUTPUT, this event is always run before showing selection-screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you can do a selection screen based on some constants, for example transaction code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * ZMY_TABLE WHERE CODE = SY-TCODE.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE E..... WITH 'No data in ZMY_TABLE'.&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;vasu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2007 12:42:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-statement/m-p/2948142#M695045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-09T12:42:48Z</dc:date>
    </item>
  </channel>
</rss>

