<?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: please correct this code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-correct-this-code/m-p/2578270#M589371</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;if u have to select the values from itab where vgart = 'WE' only then you have to add the field vgart in the itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select mblnr vgart into table itab1&lt;/P&gt;&lt;P&gt;from mkpf&lt;/P&gt;&lt;P&gt;where budat in s_budat&lt;/P&gt;&lt;P&gt;and vgart in ( 'WE' , 'WO' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select mblnr matnr bwart menge into table lt_menge&lt;/P&gt;&lt;P&gt;from mseg&lt;/P&gt;&lt;P&gt;for all entries in itab1 &lt;/P&gt;&lt;P&gt;where mblnr = lt_we-mblnr&lt;/P&gt;&lt;P&gt;and matnr = it_temp-matnr&lt;/P&gt;&lt;P&gt;and werks = p_werks&lt;/P&gt;&lt;P&gt;and bwart in ('501', '502')&lt;/P&gt;&lt;P&gt;and vgart = 'WE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the best !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Aparna&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Paluri Aparna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jul 2007 11:59:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-30T11:59:15Z</dc:date>
    <item>
      <title>please correct this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-correct-this-code/m-p/2578268#M589369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts please solve this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select mblnr into table itab1&lt;/P&gt;&lt;P&gt;         from mkpf&lt;/P&gt;&lt;P&gt;        where budat in s_budat&lt;/P&gt;&lt;P&gt;          and vgart = 'WE'.&lt;/P&gt;&lt;P&gt;  select mblnr into table itab2&lt;/P&gt;&lt;P&gt;         from mkpf&lt;/P&gt;&lt;P&gt;        where budat in s_budat&lt;/P&gt;&lt;P&gt;          and vgart = 'WO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I modified the above  query as &lt;/P&gt;&lt;P&gt;  select mblnr into table itab1&lt;/P&gt;&lt;P&gt;         from mkpf&lt;/P&gt;&lt;P&gt;        where budat in s_budat&lt;/P&gt;&lt;P&gt;          and ( vgart = 'WE'or vgart = 'WO').&lt;/P&gt;&lt;P&gt;Now please tell me how to modify the below query because we have to select data only from itab1 entries.But in above we selected vgart = 'wo' into itab1.&lt;/P&gt;&lt;P&gt;     select mblnr matnr bwart menge into table lt_menge&lt;/P&gt;&lt;P&gt;             from mseg&lt;/P&gt;&lt;P&gt;             for all entries in itab1.&lt;/P&gt;&lt;P&gt;            where mblnr = lt_we-mblnr&lt;/P&gt;&lt;P&gt;              and matnr = it_temp-matnr&lt;/P&gt;&lt;P&gt;              and werks = p_werks&lt;/P&gt;&lt;P&gt;              and bwart in ('501', '502').&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 11:47:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/please-correct-this-code/m-p/2578268#M589369</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T11:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: please correct this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-correct-this-code/m-p/2578269#M589370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change your code as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select mblnr 
into table itab1
from mkpf
where budat in s_budat
and vgart in ('WE', 'WO').

if not itab1 is initial.
select mblnr matnr bwart menge 
into table lt_menge
from mseg
for all entries in itab1
where mblnr = ltab1-mblnr
and matnr = it_temp-matnr
and werks = p_werks
and bwart in ('501', '502'). 
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 11:50:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/please-correct-this-code/m-p/2578269#M589370</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T11:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: please correct this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-correct-this-code/m-p/2578270#M589371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;if u have to select the values from itab where vgart = 'WE' only then you have to add the field vgart in the itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select mblnr vgart into table itab1&lt;/P&gt;&lt;P&gt;from mkpf&lt;/P&gt;&lt;P&gt;where budat in s_budat&lt;/P&gt;&lt;P&gt;and vgart in ( 'WE' , 'WO' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select mblnr matnr bwart menge into table lt_menge&lt;/P&gt;&lt;P&gt;from mseg&lt;/P&gt;&lt;P&gt;for all entries in itab1 &lt;/P&gt;&lt;P&gt;where mblnr = lt_we-mblnr&lt;/P&gt;&lt;P&gt;and matnr = it_temp-matnr&lt;/P&gt;&lt;P&gt;and werks = p_werks&lt;/P&gt;&lt;P&gt;and bwart in ('501', '502')&lt;/P&gt;&lt;P&gt;and vgart = 'WE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the best !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Aparna&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Paluri Aparna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 11:59:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/please-correct-this-code/m-p/2578270#M589371</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T11:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: please correct this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/please-correct-this-code/m-p/2578271#M589372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shiva,&lt;/P&gt;&lt;P&gt;Can try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define another table say it_tab_we like itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now ur first query:&lt;/P&gt;&lt;P&gt;select mblnr into table itab1&lt;/P&gt;&lt;P&gt;from mkpf&lt;/P&gt;&lt;P&gt;where budat in s_budat&lt;/P&gt;&lt;P&gt;and vgart in ( 'WE', 'WO')..&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Copy the content of itab1 into it_tab_we&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_tab_we[] = itab1[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Now delete all the entries from it_tab_we which are not WE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Delete from it_tab_we where vgart &amp;lt;&amp;gt; 'WE'. "Check the syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Now use it_tab_we as the driver table and use for all entries on it to extract data * from MSEG - For better performance U can sort it_tab_we by mblnr&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select mblnr matnr bwart menge into table lt_menge&lt;/P&gt;&lt;P&gt;from mseg&lt;/P&gt;&lt;P&gt;for all entries in it_tab_we&lt;/P&gt;&lt;P&gt;where mblnr = it_tab_we -mblnr&lt;/P&gt;&lt;P&gt;and matnr = it_temp-matnr&lt;/P&gt;&lt;P&gt;and werks = p_werks&lt;/P&gt;&lt;P&gt;and bwart in ('501', '502'). &lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please close the thraed if the problem is solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 08:56:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/please-correct-this-code/m-p/2578271#M589372</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-31T08:56:18Z</dc:date>
    </item>
  </channel>
</rss>

