<?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: where condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424077#M203291</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;You are useing :&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;mblnr a&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;menge a&lt;/SUB&gt;lifnr&lt;/P&gt;&lt;P&gt;b~budat&lt;/P&gt;&lt;P&gt;into table it_mseg&lt;/P&gt;&lt;P&gt;from mseg as a&lt;/P&gt;&lt;P&gt;join mkpf as b&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;where werks = p_werks and&lt;/P&gt;&lt;P&gt;budat = s_budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;mblnr a&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;menge a&lt;/SUB&gt;lifnr&lt;/P&gt;&lt;P&gt;b~budat&lt;/P&gt;&lt;P&gt;into table it_mseg&lt;/P&gt;&lt;P&gt;from mseg as a&lt;/P&gt;&lt;P&gt;join mkpf as b&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;where werks in p_werks and&lt;/P&gt;&lt;P&gt;budat in s_budat.&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;select maktx from makt into &lt;/P&gt;&lt;P&gt;table it_mseg3 &lt;/P&gt;&lt;P&gt;for all entries in it_mseg2&lt;/P&gt;&lt;P&gt;where( matnr in it_mseg-matnr)&lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;Please try  IN in all select it's beauty of it is  that it take all the conditions as equal, single, between etc. use it in all of your select IN as I show above.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Ankur Garg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ankur Garg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jul 2006 07:26:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-19T07:26:45Z</dc:date>
    <item>
      <title>where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424075#M203289</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;   i want to get the values of maktx from makt table but i doesn't find any common field in zmigo-addition and lifnr.So can i take condition form my first (it_mseg)&lt;/P&gt;&lt;P&gt;shall i get my values according to where condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables: mseg,mkpf,lfa1,ekko,ekpo,bseg,bkpf,zmigo_addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1 with frame title text-001.&lt;/P&gt;&lt;P&gt;parameters: p_werks like mseg-werks.&lt;/P&gt;&lt;P&gt;select-options: s_budat for Mkpf-budat.&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types:begin     of  typ_mseg,&lt;/P&gt;&lt;P&gt;      p_werks   type  werks_d,   "Plant location&lt;/P&gt;&lt;P&gt;      mblnr     type  mblnr,      "Number of Material Document&lt;/P&gt;&lt;P&gt;      s_budat   type  budat,     "Posting date in document&lt;/P&gt;&lt;P&gt;      mtsnr     type  mtsnr1,    "Number of external material slip&lt;/P&gt;&lt;P&gt;      maktx     type  maktx,     "Material description&lt;/P&gt;&lt;P&gt;      menge     type  menge_d,   "Quantity&lt;/P&gt;&lt;P&gt;      lifnr     type  lifnr,     "Vendor Number&lt;/P&gt;&lt;P&gt;      name1     type  name1_gp,  "Name1&lt;/P&gt;&lt;P&gt;      name2     type  name2_gp,  "Name2&lt;/P&gt;&lt;P&gt;      telf1     type  telf1,     "Telephone number&lt;/P&gt;&lt;P&gt;      trnam     type  ztrnam,    "Transporter name&lt;/P&gt;&lt;P&gt;      glano     type  zglano,    "GR/LR/AWB  No&lt;/P&gt;&lt;P&gt;      J_1ICSTNO type  J_1ICSTNO, "Central Sales Tax Number&lt;/P&gt;&lt;P&gt;      J_1ILSTNO type  J_1ILSTNO, "Local Sales Tax Number&lt;/P&gt;&lt;P&gt;      J_1IEXRN  type  J_1IEXRN , "Excise Registration Number&lt;/P&gt;&lt;P&gt;      end of typ_mseg.&lt;/P&gt;&lt;P&gt;data: it_mseg type standard table of typ_mseg initial size 0,&lt;/P&gt;&lt;P&gt;      it_mseg1 type standard table of typ_mseg initial size 0,&lt;/P&gt;&lt;P&gt;      it_mseg2 type standard table of typ_mseg initial size 0,&lt;/P&gt;&lt;P&gt;      it_mseg3 type standard table of typ_mseg initial size 0,&lt;/P&gt;&lt;P&gt;      wa_mseg like line of it_mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;mblnr a&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;       a&lt;SUB&gt;menge a&lt;/SUB&gt;lifnr&lt;/P&gt;&lt;P&gt;       b~budat&lt;/P&gt;&lt;P&gt;       into table it_mseg&lt;/P&gt;&lt;P&gt;       from mseg as a&lt;/P&gt;&lt;P&gt;       join mkpf as b&lt;/P&gt;&lt;P&gt;       on a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;       where werks = p_werks and&lt;/P&gt;&lt;P&gt;             budat = s_budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it_mseg[] is not initial.&lt;/P&gt;&lt;P&gt;select lifnr name1 name2 telf1&lt;/P&gt;&lt;P&gt;       into table it_mseg1&lt;/P&gt;&lt;P&gt;       from lfa1&lt;/P&gt;&lt;P&gt;       for all entries in it_mseg&lt;/P&gt;&lt;P&gt;       where lifnr = it_mseg-lifnr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it_mseg1[] is not initial.&lt;/P&gt;&lt;P&gt;select trnam glano lifnr&lt;/P&gt;&lt;P&gt;       into table it_mseg2&lt;/P&gt;&lt;P&gt;       from zmigo_addition&lt;/P&gt;&lt;P&gt;       for all entries in it_mseg1&lt;/P&gt;&lt;P&gt;       where lifnr = it_mseg1-lifnr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it_mseg2[] is not initial.&lt;/P&gt;&lt;P&gt;select maktx from makt into &lt;/P&gt;&lt;P&gt;       table it_mseg3 &lt;/P&gt;&lt;P&gt;       for all entries in it_mseg2&lt;/P&gt;&lt;P&gt;       where&amp;lt;b&amp;gt;( matnr = it_mseg-matnr)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 07:21:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424075#M203289</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-19T07:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424076#M203290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if it_mseg2[] is not initial.&lt;/P&gt;&lt;P&gt;select maktx from makt into &lt;/P&gt;&lt;P&gt;table it_mseg3 &lt;/P&gt;&lt;P&gt;for all entries in &amp;lt;b&amp;gt;it_mseg&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;where matnr = it_mseg-matnr&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 07:23:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424076#M203290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-19T07:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424077#M203291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;You are useing :&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;mblnr a&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;menge a&lt;/SUB&gt;lifnr&lt;/P&gt;&lt;P&gt;b~budat&lt;/P&gt;&lt;P&gt;into table it_mseg&lt;/P&gt;&lt;P&gt;from mseg as a&lt;/P&gt;&lt;P&gt;join mkpf as b&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;where werks = p_werks and&lt;/P&gt;&lt;P&gt;budat = s_budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;mblnr a&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;menge a&lt;/SUB&gt;lifnr&lt;/P&gt;&lt;P&gt;b~budat&lt;/P&gt;&lt;P&gt;into table it_mseg&lt;/P&gt;&lt;P&gt;from mseg as a&lt;/P&gt;&lt;P&gt;join mkpf as b&lt;/P&gt;&lt;P&gt;on a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr&lt;/P&gt;&lt;P&gt;where werks in p_werks and&lt;/P&gt;&lt;P&gt;budat in s_budat.&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;select maktx from makt into &lt;/P&gt;&lt;P&gt;table it_mseg3 &lt;/P&gt;&lt;P&gt;for all entries in it_mseg2&lt;/P&gt;&lt;P&gt;where( matnr in it_mseg-matnr)&lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;Please try  IN in all select it's beauty of it is  that it take all the conditions as equal, single, between etc. use it in all of your select IN as I show above.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Ankur Garg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ankur Garg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 07:26:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424077#M203291</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-19T07:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424078#M203292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The where clause has to be changed.&lt;/P&gt;&lt;P&gt;Cant give one table in FOR ALL ENTRIES and compare the other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF it_mseg2[] IS NOT INITIAL.
  SELECT maktx FROM makt INTO
  TABLE it_mseg3
  FOR ALL ENTRIES IN &amp;lt;b&amp;gt;it_mseg2&amp;lt;/b&amp;gt;
  where( &amp;lt;b&amp;gt;matnr = it_mseg2-matnr&amp;lt;/b&amp;gt;).
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your Where Cond  &amp;lt;b&amp;gt;matnr = it_mseg-matnr&amp;lt;/b&amp;gt; will comapre matnr field with data in &amp;lt;b&amp;gt;it_mseg header line&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 07:27:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424078#M203292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-19T07:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: where condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424079#M203293</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;   you are checking For all entries in it_mseg2 but comparing Matnr with it_mseg-matnr... so compare with &amp;lt;b&amp;gt;it_mseg2-matnr&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if it_mseg2[] is not initial.&lt;/P&gt;&lt;P&gt;select maktx &lt;/P&gt;&lt;P&gt;       from makt&lt;/P&gt;&lt;P&gt;       into table it_mseg3 &lt;/P&gt;&lt;P&gt;       for all entries in &amp;lt;b&amp;gt;it_mseg2&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;       where( matnr = &amp;lt;b&amp;gt;it_mseg2&amp;lt;/b&amp;gt;-matnr)&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 09:14:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/where-condition/m-p/1424079#M203293</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-19T09:14:15Z</dc:date>
    </item>
  </channel>
</rss>

