<?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: Conditions problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885552#M677809</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 this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT lfsta&lt;/P&gt;&lt;P&gt;fksaa&lt;/P&gt;&lt;P&gt;gbsta FROM vbup INTO TABLE t_vbup&lt;/P&gt;&lt;P&gt;WHERE vbeln = vbap-vbeln AND&lt;/P&gt;&lt;P&gt;posnr = vbap-posnr AND&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;lfsta IN s_status or&lt;/P&gt;&lt;P&gt;gbsta IN s_bilst or&lt;/P&gt;&lt;P&gt;fksaa IN s_bilst ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Dharmishta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Sep 2007 04:33:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-20T04:33:04Z</dc:date>
    <item>
      <title>Conditions problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885548#M677805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi every one,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my requirement is as below.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT lfsta&lt;/P&gt;&lt;P&gt;             fksaa&lt;/P&gt;&lt;P&gt;             gbsta FROM vbup INTO TABLE t_vbup&lt;/P&gt;&lt;P&gt;             WHERE vbeln = vbap-vbeln AND&lt;/P&gt;&lt;P&gt;             posnr = vbap-posnr AND&lt;/P&gt;&lt;P&gt;             lfsta IN s_status AND&lt;/P&gt;&lt;P&gt;             gbsta IN s_bilst AND&lt;/P&gt;&lt;P&gt;             fksaa IN s_bilst.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF  sy-subrc NE 0 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        SELECT lfsta&lt;/P&gt;&lt;P&gt;               fksaa&lt;/P&gt;&lt;P&gt;               gbsta FROM vbup INTO TABLE t_vbup&lt;/P&gt;&lt;P&gt;               WHERE vbeln = vbap-vbeln AND&lt;/P&gt;&lt;P&gt;               posnr = vbap-posnr AND&lt;/P&gt;&lt;P&gt;               lfsta IN s_status AND&lt;/P&gt;&lt;P&gt;               fksaa IN s_bilst.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ELSEIF sy-subrc NE  0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        SELECT lfsta&lt;/P&gt;&lt;P&gt;               fksaa&lt;/P&gt;&lt;P&gt;               gbsta FROM vbup INTO TABLE t_vbup&lt;/P&gt;&lt;P&gt;               WHERE vbeln = vbap-vbeln AND&lt;/P&gt;&lt;P&gt;               posnr = vbap-posnr AND&lt;/P&gt;&lt;P&gt;               lfsta IN s_status AND&lt;/P&gt;&lt;P&gt;               gbsta IN s_bilst.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when the first query fails it should check in second and then if it fails then it should check in third.....all the conditions for first to entries are satisfying and my logic is working gud.....but there is a problem in third query if never populates into table......but when i take this query out of the if and elseif condition it works properly but my requirement fails for the given scenario.....how can  i make this third qurey work properly without effecting my scenario requirement.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 21:43:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885548#M677805</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T21:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Conditions problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885549#M677806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT lfsta&lt;/P&gt;&lt;P&gt;fksaa&lt;/P&gt;&lt;P&gt;gbsta FROM vbup INTO TABLE t_vbup&lt;/P&gt;&lt;P&gt;WHERE vbeln = vbap-vbeln AND&lt;/P&gt;&lt;P&gt;posnr = vbap-posnr AND&lt;/P&gt;&lt;P&gt;lfsta IN s_status AND&lt;/P&gt;&lt;P&gt;gbsta IN s_bilst AND&lt;/P&gt;&lt;P&gt;fksaa IN s_bilst.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT lfsta&lt;/P&gt;&lt;P&gt;fksaa&lt;/P&gt;&lt;P&gt;gbsta FROM vbup INTO TABLE t_vbup&lt;/P&gt;&lt;P&gt;WHERE vbeln = vbap-vbeln AND&lt;/P&gt;&lt;P&gt;posnr = vbap-posnr AND&lt;/P&gt;&lt;P&gt;lfsta IN s_status AND&lt;/P&gt;&lt;P&gt;fksaa IN s_bilst.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT lfsta&lt;/P&gt;&lt;P&gt;fksaa&lt;/P&gt;&lt;P&gt;gbsta FROM vbup INTO TABLE t_vbup&lt;/P&gt;&lt;P&gt;WHERE vbeln = vbap-vbeln AND&lt;/P&gt;&lt;P&gt;posnr = vbap-posnr AND&lt;/P&gt;&lt;P&gt;lfsta IN s_status AND&lt;/P&gt;&lt;P&gt;gbsta IN s_bilst.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 21:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885549#M677806</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T21:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Conditions problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885550#M677807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change the elseif to an if and add an endif:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT lfsta fksaa gbsta 
FROM vbup INTO TABLE t_vbup
WHERE vbeln = vbap-vbeln AND
posnr = vbap-posnr AND
lfsta IN s_status AND
gbsta IN s_bilst AND
fksaa IN s_bilst.

IF sy-subrc NE 0 .

  SELECT lfsta
  fksaa
  gbsta FROM vbup INTO TABLE t_vbup
  WHERE vbeln = vbap-vbeln AND
  posnr = vbap-posnr AND
  lfsta IN s_status AND
  fksaa IN s_bilst.

  IF sy-subrc NE 0.      "&amp;lt;========

    SELECT lfsta
    fksaa
    gbsta FROM vbup INTO TABLE t_vbup
    WHERE vbeln = vbap-vbeln AND
    posnr = vbap-posnr AND
    lfsta IN s_status AND
    gbsta IN s_bilst.

  ENDIF.
ENDIF.     "&amp;lt;=======&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>Wed, 19 Sep 2007 21:47:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885550#M677807</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T21:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Conditions problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885551#M677808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob and Sams,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've already tried with this below thing but the problem is regarding my scenario...l'l have to tell u this for getting my scenario.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l have my vbup table with fksaa and gbsta field active.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lets take a example....from vbup for better understanding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;vbeln     posnr      fksaa    gbsta&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;30001          10             B          B&lt;/P&gt;&lt;P&gt;30001          20             A          A&lt;/P&gt;&lt;P&gt;30001          30             B          B&lt;/P&gt;&lt;P&gt;30001          40             C          B&lt;/P&gt;&lt;P&gt;30002          10             ---         B&lt;/P&gt;&lt;P&gt;30003          20            -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;         C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when i give some entry in s_bilst in selection screen field for example A to B then as you know the very first select query gets B and A related entries into the table...and displays the entries like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;30001   10           B            B&lt;/P&gt;&lt;P&gt;30001   20           A            A&lt;/P&gt;&lt;P&gt;30001   30           B            B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for 4th entry the third query triggers and displays the 4th entry too after the third entry.....like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;30001   40           B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what i dont want because i'm giving only A to B range in the selection screen(which is common for both fksaa and gbsta and i'm restricted to have only one selection screen for both the fields) and it shud not show the four entries instead it should show only three entries.......and when i give only C in the entry the 4th entry is displaying properly for ur said logic.....every thing works fine but apart from the above problem with ur if conditions.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And for my logic it wont be displaying the fourth entry it instead displays the 3 enties when A to B range is given and only single entry when C is given in the selection screen.......but the only problem is with the last entry where fksaa field is empty this is not triggering the last select query and not ...........for my if and elseif conditions....i already tried with ur if conditions but no solution how should i solve this without effecting my requirement.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2007 22:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885551#M677808</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-19T22:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Conditions problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885552#M677809</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 this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT lfsta&lt;/P&gt;&lt;P&gt;fksaa&lt;/P&gt;&lt;P&gt;gbsta FROM vbup INTO TABLE t_vbup&lt;/P&gt;&lt;P&gt;WHERE vbeln = vbap-vbeln AND&lt;/P&gt;&lt;P&gt;posnr = vbap-posnr AND&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;lfsta IN s_status or&lt;/P&gt;&lt;P&gt;gbsta IN s_bilst or&lt;/P&gt;&lt;P&gt;fksaa IN s_bilst ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Dharmishta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 04:33:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditions-problem/m-p/2885552#M677809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T04:33:04Z</dc:date>
    </item>
  </channel>
</rss>

