<?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 condition as range in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764208#M643624</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need the partner information for parvw as WE &amp;amp; ZM. So if vbeln = 123 has 2 rows in VBAP, one for WE and the other for ZM, both should be included in itab. Currently only WE is been added. How to  change this code. Thanks &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    SELECT vbpa~vbeln vbpa~parvw vbpa~pernr vbpa~kunnr adrc~country
      FROM vbpa
      INNER JOIN adrc
      ON adrc~addrnumber = vbpa~adrnr
      INTO TABLE i_vbpa
      FOR ALL ENTRIES IN i_vbak
      WHERE vbpa~vbeln = i_vbak-vbeln
      AND   vbpa~kunnr IN s_kunnr
      AND   vbpa~pernr IN s_pernr
      AND   adrc~country IN s_cntry
      AND ( vbpa~parvw = 'WE' OR vbpa~parvw = 'ZM' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Sep 2007 16:41:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-06T16:41:11Z</dc:date>
    <item>
      <title>condition as range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764208#M643624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need the partner information for parvw as WE &amp;amp; ZM. So if vbeln = 123 has 2 rows in VBAP, one for WE and the other for ZM, both should be included in itab. Currently only WE is been added. How to  change this code. Thanks &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    SELECT vbpa~vbeln vbpa~parvw vbpa~pernr vbpa~kunnr adrc~country
      FROM vbpa
      INNER JOIN adrc
      ON adrc~addrnumber = vbpa~adrnr
      INTO TABLE i_vbpa
      FOR ALL ENTRIES IN i_vbak
      WHERE vbpa~vbeln = i_vbak-vbeln
      AND   vbpa~kunnr IN s_kunnr
      AND   vbpa~pernr IN s_pernr
      AND   adrc~country IN s_cntry
      AND ( vbpa~parvw = 'WE' OR vbpa~parvw = 'ZM' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 16:41:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764208#M643624</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T16:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: condition as range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764209#M643625</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;Your code seems to be ok, if you want to get the details for both WE and ZM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or else you can do as below : Declare a range as below and use the code in the initailzation event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : gr_parvw for vbpa-parvw..&lt;/P&gt;&lt;P&gt;Initialization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gr_parvw-option = 'EQ'.&lt;/P&gt;&lt;P&gt;gr_parvw-sign = 'I'.&lt;/P&gt;&lt;P&gt;gr_parvw-low = 'WE'.&lt;/P&gt;&lt;P&gt;gr_parvw-high = 'WE'.&lt;/P&gt;&lt;P&gt;append gr_parvw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gr_parvw-option = 'EQ'.&lt;/P&gt;&lt;P&gt;gr_parvw-sign = 'I'.&lt;/P&gt;&lt;P&gt;gr_parvw-low = 'ZM'.&lt;/P&gt;&lt;P&gt;gr_parvw-high = 'ZM'.&lt;/P&gt;&lt;P&gt;append gr_parvw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And use this range in your select statement as below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT vbpa&lt;SUB&gt;vbeln vbpa&lt;/SUB&gt;parvw vbpa&lt;SUB&gt;pernr vbpa&lt;/SUB&gt;kunnr adrc~country&lt;/P&gt;&lt;P&gt;      FROM vbpa&lt;/P&gt;&lt;P&gt;      INNER JOIN adrc&lt;/P&gt;&lt;P&gt;      ON adrc&lt;SUB&gt;addrnumber = vbpa&lt;/SUB&gt;adrnr&lt;/P&gt;&lt;P&gt;      INTO TABLE i_vbpa&lt;/P&gt;&lt;P&gt;      FOR ALL ENTRIES IN i_vbak&lt;/P&gt;&lt;P&gt;      WHERE vbpa~vbeln = i_vbak-vbeln&lt;/P&gt;&lt;P&gt;      AND   vbpa~kunnr IN s_kunnr&lt;/P&gt;&lt;P&gt;      AND   vbpa~pernr IN s_pernr&lt;/P&gt;&lt;P&gt;      AND   adrc~country IN s_cntry&lt;/P&gt;&lt;P&gt;      AND  vbpa~parvw in gr_parvw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 16:46:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764209#M643625</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T16:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: condition as range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764210#M643626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would put this into a range table that excludes both these values. It would be easier than trying to apply NOT logic here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are testing for equality on the document number, your SELECT will probably be able to use the index, but I'm not sure about that. You might want to keep this in mind during testing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 16:47:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764210#M643626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T16:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: condition as range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764211#M643627</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;Your code looks fine assuming meet the condition check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
RANGES: r_parvw for vbpa-parw.

r_parvw-sign = 'I'.
r_parvw-option = 'EQ'.
r_parvw-low = 'WE'.
append r_parvw.

r_parvw-sign = 'I'.
r_parvw-option = 'EQ'.
r_parvw-low = 'ZM'.
append r_parvw.


SELECT vbpa~vbeln vbpa~parvw vbpa~pernr vbpa~kunnr adrc~country
      FROM vbpa
      INNER JOIN adrc
      ON adrc~addrnumber = vbpa~adrnr
      INTO TABLE i_vbpa
      FOR ALL ENTRIES IN i_vbak
      WHERE vbpa~vbeln = i_vbak-vbeln
      AND   vbpa~kunnr IN s_kunnr
      AND   vbpa~pernr IN s_pernr
      AND   adrc~country IN s_cntry
      AND   vbpa~parvw IN r_parvw.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 16:49:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764211#M643627</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2007-09-06T16:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: condition as range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764212#M643628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this which is the same as range tbl. I only get values for WE and not ZM&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    SELECT vbpa~vbeln vbpa~parvw vbpa~pernr vbpa~kunnr adrc~country
      FROM vbpa
      INNER JOIN adrc
      ON adrc~addrnumber = vbpa~adrnr
      INTO TABLE i_vbpa
      FOR ALL ENTRIES IN i_vbak
      WHERE vbpa~vbeln = i_vbak-vbeln
      AND   vbpa~kunnr IN s_kunnr
      AND   vbpa~pernr IN s_pernr
      AND   adrc~country IN s_cntry
      AND   vbpa~parvw IN ('WE','ZM').&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 16:49:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764212#M643628</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T16:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: condition as range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764213#M643629</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;There is conversion exit behind domain PARVW please check the value you are passing in the select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_PARVW_INPUT  &lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_PARVW_OUTPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 16:50:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764213#M643629</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-09-06T16:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: condition as range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764214#M643630</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;Try using range as above code by me. I faced this problem once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 16:52:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764214#M643630</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T16:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: condition as range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764215#M643631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT vbpa~vbeln vbpa~parvw vbpa~pernr vbpa~kunnr adrc~country
      FROM vbpa
      INNER JOIN adrc
      ON adrc~addrnumber = vbpa~adrnr
      INTO TABLE i_vbpa
      FOR ALL ENTRIES IN i_vbak
      WHERE vbpa~vbeln = i_vbak-vbeln
      AND   adrc~country IN s_cntry
      AND   vbpa~parvw IN r_parvw.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The inner join on ADRC is causing me the grief. I am looking for partner function employee responsbile (ZM) and ship to (WE). For ZM it does not have a adrnr. How to resolve this. I tried OUTER JOIN but then I cant include the adrc~country condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to reduce access to VBPA to minimum as it already has over 16 ml records. So I would prefer to execute the query in one SELECT rather than two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Megan Flores&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 17:10:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764215#M643631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T17:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: condition as range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764216#M643632</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;Make it this way. due to you don't have proper key to join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT vbeln parvw pernr kunnr 
      FROM vbpa
      INTO TABLE i_vbpa
      FOR ALL ENTRIES IN i_vbak
      WHERE vbpa~vbeln = i_vbak-vbeln
      AND   vbpa~parvw IN r_parvw.

i_vbpa_1[] = i_vbpa[].
sort i_vbpa_1 by adrnr.
delete adjacent duplicates comparing adrnr.
if not i_vbpa_1[] is initial.
  SELECT addrnumber country
      FROM adrc
      INTO TABLE i_adrc
      FOR ALL ENTRIES IN i_vbpa-1
      WHERE addrnumber eq i_vbpa_1-adrnr
      AND   adrc~country IN s_cntry.
endif.

loop at i_vbpa.
  read i_adrc  ..........
  modify country &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;
endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 17:29:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764216#M643632</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-09-06T17:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: condition as range</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764217#M643633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Megan - maybe I'm missing something, but is this what you are looking for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tables vbpa.

ranges: r_parvw for vbpa-parvw.

MOVE 'EQ' TO r_parvw-option.
MOVE 'E'  TO r_parvw-sign.         "&amp;lt;================== note

MOVE 'WE' TO r_parvw-low.
append r_parvw.

MOVE 'ZM' TO r_parvw-low.
append r_parvw.

SELECT vbpa~vbeln vbpa~parvw vbpa~pernr vbpa~kunnr adrc~country
  FROM vbpa
  INNER JOIN adrc
  ON adrc~addrnumber = vbpa~adrnr
  INTO TABLE i_vbpa
  FOR ALL ENTRIES IN i_vbak
  WHERE vbpa~vbeln = i_vbak-vbeln
  AND   vbpa~kunnr IN s_kunnr
  AND   vbpa~pernr IN s_pernr
  AND   adrc~country IN s_cntry
  AND   vbpa~parvw in r_parv.             "&amp;lt;=========== note&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 18:13:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/condition-as-range/m-p/2764217#M643633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T18:13:40Z</dc:date>
    </item>
  </channel>
</rss>

