<?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: Dynamic where clause problem? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488353#M1653025</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use for all entries or join mate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Dec 2011 08:05:26 GMT</pubDate>
    <dc:creator>nabheetscn</dc:creator>
    <dc:date>2011-12-28T08:05:26Z</dc:date>
    <item>
      <title>Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488352#M1653024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using 4 parameters for the attrition rate report of an employee on the selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Level&lt;/P&gt;&lt;P&gt;Grade&lt;/P&gt;&lt;P&gt;Position&lt;/P&gt;&lt;P&gt;Salary Range (pa0008-ansal)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have filled the values of level, grade, position, from database tables at the initialization event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And for the salary range i hardcoded them to 0-5000, 5001-10000 etc.. and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then showed all 4 parameters are listbox on the selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now the first 3 parameters are from infotype pa0001 and the last is from pa0008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to select pernr, persg ,persk ,plans, begda ,endda fields from infotype pa0001, and 'ansal' field from pa0008 , with the help of a dynamic where clause, is it possible, because here it might be needed for a join as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me out with some sample coding help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:03:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488352#M1653024</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-28T08:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488353#M1653025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use for all entries or join mate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:05:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488353#M1653025</guid>
      <dc:creator>nabheetscn</dc:creator>
      <dc:date>2011-12-28T08:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488354#M1653026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi nabheet,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the join, but i am having some problem making the dynamic where clause, can u help out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:07:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488354#M1653026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-28T08:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488355#M1653027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please pasted code with problem &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:09:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488355#M1653027</guid>
      <dc:creator>nabheetscn</dc:creator>
      <dc:date>2011-12-28T08:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488356#M1653028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lv_query TYPE string.
  lv_query = ' '.
  IF  position IS NOT INITIAL.
    IF lv_query IS NOT INITIAL.
      CONCATENATE lv_query '  and p1~plans eq   position '  '' INTO lv_query.
    ELSE.
      CONCATENATE  ' p1~plans eq  position '  '' INTO lv_query.
    ENDIF.
  ENDIF.

  IF  grade IS NOT INITIAL.
    IF lv_query IS NOT INITIAL .
      CONCATENATE lv_query '  and p1~PERSK eq  grade ' '' INTO lv_query.
    ELSE.
      CONCATENATE '  p1~PERSK eq  grade  ' '' INTO lv_query.
    ENDIF.
  ENDIF.

  IF  level IS NOT INITIAL.

    IF lv_query IS NOT INITIAL .
      CONCATENATE lv_query '  and p1~PERsg eq  level ' '' INTO lv_query.
    ELSE.
      CONCATENATE ' p1~PERsg eq  level  ' '' INTO lv_query.
    ENDIF.
  ENDIF.
*
  IF  sal_slab IS NOT INITIAL.
    SELECT pernr ansal begda endda FROM pa0008 INTO CORRESPONDING FIELDS OF TABLE lt_st_p8 WHERE ansal = sal_slab.

    *IF lv_query IS NOT INITIAL .*
      *CONCATENATE lv_query '  and p8~ansal le  sal_slab ' '' INTO lv_query.*
    *ELSE.*
      *CONCATENATE '  p8~ansal le  sal_slab  ' '' INTO lv_query.*
    *ENDIF.*
  ENDIF.

SELECT p1~pernr
    p1~persg p1~persk p1~plans p1~begda p1~endda
     p8~ansal
  INTO CORRESPONDING FIELDS of TABLE lt_st_p1_p8
    FROM pa0001 AS p1 JOIN pa0008 AS p8  ON p1~pernr = p8~pernr
    WHERE (lv_query) .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;Added code tags&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in case of salary slab, i have ranges like 0-5000 , 5001-10000 and so on and I showed it as a listbox on sel. screen.&lt;/P&gt;&lt;P&gt; So how can I read the figure after the '-'?????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also review, if for the previous 3 parameters it is correct, or it can be shortened and accurated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Dec 28, 2011 1:44 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:11:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488356#M1653028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-28T08:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488357#M1653029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what you can do is you can declare a range variable&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: lr_sal_slab type range of &amp;lt;data type&amp;gt;,
lwa_sal_slab like line of lr_sal_slab.,

Now based on value selected in drop down
fill this range as
lwa_sal_slab-sign = 'I'.
lwa_sal_slab-option = 'EQ'.
lwa_sal_slab-low = lower limit.
lwa_sal_slab-high = upper limit.
append lwa_sla_slab to lr_sal_slab.

if lr_sal_slab[] is not initial.

lwa_sal_slab-sign = 'I'.
CONCATENATE lv_query '  and p8~ansal in  lr_sal_slab ' '' INTO lv_query.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:22:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488357#M1653029</guid>
      <dc:creator>nabheetscn</dc:creator>
      <dc:date>2011-12-28T08:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488358#M1653030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ya that is one option, but in this case, i will have to case on the salary range parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So there will be about 12 cases. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cant i use some SPLIT statement, to split the selected value when it reaches '-'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like i am have ranges like 0-5000&lt;/P&gt;&lt;P&gt;                                         5001- 10000&lt;/P&gt;&lt;P&gt;                                         ...........&lt;/P&gt;&lt;P&gt;                                        ...........&lt;/P&gt;&lt;P&gt;                                         100001&amp;amp;above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So can i somehow split them, and then use p8~ansal bet... result1 and result 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not exactly getting that. Can u help me out????????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:28:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488358#M1653030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-28T08:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488359#M1653031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can use split at '-' statment and put it into two variables and use between.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:34:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488359#M1653031</guid>
      <dc:creator>nabheetscn</dc:creator>
      <dc:date>2011-12-28T08:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488360#M1653032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ya that will work out! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what about the last case, 100001 &amp;amp; above, in this case,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is no '-', so how will i do that???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sal_slab_low(7) type c.&lt;/P&gt;&lt;P&gt;data sal_slab_high(7) type c.&lt;/P&gt;&lt;P&gt;READ TABLE list_sal_slab into value_sal_slab with key key = sal_slab.&lt;/P&gt;&lt;P&gt;SPLIT value_sal_slab-text at '-' into sal_slab_low sal_slab_high.&lt;/P&gt;&lt;P&gt;  IF sal_slab IS NOT INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   SELECT pernr ansal begda endda FROM pa0008 INTO CORRESPONDING FIELDS OF TABLE lt_st_p8 WHERE ansal = sal_slab.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF lv_query IS NOT INITIAL .&lt;/P&gt;&lt;P&gt;      CONCATENATE lv_query '  and p8~ansal ge sal_slab_low and le sal_slab_high  ' '' INTO lv_query.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      CONCATENATE '  p8~ansal ge sal_slab_low and le sal_slab_high  ' '' INTO lv_query.&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;This is working, but for the last case, how can I implement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:41:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488360#M1653032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-28T08:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488361#M1653033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will have value in first variable not in second implement check for that case if &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split lv_string at '-' intolv_val1 lv_val2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if lv_val2 is initlal &lt;/P&gt;&lt;P&gt;do not use&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:45:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488361#M1653033</guid>
      <dc:creator>nabheetscn</dc:creator>
      <dc:date>2011-12-28T08:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic where clause problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488362#M1653034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ya thanks nabheet. Problem solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2011 08:50:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-problem/m-p/8488362#M1653034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-28T08:50:41Z</dc:date>
    </item>
  </channel>
</rss>

