<?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: Doubt in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042660#M720158</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data : l_i_mkpf type ( as of I_MKPF)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_i_mkpf[] = i_mkpf[].&lt;/P&gt;&lt;P&gt;SORT l_i_mkpf  BY aufnr bwart mblnr.&lt;/P&gt;&lt;P&gt;delete adjacent du[plicates in l_i_mkpf  comparing aufnr bwart mblnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not  l_i_mkpf[] is initial.&lt;/P&gt;&lt;P&gt;select MBLNR &lt;/P&gt;&lt;P&gt;          MJAHR &lt;/P&gt;&lt;P&gt;         BWART &lt;/P&gt;&lt;P&gt;         MATNR &lt;/P&gt;&lt;P&gt;         WERKS &lt;/P&gt;&lt;P&gt;        MENGE &lt;/P&gt;&lt;P&gt;        AUFNR&lt;/P&gt;&lt;P&gt;        from mseg&lt;/P&gt;&lt;P&gt;        into corresponding fields of table itab2&lt;/P&gt;&lt;P&gt;        for all entries l_i_mkpf[] &lt;/P&gt;&lt;P&gt;        where aufnr = l_i_mkpf-aufnr and&lt;/P&gt;&lt;P&gt;        bwart = '261' and&lt;/P&gt;&lt;P&gt;        mblnr = l_i_mkpf-mblnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       if sy-sybrc is initial.&lt;/P&gt;&lt;P&gt;          write : ' U have got all correcponding records'.&lt;/P&gt;&lt;P&gt;       else.&lt;/P&gt;&lt;P&gt;           write : ' selection failed'&lt;/P&gt;&lt;P&gt;       endif.&lt;/P&gt;&lt;P&gt;endif.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also please check that in MKPF and MSEG  common key field is MBLNR. &lt;/P&gt;&lt;P&gt;Hence it would be better to get data from MSEG with the primary key and then delete all the unnecessary data from the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I have wriiten a clear message.&lt;/P&gt;&lt;P&gt;for other issues please write back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep Rocking ,&lt;/P&gt;&lt;P&gt;Pavan. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_mkpf.&lt;/P&gt;&lt;P&gt;select MBLNR MJAHR BWART MATNR WERKS MENGE AUFNR&lt;/P&gt;&lt;P&gt;from mseg&lt;/P&gt;&lt;P&gt;into corresponding fields of table itab2&lt;/P&gt;&lt;P&gt;for all entries in itab&lt;/P&gt;&lt;P&gt;where aufnr = itab-aufnr and&lt;/P&gt;&lt;P&gt;bwart = '261' and&lt;/P&gt;&lt;P&gt;mblnr = i_mkpf-mblnr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Nov 2007 06:09:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-14T06:09:18Z</dc:date>
    <item>
      <title>Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042656#M720154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       I am using the following query, but it reads only one row at a time, how to store another internal table, can i use append statement here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_mkpf.&lt;/P&gt;&lt;P&gt;select MBLNR&lt;/P&gt;&lt;P&gt;       MJAHR&lt;/P&gt;&lt;P&gt;       BWART&lt;/P&gt;&lt;P&gt;       MATNR&lt;/P&gt;&lt;P&gt;       WERKS&lt;/P&gt;&lt;P&gt;       MENGE&lt;/P&gt;&lt;P&gt;       AUFNR&lt;/P&gt;&lt;P&gt;       from mseg&lt;/P&gt;&lt;P&gt;       into corresponding fields of table itab2&lt;/P&gt;&lt;P&gt;             for all entries in itab&lt;/P&gt;&lt;P&gt;             where aufnr = itab-aufnr and&lt;/P&gt;&lt;P&gt;             bwart = '261' and&lt;/P&gt;&lt;P&gt;             mblnr = i_mkpf-mblnr.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajaram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 05:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042656#M720154</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T05:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042657#M720155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not itab[] is initial.&lt;/P&gt;&lt;P&gt;select MBLNR&lt;/P&gt;&lt;P&gt;MJAHR&lt;/P&gt;&lt;P&gt;BWART&lt;/P&gt;&lt;P&gt;MATNR&lt;/P&gt;&lt;P&gt;WERKS&lt;/P&gt;&lt;P&gt;MENGE&lt;/P&gt;&lt;P&gt;AUFNR&lt;/P&gt;&lt;P&gt;from mseg&lt;/P&gt;&lt;P&gt;into corresponding fields of table itab2&lt;/P&gt;&lt;P&gt;for all entries in itab&lt;/P&gt;&lt;P&gt;where aufnr = itab-aufnr and&lt;/P&gt;&lt;P&gt;bwart = '261' .&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT I_MKPF.&lt;/P&gt;&lt;P&gt;Read table itab2 with key mblnr = i_mkpf-mblnr.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;delete itab2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 05:59:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042657#M720155</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2007-11-14T05:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042658#M720156</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;     dont use select statement within loop it is perfomance wise very bad, use for all entries for that and use read statement within loop ad read the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 06:02:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042658#M720156</guid>
      <dc:creator>former_member386202</dc:creator>
      <dc:date>2007-11-14T06:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042659#M720157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The select statement is not for reading data,&lt;/P&gt;&lt;P&gt;it selects data from database and stores it in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in ur statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into corresponding fields of &amp;lt;b&amp;gt;table&amp;lt;/b&amp;gt; itab2,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the use of word &amp;lt;b&amp;gt;table&amp;lt;/b&amp;gt; itself appends as many rows seletced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no need of additional append statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 06:03:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042659#M720157</guid>
      <dc:creator>hymavathi_oruganti</dc:creator>
      <dc:date>2007-11-14T06:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042660#M720158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data : l_i_mkpf type ( as of I_MKPF)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_i_mkpf[] = i_mkpf[].&lt;/P&gt;&lt;P&gt;SORT l_i_mkpf  BY aufnr bwart mblnr.&lt;/P&gt;&lt;P&gt;delete adjacent du[plicates in l_i_mkpf  comparing aufnr bwart mblnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not  l_i_mkpf[] is initial.&lt;/P&gt;&lt;P&gt;select MBLNR &lt;/P&gt;&lt;P&gt;          MJAHR &lt;/P&gt;&lt;P&gt;         BWART &lt;/P&gt;&lt;P&gt;         MATNR &lt;/P&gt;&lt;P&gt;         WERKS &lt;/P&gt;&lt;P&gt;        MENGE &lt;/P&gt;&lt;P&gt;        AUFNR&lt;/P&gt;&lt;P&gt;        from mseg&lt;/P&gt;&lt;P&gt;        into corresponding fields of table itab2&lt;/P&gt;&lt;P&gt;        for all entries l_i_mkpf[] &lt;/P&gt;&lt;P&gt;        where aufnr = l_i_mkpf-aufnr and&lt;/P&gt;&lt;P&gt;        bwart = '261' and&lt;/P&gt;&lt;P&gt;        mblnr = l_i_mkpf-mblnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       if sy-sybrc is initial.&lt;/P&gt;&lt;P&gt;          write : ' U have got all correcponding records'.&lt;/P&gt;&lt;P&gt;       else.&lt;/P&gt;&lt;P&gt;           write : ' selection failed'&lt;/P&gt;&lt;P&gt;       endif.&lt;/P&gt;&lt;P&gt;endif.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also please check that in MKPF and MSEG  common key field is MBLNR. &lt;/P&gt;&lt;P&gt;Hence it would be better to get data from MSEG with the primary key and then delete all the unnecessary data from the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I have wriiten a clear message.&lt;/P&gt;&lt;P&gt;for other issues please write back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep Rocking ,&lt;/P&gt;&lt;P&gt;Pavan. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_mkpf.&lt;/P&gt;&lt;P&gt;select MBLNR MJAHR BWART MATNR WERKS MENGE AUFNR&lt;/P&gt;&lt;P&gt;from mseg&lt;/P&gt;&lt;P&gt;into corresponding fields of table itab2&lt;/P&gt;&lt;P&gt;for all entries in itab&lt;/P&gt;&lt;P&gt;where aufnr = itab-aufnr and&lt;/P&gt;&lt;P&gt;bwart = '261' and&lt;/P&gt;&lt;P&gt;mblnr = i_mkpf-mblnr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 06:09:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt/m-p/3042660#M720158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T06:09:18Z</dc:date>
    </item>
  </channel>
</rss>

