<?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 statement issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757208#M1461046</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;Please check the below logic.&lt;/P&gt;&lt;P&gt;You can create a new work area and internal table as shown below.&lt;/P&gt;&lt;P&gt;Better to avoid select/endselect statement.&lt;/P&gt;&lt;P&gt;Please check and let me know if any further issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="Code"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;select sobid from hrp1001 into wa_hrp1001 where otype = 'NC' and&lt;/P&gt;&lt;P&gt;sclas = 'NB' and&lt;/P&gt;&lt;P&gt;begda = p_start AND&lt;/P&gt;&lt;P&gt;endda = p_end.&lt;/P&gt;&lt;P&gt;append wa_hrp1001 to it_hrp1001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Create a new work area and internal table&lt;/P&gt;&lt;P&gt;*--with correct field type which matches the hrp5126-objid &lt;/P&gt;&lt;P&gt;*--add additional fields which ever required for further processing in the new table and work area&lt;/P&gt;&lt;P&gt;wa_hrp-objid =  wa_hrp1001-sobid.&lt;/P&gt;&lt;P&gt;append  wa_hrp to i_objid.&lt;/P&gt;&lt;P&gt;clear: wa_hrp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF i_objid.[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;SELECT branch city region &lt;/P&gt;&lt;P&gt;        FROM hrp5126 INTO TABLE it_hrp5126&lt;/P&gt;&lt;P&gt;        FOR ALL ENTRIES IN i_objid.&lt;/P&gt;&lt;P&gt;        WHERE otype = 'NB' AND&lt;/P&gt;&lt;P&gt;objid = i_objid-objid and&lt;/P&gt;&lt;P&gt;begda = p_start AND&lt;/P&gt;&lt;P&gt;endda = p_end .&lt;/P&gt;&lt;P&gt;&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;Regards&lt;/P&gt;&lt;P&gt;Shibino&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Apr 2010 07:42:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-06T07:42:06Z</dc:date>
    <item>
      <title>select statement issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757201#M1461039</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;  In the following second select statement in where condition for objid(hrp1001-sobid) value im  having multiple &lt;/P&gt;&lt;P&gt;values(records) but as per my coding it is passing only last value(record).i want to pass all the sobid values.&lt;/P&gt;&lt;P&gt;can u please give me some idea on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select sobid from hrp1001 into wa_hrp1001 where otype = 'NC' and&lt;/P&gt;&lt;P&gt;                                                   sclas = 'NB' and&lt;/P&gt;&lt;P&gt;                                                   begda = p_start AND&lt;/P&gt;&lt;P&gt;                                                   endda = p_end.&lt;/P&gt;&lt;P&gt;   append wa_hrp1001 to it_hrp1001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_hrp1001[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;  SELECT branch city region FROM hrp5126 INTO wa_hrp5126 WHERE otype = 'NB' AND&lt;/P&gt;&lt;P&gt;                                                               objid = wa_hrp1001-sobid and&lt;/P&gt;&lt;P&gt;                                                               begda = p_start AND&lt;/P&gt;&lt;P&gt;                                                               endda = p_end .&lt;/P&gt;&lt;P&gt;    APPEND wa_hrp5126 TO it_hrp5126.&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;shwetha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: please use a more meaningful subject line next time.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Apr 6, 2010 9:18 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 15:15:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757201#M1461039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-05T15:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: select statement issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757202#M1461040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please use for all entries.&lt;/P&gt;&lt;P&gt;check the f1 help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 15:24:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757202#M1461040</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-04-05T15:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: select statement issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757203#M1461041</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 using for all entries sobid and objid are different data types..so it is not accepting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 15:37:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757203#M1461041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-05T15:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: select statement issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757204#M1461042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the following code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select sobid from hrp1001 into table it_hrp1001 where otype = 'NC' and
sclas = 'NB' and
begda = p_start AND
endda = p_end.
append wa_hrp1001 to it_hrp1001.


IF it_hrp1001[] IS NOT INITIAL.
SELECT branch city region 
        FROM hrp5126 INTO TABLE it_hrp5126
        FOR ALL ENTRIES IN it_hrp1001
        WHERE otype = 'NB' AND
objid = it_hrp1001-objid and
begda = p_start AND
endda = p_end .
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 15:39:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757204#M1461042</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-05T15:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: select statement issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757205#M1461043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:BEGIN OF ty,&lt;/P&gt;&lt;P&gt;      sobid(8) TYPE n,&lt;/P&gt;&lt;P&gt;      END OF ty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:wa TYPE ty,&lt;/P&gt;&lt;P&gt;     it TYPE TABLE OF ty,&lt;/P&gt;&lt;P&gt;     it2 TYPE TABLE OF hrp5126.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT sobid FROM hrp1001 INTO TABLE it&lt;/P&gt;&lt;P&gt; WHERE otype = 'NC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;  SELECT * FROM hrp5126 INTO TABLE it2&lt;/P&gt;&lt;P&gt;  FOR ALL ENTRIES IN it&lt;/P&gt;&lt;P&gt;  WHERE objid = it-sobid AND&lt;/P&gt;&lt;P&gt;  otype = 'NB'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 16:21:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757205#M1461043</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-04-05T16:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: select statement issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757206#M1461044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the below points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Fetch all the primary key fields.&lt;/P&gt;&lt;P&gt;2. Make use of for all entries.&lt;/P&gt;&lt;P&gt;3. Sort and delete adjacent duplicates if any.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 23:09:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757206#M1461044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-05T23:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: select statement issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757207#M1461045</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;solved by myself..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx for all..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Apr 2010 07:27:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757207#M1461045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-06T07:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: select statement issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757208#M1461046</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;Please check the below logic.&lt;/P&gt;&lt;P&gt;You can create a new work area and internal table as shown below.&lt;/P&gt;&lt;P&gt;Better to avoid select/endselect statement.&lt;/P&gt;&lt;P&gt;Please check and let me know if any further issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="Code"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;select sobid from hrp1001 into wa_hrp1001 where otype = 'NC' and&lt;/P&gt;&lt;P&gt;sclas = 'NB' and&lt;/P&gt;&lt;P&gt;begda = p_start AND&lt;/P&gt;&lt;P&gt;endda = p_end.&lt;/P&gt;&lt;P&gt;append wa_hrp1001 to it_hrp1001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Create a new work area and internal table&lt;/P&gt;&lt;P&gt;*--with correct field type which matches the hrp5126-objid &lt;/P&gt;&lt;P&gt;*--add additional fields which ever required for further processing in the new table and work area&lt;/P&gt;&lt;P&gt;wa_hrp-objid =  wa_hrp1001-sobid.&lt;/P&gt;&lt;P&gt;append  wa_hrp to i_objid.&lt;/P&gt;&lt;P&gt;clear: wa_hrp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF i_objid.[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;SELECT branch city region &lt;/P&gt;&lt;P&gt;        FROM hrp5126 INTO TABLE it_hrp5126&lt;/P&gt;&lt;P&gt;        FOR ALL ENTRIES IN i_objid.&lt;/P&gt;&lt;P&gt;        WHERE otype = 'NB' AND&lt;/P&gt;&lt;P&gt;objid = i_objid-objid and&lt;/P&gt;&lt;P&gt;begda = p_start AND&lt;/P&gt;&lt;P&gt;endda = p_end .&lt;/P&gt;&lt;P&gt;&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;Regards&lt;/P&gt;&lt;P&gt;Shibino&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Apr 2010 07:42:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-issue/m-p/6757208#M1461046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-06T07:42:06Z</dc:date>
    </item>
  </channel>
</rss>

