<?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: Range issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963740#M1603103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rahul,&lt;/P&gt;&lt;P&gt;If all your 3 screen fields are mandatory, and you want to select the lines which correspond to the 3 fields (there will be 0 line if the user entries do not correspond), then it would be:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM zvend_detail INTO TABLE lt_itab&lt;/P&gt;&lt;P&gt;WHERE vend_num1_From &amp;lt;= v_vend_num1&lt;/P&gt;&lt;P&gt;  AND vend_num1_to &amp;gt;= v_vend_num1&lt;/P&gt;&lt;P&gt;  AND vend_num2_From &amp;lt;= v_vend_num2&lt;/P&gt;&lt;P&gt;  AND vend_num2_to &amp;gt;= v_vend_num2&lt;/P&gt;&lt;P&gt;  AND zcode = zcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jun 2011 20:29:33 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2011-06-23T20:29:33Z</dc:date>
    <item>
      <title>Range issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963735#M1603098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working on a piece of code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we have a custom table ZVEND_DETAILwhich has the following fields: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Vend_num1_From &lt;/P&gt;&lt;P&gt;2. Vend_Num1_To&lt;/P&gt;&lt;P&gt;3. Vend_num2_From&lt;/P&gt;&lt;P&gt;4. Vend_num2_TO&lt;/P&gt;&lt;P&gt;5. Zcode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now the user will enter the above fields on the screen and I need to check what user entered is in this table or not, if not then throw an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the input fields for user are: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;v_vend_num1
v_vend_num2
zcode

Vend_num1_From  Vend_num2_TO  Vend_num1_From    Vend_num2_To
12              20                    1                     5
10              15                    2                     2
10              10                    1                     1
20              25                    6                     10
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;so if the user enters any of the above mentioned value, it's a correct value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically what I need to see whatever user enters should be validated against this table All the records are unique, I am not able to build this logic, can you please help me on how to start this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your help is appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: goel.rahul2238 on Jun 22, 2011 9:47 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Jun 23, 2011 8:58 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 19:42:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963735#M1603098</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-22T19:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Range issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963736#M1603099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any Suggestion?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 00:47:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963736#M1603099</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-23T00:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Range issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963737#M1603100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rahul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume it is not a table Maintenance generator but a selection screen throug which you are trying to have such a kind of check.Then you can use At selection screen on that particular field and then check if the entered data is already availble in the table or not using a select query,check the sy subrc and accordingly give an error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is a table maintennange generator then you need to handle it using events or by giving the check table ENTRY HELP/CHECK in SE11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 05:49:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963737#M1603100</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2011-06-23T05:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Range issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963738#M1603101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rahul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic should go like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lv_succ type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from ZVEND_DETAIL into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( v_vend_num1 ge wa-Vend_num1_From and &lt;/P&gt;&lt;P&gt;      v_vend_num1 le  wa-Vend_num1_to )    AND               &lt;/P&gt;&lt;P&gt;   ( v_vend_num2 ge wa-Vend_num2_From and &lt;/P&gt;&lt;P&gt;         v_vend_num2 le  wa-Vend_num2_to ) AND&lt;/P&gt;&lt;P&gt;         Zcode eq wa-zcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_succ = 'X'.&lt;/P&gt;&lt;P&gt;exit.&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;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if lv_succ is initial.&lt;/P&gt;&lt;P&gt;   raise  error&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Diwakar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 08:54:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963738#M1603101</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-23T08:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Range issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963739#M1603102</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;Use the initialization event to build your range tables for your fiuelds.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
INITIALIZATION.
  SELECT vendor_num_from INTO TABLE lt_vend_num_fr
                              FROM  zvend_table.

  LOOP AT lt_vend_num_fr INTO ls_vend_num_fr.
    lwr_vend_num_fr-sign   = 'I'.
    lwr_vend_num_fr-option = 'EQ'.
    lwr_vend_num_fr-low    = ls_vend_num_fr-vendor_num_from.
    APPEND lwr_vend_num_fr TO gr_vend_num_fr.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then use event AT SELECTION_SCREEN ON to do the validation for your values&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AT SELECTION-SCREEN ON p_from.
  IF NOT p_from IN gr_vend_num_fr.
*...issue message
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PrinceIsaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 15:57:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963739#M1603102</guid>
      <dc:creator>prince_isaac</dc:creator>
      <dc:date>2011-06-23T15:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Range issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963740#M1603103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rahul,&lt;/P&gt;&lt;P&gt;If all your 3 screen fields are mandatory, and you want to select the lines which correspond to the 3 fields (there will be 0 line if the user entries do not correspond), then it would be:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM zvend_detail INTO TABLE lt_itab&lt;/P&gt;&lt;P&gt;WHERE vend_num1_From &amp;lt;= v_vend_num1&lt;/P&gt;&lt;P&gt;  AND vend_num1_to &amp;gt;= v_vend_num1&lt;/P&gt;&lt;P&gt;  AND vend_num2_From &amp;lt;= v_vend_num2&lt;/P&gt;&lt;P&gt;  AND vend_num2_to &amp;gt;= v_vend_num2&lt;/P&gt;&lt;P&gt;  AND zcode = zcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2011 20:29:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963740#M1603103</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2011-06-23T20:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Range issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963741#M1603104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rahul&lt;/P&gt;&lt;P&gt;suppose you have V1F, V1T, V2F and V2T as your input fields on screen.&lt;/P&gt;&lt;P&gt;Obviously you have declared your screen with this input fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then in your program, on the event of AT SELECTION SCREEN&lt;/P&gt;&lt;P&gt;create a perform Validation and write below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select Vend_num1_From &lt;/P&gt;&lt;P&gt;from ZVEND_DETAIL&lt;/P&gt;&lt;P&gt;where Vend_num1_From = V1F.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;similarly do the same for all the other fields which you want to validate.&lt;/P&gt;&lt;P&gt;after this validation perform&lt;/P&gt;&lt;P&gt;write your code on the event Start-Of-Selection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will work for you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;LG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 10:00:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/range-issue/m-p/7963741#M1603104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-24T10:00:48Z</dc:date>
    </item>
  </channel>
</rss>

