<?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 fetching data from mseg select * and select field_list problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536959#M1264784</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when i executing the below select statement the sy-dbcnd = 502.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT *  FROM mseg INTO CORRESPONDING FIELDS OF TABLE imseg
         FOR ALL ENTRIES IN itab
           WHERE bwart IN ('309', '311', '315', '413', '411', '412')
             AND xauto EQ 'X'
             AND matnr EQ itab-matnr
             AND mat_kdauf EQ itab-vbeln
             AND mat_kdpos EQ itab-posnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and when i change field list in place  of * the sy-dbcnd = 369.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT mat_kdauf mat_kdpos matnr kdauf kdpos menge  
          FROM mseg INTO CORRESPONDING FIELDS OF TABLE imseg
         FOR ALL ENTRIES IN itab
           WHERE bwart IN ('309', '311', '315', '413', '411', '412')
             AND xauto EQ 'X'
             AND matnr EQ itab-matnr
             AND mat_kdauf EQ itab-vbeln
             AND mat_kdpos EQ itab-posnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is anyone know what is the reason of fatched record difference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Apr 2009 13:22:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-18T13:22:08Z</dc:date>
    <item>
      <title>fetching data from mseg select * and select field_list problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536959#M1264784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when i executing the below select statement the sy-dbcnd = 502.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT *  FROM mseg INTO CORRESPONDING FIELDS OF TABLE imseg
         FOR ALL ENTRIES IN itab
           WHERE bwart IN ('309', '311', '315', '413', '411', '412')
             AND xauto EQ 'X'
             AND matnr EQ itab-matnr
             AND mat_kdauf EQ itab-vbeln
             AND mat_kdpos EQ itab-posnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and when i change field list in place  of * the sy-dbcnd = 369.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT mat_kdauf mat_kdpos matnr kdauf kdpos menge  
          FROM mseg INTO CORRESPONDING FIELDS OF TABLE imseg
         FOR ALL ENTRIES IN itab
           WHERE bwart IN ('309', '311', '315', '413', '411', '412')
             AND xauto EQ 'X'
             AND matnr EQ itab-matnr
             AND mat_kdauf EQ itab-vbeln
             AND mat_kdpos EQ itab-posnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is anyone know what is the reason of fatched record difference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 13:22:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536959#M1264784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-18T13:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: fetching data from mseg select * and select field_list problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536960#M1264785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In first case only records with &lt;STRONG&gt;xauto = X&lt;/STRONG&gt; are transffered, in second one &lt;STRONG&gt;xauto&lt;/STRONG&gt; is no longer consider as you are not projecting it&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT mat_kdauf mat_kdpos matnr kdauf kdpos menge xauto  "insert xauto here, db should return same result now
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 13:37:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536960#M1264785</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-04-18T13:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: fetching data from mseg select * and select field_list problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536961#M1264786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi NSTomar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you give * there are 502 rows returned. when you give the fields in specific it returned only 369 because there will be no entries for the 133 ( 502 - 369 ) for the these fields but there will be entries in other fields which you are not selecting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Shahid Malayil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 13:38:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536961#M1264786</guid>
      <dc:creator>shahid_malayil1</dc:creator>
      <dc:date>2009-04-18T13:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: fetching data from mseg select * and select field_list problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536962#M1264787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The difference is that in select * u have primary key ..&lt;/P&gt;&lt;P&gt;where as when u are selecting the fields individually the repetition of these fields is not captured.&lt;/P&gt;&lt;P&gt;one way to check it is simple&lt;/P&gt;&lt;P&gt;sort the data fetched from select *  case based on the fields selectes&lt;/P&gt;&lt;P&gt;then delete adjacent  on the same 5 fields &lt;/P&gt;&lt;P&gt;it should give u the same number of entries ..&lt;/P&gt;&lt;P&gt;hope i have made it clear&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 13:49:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536962#M1264787</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-18T13:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: fetching data from mseg select * and select field_list problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536963#M1264788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens in first case is when you do select * the unique entries by table key corresponding to the condition on where fields are fetched.&lt;/P&gt;&lt;P&gt;Whereas in the second case the unique entries by table key present in your field selection corresponding to the condition on where fields are fetched.&lt;/P&gt;&lt;P&gt;So it is always advisable to fetch all the table primary keys in your select statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 14:11:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536963#M1264788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-18T14:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: fetching data from mseg select * and select field_list problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536964#M1264789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The difference is that in select * u have primary key ..&lt;/P&gt;&lt;P&gt;where as when u are selecting the fields individually the repetition of these fields is not captured&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you are trying to say is the number of passed record depend on passed field? &lt;/P&gt;&lt;P&gt;What would then happen if you just write it like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT *  FROM mseg INTO CORRESPONDING FIELDS OF TABLE imseg
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would it be different when you have such statemnt&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT mat_kdauf mat_kdpos matnr kdauf kdpos menge  
          FROM mseg INTO CORRESPONDING FIELDS OF TABLE imseg
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No! because the projected fields simply inform DB interface which fields should he transfer back to ABAP program (to avoid unnecessary network load).&lt;/P&gt;&lt;P&gt;The clause which affects how many records are passed back to the program is this one:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FOR ALL ENTRIES IN itab
WHERE bwart IN ('309', '311', '315', '413', '411', '412')
             AND xauto EQ 'X'
             AND matnr EQ itab-matnr
             AND mat_kdauf EQ itab-vbeln
             AND mat_kdpos EQ itab-posnr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DB interface checks which of these records provided in &lt;EM&gt;itab&lt;/EM&gt; matches the records in DB including the condition in WHERE clause. Then it restricts that hits with another WHERE bwart IN .... and AUTO = 'X'.&lt;/P&gt;&lt;P&gt;At the end only those records are passed back to formulate the result set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore, there will never be reduntant combination of these fields (as long as full key is to be passed back), as DB can't store non-unique records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Apr 2009 14:13:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536964#M1264789</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-04-18T14:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: fetching data from mseg select * and select field_list problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536965#M1264790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;self solved create index&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 May 2009 06:14:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-select-and-select-field-list-problem/m-p/5536965#M1264790</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-30T06:14:51Z</dc:date>
    </item>
  </channel>
</rss>

