<?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: slect statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246369#M774850</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BSEG is a pooled table so inner join is not possible so try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i m giving one example,&lt;/P&gt;&lt;P&gt;change as per your requirement,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select belnr gjahr budat&lt;/P&gt;&lt;P&gt;            into corresponding fields of table t_head_expense&lt;/P&gt;&lt;P&gt;            from bkpf&lt;/P&gt;&lt;P&gt;            where budat in posdate&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select belnr buzei gjahr hkont dmbtr shkzg sgtxt&lt;/P&gt;&lt;P&gt;            into corresponding fields of table t_expense&lt;/P&gt;&lt;P&gt;            from bseg&lt;/P&gt;&lt;P&gt;            for all entries in t_head_expense&lt;/P&gt;&lt;P&gt;            where belnr = t_head_expense-belnr and gjahr = t_head_expense-gjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arpit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jan 2008 07:20:56 GMT</pubDate>
    <dc:creator>arpit_shah</dc:creator>
    <dc:date>2008-01-03T07:20:56Z</dc:date>
    <item>
      <title>slect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246367#M774848</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; i need to pick the data form  2 tables ( BSEG and BKPF) from BSEG - KUNNR,GSBER, BUKRS  and from BKPF- BUDAT , BLDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to pick the data and on which field basis i need to pick the data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2008 07:13:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246367#M774848</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-03T07:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: slect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246368#M774849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what r u r inputs...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the link beteween these 2 tables are belnr,mjahr,bukrs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first go to header-bkpf and then bseg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2008 07:16:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246368#M774849</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2008-01-03T07:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: slect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246369#M774850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BSEG is a pooled table so inner join is not possible so try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i m giving one example,&lt;/P&gt;&lt;P&gt;change as per your requirement,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select belnr gjahr budat&lt;/P&gt;&lt;P&gt;            into corresponding fields of table t_head_expense&lt;/P&gt;&lt;P&gt;            from bkpf&lt;/P&gt;&lt;P&gt;            where budat in posdate&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select belnr buzei gjahr hkont dmbtr shkzg sgtxt&lt;/P&gt;&lt;P&gt;            into corresponding fields of table t_expense&lt;/P&gt;&lt;P&gt;            from bseg&lt;/P&gt;&lt;P&gt;            for all entries in t_head_expense&lt;/P&gt;&lt;P&gt;            where belnr = t_head_expense-belnr and gjahr = t_head_expense-gjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arpit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2008 07:20:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246369#M774850</guid>
      <dc:creator>arpit_shah</dc:creator>
      <dc:date>2008-01-03T07:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: slect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246370#M774851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for  me inputs is bseg- kunnr, bseg- bukrs,bkpf-dudat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2008 07:21:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246370#M774851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-03T07:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: slect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246371#M774852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can select from &lt;STRONG&gt;BKPF-BELNR,BUKRS&lt;/STRONG&gt; and from&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BSEG-BELNR,BUKRS&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;and you can relate both tables based on these fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2008 07:22:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246371#M774852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-03T07:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: slect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246372#M774853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first select the data from bkpf&lt;/P&gt;&lt;P&gt;use for all entries and retrieve the information form bseg based on bukrs, belnr and gjahr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward point if it is useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Madhavi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2008 07:25:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246372#M774853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-03T07:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: slect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246373#M774854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could link BKPF and BSEG via the primary keys of BKPF &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUKRS&lt;/P&gt;&lt;P&gt;BELNR&lt;/P&gt;&lt;P&gt;GJAHR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But BSEG is a cluster, so some "join" options are unavailable, and if you use some ways to bypass this, performances will be very poor as the database is unable to optimize selection on BSEG (in fact cluster RFBLG), Legacy of old good time, where disk space was costly) (selecting too much records from one table and using the result in a FOR ALL ENTRIES from the second table with the last criteria.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this purpose use the "secondary indexes" for customer account, BSID and BSAD (cleared or not-cleared post, so you have to use 2 select)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then if some fields are missing you can select from BSEG and BKPF the missing fields (via SELECT FOR ALL ENTRIES, using the primary keys  of these tables) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2008 07:28:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246373#M774854</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2008-01-03T07:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: slect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246374#M774855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select bukrs,belnr,gjahr from bkpf &lt;/P&gt;&lt;P&gt;into it_bkpf where &lt;/P&gt;&lt;P&gt;budat = pa_budat  "input &lt;/P&gt;&lt;P&gt;and bukrs = pa_bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;lt; your needed fields&amp;gt; into table itab from bseg for all entries in it_bkpf&lt;/P&gt;&lt;P&gt;where belnr = it_bkpf-belnr&lt;/P&gt;&lt;P&gt;and gjahr = it_bkpf-gjahr&lt;/P&gt;&lt;P&gt;and bukrs = it_bkpf-bukrs.&lt;/P&gt;&lt;P&gt;and kunnr = pa_kunnr  "&amp;lt;--inputs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2008 07:29:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246374#M774855</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2008-01-03T07:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: slect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246375#M774856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT &lt;/P&gt;&lt;P&gt;      BSEG~KUNNR&lt;/P&gt;&lt;P&gt;       BSEG~GSBER&lt;/P&gt;&lt;P&gt;       BSEG~BUKRS&lt;/P&gt;&lt;P&gt;       BKPF~BUDAT&lt;/P&gt;&lt;P&gt;       BKPF~BLDAT&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF TABLE IT_BSEG FROM&lt;/P&gt;&lt;P&gt;       BSEG INNER JOIN BSEG&lt;/P&gt;&lt;P&gt;       ON BSEG&lt;SUB&gt;KUNNR = BKPF&lt;/SUB&gt;KUNNR&lt;/P&gt;&lt;P&gt;       WHERE BSEG~KUNNR IN S_KUNNR.&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;IF NOT IT_BSEG[] IS INITIAL.&lt;/P&gt;&lt;P&gt;  SORT BY IT_BSEG-KUNNR.&lt;/P&gt;&lt;P&gt;  DELETE ADJACENT DUPLICATES FROM IT_BSEG[].&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2008 07:34:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246375#M774856</guid>
      <dc:creator>mahaboob_pathan</dc:creator>
      <dc:date>2008-01-03T07:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: slect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246376#M774857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i write like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select belnr  budat bldat&lt;/P&gt;&lt;P&gt;      into corresponding fields of table It_BKPF&lt;/P&gt;&lt;P&gt;         from bkpf&lt;/P&gt;&lt;P&gt;       where budat in SO_BUDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; IF IT_BKPF IS NOT INITIAL.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    select bukrs belnr shkzg gsber dmbtr sgtxt kunnr&lt;/P&gt;&lt;P&gt;       into corresponding fields of table IT_BSEG&lt;/P&gt;&lt;P&gt;         from bseg&lt;/P&gt;&lt;P&gt;         for all entries in IT_BKPF&lt;/P&gt;&lt;P&gt;          where belnr = IT_BKPF-belnr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am not getiing output for posting date , document date , currency, document no&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2008 08:26:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slect-statement/m-p/3246376#M774857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-03T08:26:08Z</dc:date>
    </item>
  </channel>
</rss>

