<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926427#M940351</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First check the data of BSEG in se16 for these conditions.&lt;/P&gt;&lt;P&gt; bukrs = t_final-bukrs&lt;/P&gt;&lt;P&gt;AND belnr = t_final-belnr&lt;/P&gt;&lt;P&gt;AND gjahr = t_final-gjahr&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AND koart NE 'K'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem will be because of hilighted condition. Out of 8 records may be only 4 records will be matching(For which koart NE K.) If this is not the case the the problem will be because of duplicates.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For all entries will automatically filters duplicates&lt;/STRONG&gt; Check this also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from above i dont thing there will be any problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 May 2008 07:03:10 GMT</pubDate>
    <dc:creator>vinod_vemuru2</dc:creator>
    <dc:date>2008-05-30T07:03:10Z</dc:date>
    <item>
      <title>select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926424#M940348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am using this piece of code to fetch data from bseg.&lt;/P&gt;&lt;P&gt;but for a aprticular record of t_final it is not picking all the records ofrm bseg,can u tell me why&lt;/P&gt;&lt;P&gt;for example there is record 1 in t_final and for record 1 there are 8 records in  bseg&lt;/P&gt;&lt;P&gt;but it iselectin only 4 records out of 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF  t_final IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT    bukrs&lt;/P&gt;&lt;P&gt;              belnr&lt;/P&gt;&lt;P&gt;              gjahr&lt;/P&gt;&lt;P&gt;              augdt&lt;/P&gt;&lt;P&gt;              koart&lt;/P&gt;&lt;P&gt;              shkzg&lt;/P&gt;&lt;P&gt;              dmbtr&lt;/P&gt;&lt;P&gt;              kostl&lt;/P&gt;&lt;P&gt;              aufnr&lt;/P&gt;&lt;P&gt;              saknr&lt;/P&gt;&lt;P&gt;              hkont&lt;/P&gt;&lt;P&gt;              kunnr&lt;/P&gt;&lt;P&gt;              lifnr&lt;/P&gt;&lt;P&gt;              zfbdt&lt;/P&gt;&lt;P&gt;              projk&lt;/P&gt;&lt;P&gt;              FROM BSEG INTO TABLE t_bseg&lt;/P&gt;&lt;P&gt;              FOR ALL ENTRIES IN t_final&lt;/P&gt;&lt;P&gt;               WHERE bukrs = t_final-bukrs&lt;/P&gt;&lt;P&gt;               AND   belnr = t_final-belnr&lt;/P&gt;&lt;P&gt;               AND   gjahr = t_final-gjahr&lt;/P&gt;&lt;P&gt;               AND   koart NE 'K'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 06:48:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926424#M940348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T06:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926425#M940349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;refer to the below mentioned code....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: vbak, vbap.&lt;/P&gt;&lt;P&gt;select-options: s_vbeln for vbak-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types:&lt;/P&gt;&lt;P&gt;begin of t_vbak,&lt;/P&gt;&lt;P&gt;vbeln like vbak-vbeln,&lt;/P&gt;&lt;P&gt;erdat like vbak-erdat,&lt;/P&gt;&lt;P&gt;ernam type vbak-ernam,&lt;/P&gt;&lt;P&gt;netwr type vbak-netwr,&lt;/P&gt;&lt;P&gt;end of t_vbak,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begin of t_vbap,&lt;/P&gt;&lt;P&gt;vbeln like vbap-vbeln,&lt;/P&gt;&lt;P&gt;posnr like vbap-posnr,&lt;/P&gt;&lt;P&gt;arktx type vbap-arktx,&lt;/P&gt;&lt;P&gt;matnr like vbap-matnr,&lt;/P&gt;&lt;P&gt;meins like vbap-meins,&lt;/P&gt;&lt;P&gt;end of t_vbap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begin of lt_report,&lt;/P&gt;&lt;P&gt;vbeln like vbak-vbeln,&lt;/P&gt;&lt;P&gt;erdat like vbak-erdat,&lt;/P&gt;&lt;P&gt;ernam type vbak-ernam,&lt;/P&gt;&lt;P&gt;netwr type vbak-netwr,&lt;/P&gt;&lt;P&gt;posnr like vbap-posnr,&lt;/P&gt;&lt;P&gt;arktx type vbap-arktx,&lt;/P&gt;&lt;P&gt;matnr like vbap-matnr,&lt;/P&gt;&lt;P&gt;meins like vbap-meins,&lt;/P&gt;&lt;P&gt;end of lt_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;li_vbak type t_vbak occurs 0 with header line,&lt;/P&gt;&lt;P&gt;li_vbap type t_vbap occurs 0 with header line,&lt;/P&gt;&lt;P&gt;t_report type lt_report occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;  select vbeln erdat ernam netwr&lt;/P&gt;&lt;P&gt;           from vbak&lt;/P&gt;&lt;P&gt;           into table li_vbak package size 10 where vbeln in s_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     if not li_vbak[] is initial.&lt;/P&gt;&lt;P&gt;        sort li_vbak by vbeln.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   DELETE ADJACENT DUPLICATES FROM li_vbak.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            select vbeln posnr arktx matnr meins&lt;/P&gt;&lt;P&gt;                from vbap&lt;/P&gt;&lt;P&gt;                   into table li_vbap&lt;/P&gt;&lt;P&gt;                      for all entries in li_vbak&lt;/P&gt;&lt;P&gt;                         where vbeln = li_vbak-vbeln.&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;     loop at li_vbap.&lt;/P&gt;&lt;P&gt;         t_report-vbeln = li_vbap-vbeln.&lt;/P&gt;&lt;P&gt;         t_report-posnr = li_vbap-posnr.&lt;/P&gt;&lt;P&gt;         t_report-arktx = li_vbap-arktx.&lt;/P&gt;&lt;P&gt;         t_report-matnr = li_vbap-matnr.&lt;/P&gt;&lt;P&gt;         t_report-meins = li_vbap-meins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            read table li_vbak with key vbeln = li_vbap-vbeln.&lt;/P&gt;&lt;P&gt;               if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;                   t_report-vbeln = li_vbak-vbeln.&lt;/P&gt;&lt;P&gt;                   t_report-erdat = li_vbak-erdat.&lt;/P&gt;&lt;P&gt;                   t_report-ernam = li_vbak-ernam.&lt;/P&gt;&lt;P&gt;                   t_report-netwr = li_vbak-netwr.&lt;/P&gt;&lt;P&gt;               endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         append t_report.&lt;/P&gt;&lt;P&gt;         clear li_vbap.&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;    refresh: li_vbak, li_vbap.&lt;/P&gt;&lt;P&gt;    sort t_report by vbeln.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; DELETE ADJACENT DUPLICATES FROM t_report.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;   sort t_report by vbeln.&lt;/P&gt;&lt;P&gt;     loop at t_report.&lt;/P&gt;&lt;P&gt;       write: / t_report-vbeln, t_report-erdat, t_report-ernam,&lt;/P&gt;&lt;P&gt;                t_report-netwr, t_report-posnr, t_report-arktx,&lt;/P&gt;&lt;P&gt;                t_report-matnr, t_report-meins.&lt;/P&gt;&lt;P&gt;     endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at t_bseg.
.................................
...........................
Read table t_final........................&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will solve ur prob. Reward all helpful answers,&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sagar@MM on May 30, 2008 2:58 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 06:57:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926425#M940349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T06:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926426#M940350</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 4 records which are not picked might not be satisfying the conditions:&lt;/P&gt;&lt;P&gt;bukrs = t_final-bukrs&lt;/P&gt;&lt;P&gt;AND belnr = t_final-belnr&lt;/P&gt;&lt;P&gt;AND gjahr = t_final-gjahr&lt;/P&gt;&lt;P&gt;AND koart NE 'K'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make sure those 4 records are havign the values same as the compared record from t_final.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 07:01:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926426#M940350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T07:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926427#M940351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First check the data of BSEG in se16 for these conditions.&lt;/P&gt;&lt;P&gt; bukrs = t_final-bukrs&lt;/P&gt;&lt;P&gt;AND belnr = t_final-belnr&lt;/P&gt;&lt;P&gt;AND gjahr = t_final-gjahr&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AND koart NE 'K'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem will be because of hilighted condition. Out of 8 records may be only 4 records will be matching(For which koart NE K.) If this is not the case the the problem will be because of duplicates.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For all entries will automatically filters duplicates&lt;/STRONG&gt; Check this also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from above i dont thing there will be any problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 07:03:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926427#M940351</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-05-30T07:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926428#M940352</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;  Try to retrieve complete primary key combination when use FOR ALL ENTRIES addition to the SELECT statement. So u need to change the declaration of internal table and select query as like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF t_final IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;SELECT bukrs&lt;/P&gt;&lt;P&gt;belnr&lt;/P&gt;&lt;P&gt;gjahr&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BUZEI&lt;/STRONG&gt; &amp;lt;add this field in your internal table declarion&amp;gt;&lt;/P&gt;&lt;P&gt;augdt&lt;/P&gt;&lt;P&gt;koart&lt;/P&gt;&lt;P&gt;shkzg&lt;/P&gt;&lt;P&gt;dmbtr&lt;/P&gt;&lt;P&gt;kostl&lt;/P&gt;&lt;P&gt;aufnr&lt;/P&gt;&lt;P&gt;saknr&lt;/P&gt;&lt;P&gt;hkont&lt;/P&gt;&lt;P&gt;kunnr&lt;/P&gt;&lt;P&gt;lifnr&lt;/P&gt;&lt;P&gt;zfbdt&lt;/P&gt;&lt;P&gt;projk&lt;/P&gt;&lt;P&gt;FROM BSEG INTO TABLE t_bseg&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_final&lt;/P&gt;&lt;P&gt;WHERE bukrs = t_final-bukrs&lt;/P&gt;&lt;P&gt;AND belnr = t_final-belnr&lt;/P&gt;&lt;P&gt;AND gjahr = t_final-gjahr&lt;/P&gt;&lt;P&gt;AND koart NE 'K'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because the for all entries addition always returns the records from table and also will do the delete adjacent duplicates from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Bujji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 07:04:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926428#M940352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T07:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926429#M940353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi as you sed is not fetching for other 4 records ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; It is due to this statement which u wrote ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for all entires&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at that once..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and second the where clause..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Basheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 07:06:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926429#M940353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T07:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926430#M940354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pls check the records by giving the value of the internal table in se16 and see how many records are gettting for that values .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 08:50:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926430#M940354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T08:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926431#M940355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I too agree madhumitha's comment&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 08:52:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926431#M940355</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2008-05-30T08:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926432#M940356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DO Debuging n check in table t_final how many records are comming. If it is having four records only den it will display those four records. &lt;/P&gt;&lt;P&gt;n also check ds condition koart NE 'K'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mehul.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2008 09:15:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select/m-p/3926432#M940356</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-30T09:15:57Z</dc:date>
    </item>
  </channel>
</rss>

