<?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: Mass validations in selection screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/mass-validations-in-selection-screen/m-p/8077787#M1614244</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should be a good start, if you still persist to move ahead with your initial approach inspite of Thomas's suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES:
  mara.

SELECT-OPTIONS:
  s_matnr FOR mara-matnr.

PARAMETERS:
   p_test1 TYPE char10,
   p_test2 TYPE char10.

DATA:
   count TYPE i.

FIELD-SYMBOLS:
  &amp;lt;fs&amp;gt; TYPE ANY.

AT SELECTION-SCREEN.
  IF sy-ucomm = 'ONLI'.
    CLEAR count.
    LOOP AT SCREEN.
      CHECK: screen-input  = 1,
             screen-active = 1.
      ASSIGN (screen-name) TO &amp;lt;fs&amp;gt;.
      IF &amp;lt;fs&amp;gt; IS ASSIGNED AND
         &amp;lt;fs&amp;gt; IS NOT INITIAL.
        ADD 1 TO count.
        UNASSIGN &amp;lt;fs&amp;gt;.
      ENDIF.
    ENDLOOP.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rajesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit&lt;/P&gt;&lt;P&gt;P.S : I haven't tested the above solution thoroughly, if for any reasons you find issues with the above approach, as an alternative you can consider using the FM 'RS_REFRESH_FROM_SELECTOPTIONS' to read the selection screen contents. But as already suggested, it would be easy to query the fields individually, you don't want to perform a simple validation with a complicated processing...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rajesh Paruchuru on Jul 12, 2011 10:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jul 2011 15:27:29 GMT</pubDate>
    <dc:creator>rajesh_paruchuru</dc:creator>
    <dc:date>2011-07-12T15:27:29Z</dc:date>
    <item>
      <title>Mass validations in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mass-validations-in-selection-screen/m-p/8077785#M1614242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;I have a simple requirement to check "if atleast one of the fields on selection screen is filled or not".&lt;/P&gt;&lt;P&gt;If all the fields are initial, i'll raise a message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;I dont want to check all the fields one by one using ANDs.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The closest I got was-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at screen.&lt;/P&gt;&lt;P&gt;field = screen-name.&lt;/P&gt;&lt;P&gt;see if the field is empty.&lt;/P&gt;&lt;P&gt;if yes, increment the counter.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;check if the counter is still zero. That means all fields are empty. Raise message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem here is, in "screen-name", i'll get the name of screen field. How do I read it? How to find the value in a varible that is stored in another variable? I tried paranthesis ( screen-field ) = value. But it doesnt work. If that can be done, my problem's solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Sumit Nene.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 14:57:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mass-validations-in-selection-screen/m-p/8077785#M1614242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-12T14:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Mass validations in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mass-validations-in-selection-screen/m-p/8077786#M1614243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How many select-options do you have? It would be much easier and transparent to just chain a few ANDs rather than trying to come up with a dynamic complexity that even you will not understand any more after doing something else for two months, let alone other developers that will have to work with your code in the future.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 15:11:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mass-validations-in-selection-screen/m-p/8077786#M1614243</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2011-07-12T15:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Mass validations in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mass-validations-in-selection-screen/m-p/8077787#M1614244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should be a good start, if you still persist to move ahead with your initial approach inspite of Thomas's suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES:
  mara.

SELECT-OPTIONS:
  s_matnr FOR mara-matnr.

PARAMETERS:
   p_test1 TYPE char10,
   p_test2 TYPE char10.

DATA:
   count TYPE i.

FIELD-SYMBOLS:
  &amp;lt;fs&amp;gt; TYPE ANY.

AT SELECTION-SCREEN.
  IF sy-ucomm = 'ONLI'.
    CLEAR count.
    LOOP AT SCREEN.
      CHECK: screen-input  = 1,
             screen-active = 1.
      ASSIGN (screen-name) TO &amp;lt;fs&amp;gt;.
      IF &amp;lt;fs&amp;gt; IS ASSIGNED AND
         &amp;lt;fs&amp;gt; IS NOT INITIAL.
        ADD 1 TO count.
        UNASSIGN &amp;lt;fs&amp;gt;.
      ENDIF.
    ENDLOOP.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rajesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit&lt;/P&gt;&lt;P&gt;P.S : I haven't tested the above solution thoroughly, if for any reasons you find issues with the above approach, as an alternative you can consider using the FM 'RS_REFRESH_FROM_SELECTOPTIONS' to read the selection screen contents. But as already suggested, it would be easy to query the fields individually, you don't want to perform a simple validation with a complicated processing...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rajesh Paruchuru on Jul 12, 2011 10:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 15:27:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mass-validations-in-selection-screen/m-p/8077787#M1614244</guid>
      <dc:creator>rajesh_paruchuru</dc:creator>
      <dc:date>2011-07-12T15:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Mass validations in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mass-validations-in-selection-screen/m-p/8077788#M1614245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A case of "penny wise but pound foolish". It would be much simpler to check the fields individually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you insist on complexity, you can keep the idea of the counter, but use it when checking if the filed is empty; don't use the loop at screen. You could also use a DO with an EXIT if an entry is found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 16:12:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mass-validations-in-selection-screen/m-p/8077788#M1614245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-12T16:12:52Z</dc:date>
    </item>
  </channel>
</rss>

