<?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 from bseg in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695210#M889734</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: tt_bsid like bsid occurs 0 with header line,&lt;/P&gt;&lt;P&gt;           tt_bseg like bseg occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bsid &lt;/P&gt;&lt;P&gt;into table tt_bsid &lt;/P&gt;&lt;P&gt;where kunnr eq i_kunnr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT tt_bsid&lt;/P&gt;&lt;P&gt;  by bukrs&lt;/P&gt;&lt;P&gt;       gjahr&lt;/P&gt;&lt;P&gt;       rebzg&lt;/P&gt;&lt;P&gt;       buzei.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;select * from bseg &lt;/P&gt;&lt;P&gt;into table tt_bseg &lt;/P&gt;&lt;P&gt;for all entries in tt_bsid &lt;/P&gt;&lt;P&gt;where bukrs = tt_bsid-bukrs and &lt;/P&gt;&lt;P&gt;gjahr = tt_bsid-gjahr and &lt;/P&gt;&lt;P&gt;rebzg = tt_bsid-rebzg AND&lt;/P&gt;&lt;P&gt;buzei = tt_bsid-buzei.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR make a INNER JOIN... with the 2 tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: heber rodarte on Apr 14, 2008 9:02 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Apr 2008 13:56:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-14T13:56:09Z</dc:date>
    <item>
      <title>select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695207#M889731</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 my report I have as follow: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
select * from bsid 
into corresponding fields of table tt_bsid 
where kunnr eq i_kunnr. 

select * from bseg 
into corresponding fields of table tt_bseg 
for all entries in tt_bsid 
where bukrs = tt_bsid-bukrs and 
gjahr = tt_bsid-gjahr and 
rebzg = tt_bsid-rebzg. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;but the second select (select from bseg....) run some minutes. &lt;/P&gt;&lt;P&gt;Do you have any idea, in which way prepare correctly the select? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx in advance and best regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 13:47:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695207#M889731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T13:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695208#M889732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;There is no proble with the select statement ( from bseg ).&lt;/P&gt;&lt;P&gt;Normally for selecting data from tables like BSEG , MSEG etc will take so much time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raja.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 13:53:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695208#M889732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T13:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695209#M889733</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;Sort tt_bsid with primary keys before second select statement and select only required fields instead of "*'.&lt;/P&gt;&lt;P&gt;If you are selecting only few fields thn use select into table instead of into corresponding fields of table, but order of fields should be proper.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddhesh S.Tawate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 13:54:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695209#M889733</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T13:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695210#M889734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: tt_bsid like bsid occurs 0 with header line,&lt;/P&gt;&lt;P&gt;           tt_bseg like bseg occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bsid &lt;/P&gt;&lt;P&gt;into table tt_bsid &lt;/P&gt;&lt;P&gt;where kunnr eq i_kunnr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT tt_bsid&lt;/P&gt;&lt;P&gt;  by bukrs&lt;/P&gt;&lt;P&gt;       gjahr&lt;/P&gt;&lt;P&gt;       rebzg&lt;/P&gt;&lt;P&gt;       buzei.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;select * from bseg &lt;/P&gt;&lt;P&gt;into table tt_bseg &lt;/P&gt;&lt;P&gt;for all entries in tt_bsid &lt;/P&gt;&lt;P&gt;where bukrs = tt_bsid-bukrs and &lt;/P&gt;&lt;P&gt;gjahr = tt_bsid-gjahr and &lt;/P&gt;&lt;P&gt;rebzg = tt_bsid-rebzg AND&lt;/P&gt;&lt;P&gt;buzei = tt_bsid-buzei.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR make a INNER JOIN... with the 2 tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: heber rodarte on Apr 14, 2008 9:02 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 13:56:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695210#M889734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T13:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695211#M889735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;While selecting from BSEG (Cluster tables) you need to use proper key for the select. If you check the BSEG primary keys BUKRS&lt;/P&gt;&lt;P&gt;BELNR GJAHR BUZEI. Here you not using full key for the selection,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several index tables - bsis,bsas,bsad,bsik,bsak. Each contains a different subset of columns from table bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 13:56:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695211#M889735</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-04-14T13:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695212#M889736</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;Specify the field names from bseg table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and use below select &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select BUKRS BELNR GJAHR BUZEI from BSEG &lt;/P&gt;&lt;P&gt;          into table it_bseg &lt;/P&gt;&lt;P&gt;          for all entries in tt_bsid&lt;/P&gt;&lt;P&gt;          where BUKRS eq tt_bsid-bukrs &lt;/P&gt;&lt;P&gt;          and    BELNR  eq tt_bsid-belnr&lt;/P&gt;&lt;P&gt;          and    GJAHR  eq tt_bsid-gjahr&lt;/P&gt;&lt;P&gt;          and    BUZEI    eq tt_bsid-BUZEI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use delete statement on it_bseg for unwanted records&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 13:58:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695212#M889736</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T13:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695213#M889737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;please include BSID-BELNR in the BSEG Select. Check also that tt_bsid is not empty beforehand.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 14:00:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695213#M889737</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-04-14T14:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695214#M889738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;hi,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;hi Basically u should not use BSEG tables for selection utill u know the primary keys values .....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;As bseg table stores all the information it takes several minitues to execute...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;there are some views for bseg table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;bsis,bsas,bsid,bsad,bsik,bask&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;find out which will be useful for u and use it.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ur program berformance will increase..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;regards,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;priya&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 14:10:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695214#M889738</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T14:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695215#M889739</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;BSEG is a cluster table, it will have huge data. You need to use all the key fields of BSEG table. Instead of selecting all the fields like * you have choose required fields only for both BSID and BSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You change code as below for retrieving the data from BSEG table.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select &amp;lt;required fields&amp;gt; from bseg 
into table tt_bseg 
for all entries in tt_bsid 
where bukrs = tt_bsid-bukrs and 
belnr =  tt_bsid-belnr and
gjahr = tt_bsid-gjahr and 
buzei = tt_bsid-buzei and
rebzg = tt_bsid-rebzg. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 14:16:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695215#M889739</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T14:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695216#M889740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanx for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but kindly please note, I can't use belnr in the select because I need for one record form bsid some records from bseg with diferenses value in belnr. I can't use gjahr in the select too because one doc from bseg can be in 2007 and second document from bseg can be in 2008 year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 14:20:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695216#M889740</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T14:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695217#M889741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;strange, because one record from BSID points to exactly one record from BSEG. Sorry, I don't understand the underlying logic and thus cannot help further.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 14:23:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695217#M889741</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-04-14T14:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695218#M889742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;H Thomas&lt;/P&gt;&lt;P&gt;you are right&lt;/P&gt;&lt;P&gt;bsid-belnr = bseg-belnr results only one record from bseg&lt;/P&gt;&lt;P&gt;but bsid-rebzg = bseg-rebzg results some records from bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 14:37:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695218#M889742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T14:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695219#M889743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So long as you are looking at customer and/or vendor invoices only, there is a secondary index on REBZG in BSID, BSAD, BSIK and BSAK. You should go against those tables instead. You should also add the company code to all of your SELECTs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 19:54:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695219#M889743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T19:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: select from bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695220#M889744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at this weblog...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Quickly Retrieving FI document Data from BSEG|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/7692] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Apr 2008 20:02:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-bseg/m-p/3695220#M889744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-14T20:02:15Z</dc:date>
    </item>
  </channel>
</rss>

