<?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: Mseg table data retrival in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917719#M381537</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naresh,&lt;/P&gt;&lt;P&gt;You are writen the query correctly, but you did not maintained the sequence of the fields. we need to maintain the field sequence based on the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if not it_ekko[] is initial.
SELECT mblnr mjahr zeile matnr charg bwart menge dmbtr ebeln ebelp lgort
FROM mseg
INTO TABLE it_mseg
FOR ALL ENTRIES IN it_ekko
WHERE 
&amp;lt;b&amp;gt;werks = '1001'   and 
bwart IN ('961','962') and
lgort = '0001'    and&amp;lt;/b&amp;gt;
ebeln = it_ekko-ebeln
AND ebelp = it_ekko-ebelp.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Feb 2007 15:36:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-14T15:36:59Z</dc:date>
    <item>
      <title>Mseg table data retrival</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917713#M381531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Expert's,&lt;/P&gt;&lt;P&gt;   i am having a proble with this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   SELECT mblnr mjahr zeile matnr charg bwart menge dmbtr ebeln ebelp lgort&lt;/P&gt;&lt;P&gt;    FROM mseg&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE it_mseg&lt;/P&gt;&lt;P&gt;    FOR ALL ENTRIES IN it_ekko&lt;/P&gt;&lt;P&gt;    WHERE ebeln = it_ekko-ebeln&lt;/P&gt;&lt;P&gt;    AND   ebelp = it_ekko-ebelp&lt;/P&gt;&lt;P&gt;    AND   lgort = '0001'&lt;/P&gt;&lt;P&gt;    AND   werks = '1001'&lt;/P&gt;&lt;P&gt;    AND   bwart IN ('961','962').&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;i want to retrive data from mseg table i am having a purchase order &amp;amp; item no ,&lt;/P&gt;&lt;P&gt;Storage location, Plant, Movement type .&lt;/P&gt;&lt;P&gt;if a ma using above query the this query takes  lots of time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Provide me method by with i can retrive data on the given  condition using some other method...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 10:35:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917713#M381531</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T10:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Mseg table data retrival</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917714#M381532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can think of creating index on MSEG for PO/PoItem or use EKBE table to first find out Material doc for all POs and then go to MSEG for details of Material doc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 10:51:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917714#M381532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T10:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Mseg table data retrival</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917715#M381533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naresh,&lt;/P&gt;&lt;P&gt; Make sure if the table it_EKKO is not empty.&lt;/P&gt;&lt;P&gt;Also, sort it_ekko by ebeln and ebelp.&lt;/P&gt;&lt;P&gt;Declare the table it_mseg with the fields in the same order as they are selected from the table. and replace the statement INTO CORRESPONDING FIELDS OF TABLE it_mseg with INTO TABLE it_mseg&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 10:55:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917715#M381533</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T10:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Mseg table data retrival</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917716#M381534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort it_ekko by ebeln ebelp.&lt;/P&gt;&lt;P&gt;and write your select query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 11:02:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917716#M381534</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T11:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Mseg table data retrival</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917717#M381535</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;Change the positions as shown in below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;removed into corresponding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT mblnr mjahr zeile  bwart  matnr charg   lgort dmbtr  menge ebeln ebelp &lt;/P&gt;&lt;P&gt;FROM mseg&lt;/P&gt;&lt;P&gt;INTO TABLE it_mseg&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN it_ekko&lt;/P&gt;&lt;P&gt;WHERE ebeln = it_ekko-ebeln&lt;/P&gt;&lt;P&gt;AND ebelp = it_ekko-ebelp&lt;/P&gt;&lt;P&gt;AND lgort = '0001'&lt;/P&gt;&lt;P&gt;AND werks = '1001'&lt;/P&gt;&lt;P&gt;AND bwart IN ('961','962').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 11:54:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917717#M381535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T11:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Mseg table data retrival</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917718#M381536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naresh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Re write the code i this fashion,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;if not it_ekko[] is initial.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;SELECT mblnr mjahr zeile matnr charg bwart menge dmbtr ebeln ebelp lgort&lt;/P&gt;&lt;P&gt;FROM mseg&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;INTO TABLE it_mseg&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN it_ekko&lt;/P&gt;&lt;P&gt;WHERE ebeln = it_ekko-ebeln&lt;/P&gt;&lt;P&gt;AND ebelp = it_ekko-ebelp&lt;/P&gt;&lt;P&gt;AND lgort = '0001'&lt;/P&gt;&lt;P&gt;AND werks = '1001'&lt;/P&gt;&lt;P&gt;AND bwart IN ('961','962').&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;i have bolded the changes in your code.. &lt;/P&gt;&lt;P&gt;first check whetehr the internal table it_ekko is initial or not and remove the into corresponding fields of table , rather arrange the field in your internal table it_mseg in the order you are selecting from mseg.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 15:26:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917718#M381536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T15:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Mseg table data retrival</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917719#M381537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naresh,&lt;/P&gt;&lt;P&gt;You are writen the query correctly, but you did not maintained the sequence of the fields. we need to maintain the field sequence based on the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if not it_ekko[] is initial.
SELECT mblnr mjahr zeile matnr charg bwart menge dmbtr ebeln ebelp lgort
FROM mseg
INTO TABLE it_mseg
FOR ALL ENTRIES IN it_ekko
WHERE 
&amp;lt;b&amp;gt;werks = '1001'   and 
bwart IN ('961','962') and
lgort = '0001'    and&amp;lt;/b&amp;gt;
ebeln = it_ekko-ebeln
AND ebelp = it_ekko-ebelp.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2007 15:36:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mseg-table-data-retrival/m-p/1917719#M381537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-14T15:36:59Z</dc:date>
    </item>
  </channel>
</rss>

