<?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: how to validate this through coding in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314711#M1028474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;validate all your select-options in &lt;/P&gt;&lt;P&gt;AT SELECTION SCREEN events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if s_matnr is not initial.

select single matnr
from mara
into w_matnr
where matnr in s_matnr.

if sy-subrc NE 0.
  message.....
endif.

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Aug 2008 10:01:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-04T10:01:15Z</dc:date>
    <item>
      <title>how to validate this through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314708#M1028471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friend:&lt;/P&gt;&lt;P&gt;   I've 10 fields on selection screen. All are select options.Out of that 3 are mandatory. Based on that I've fetched data in different internal tables. Now I've to put a validation for the case when the user might enter data in non mandatory select options. say. for S_matnr. Should I put a check on the final table or on  itab_mara (in which I fectehd data related to MARA table). Please give me the code as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 09:53:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314708#M1028471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-04T09:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate this through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314709#M1028472</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;Put a validation,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;If not s_matnr-low is initial or
   not s_matnr-high is initial.

select * from mara 
         into itab_mara
where matnr in s_matnr.

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 09:56:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314709#M1028472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-04T09:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate this through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314710#M1028473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi change below as per requirement&lt;/P&gt;&lt;P&gt;END-OF-SELECTION&lt;/P&gt;&lt;P&gt;Loop at s_matnr.&lt;/P&gt;&lt;P&gt;If s_matnr-LOW eq it_final-matnr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 09:59:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314710#M1028473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-04T09:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate this through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314711#M1028474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;validate all your select-options in &lt;/P&gt;&lt;P&gt;AT SELECTION SCREEN events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if s_matnr is not initial.

select single matnr
from mara
into w_matnr
where matnr in s_matnr.

if sy-subrc NE 0.
  message.....
endif.

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 10:01:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314711#M1028474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-04T10:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate this through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314712#M1028475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When selecting data from database tables pass all select-options in the where clause using in operator.&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select fld1...fldn&lt;/P&gt;&lt;P&gt;from &amp;lt;table&amp;gt;&lt;/P&gt;&lt;P&gt;into table i_tab&lt;/P&gt;&lt;P&gt;where fld1 in s_fld1&lt;/P&gt;&lt;P&gt;and fld2 in s_fld2&lt;/P&gt;&lt;P&gt;and ......&lt;/P&gt;&lt;P&gt;and fld10 in s_fld10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For non-mandatory select-options in no value is given in the selection screen then it will fetch all the records.otherwise it will fetch only the record that is present in the select-option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;JOy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 10:01:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314712#M1028475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-04T10:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to validate this through coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314713#M1028476</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 the Validation for the field and giving an error if theres an invalid input,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AT SELECTION-SCREEN.

  IF NOT s_matnr IS INITIAL.

    SELECT SINGLE
           matnr
      FROM mara
      INTO (w_matnr)
     WHERE matnr IN s_matnr.

    IF sy-subrc NE 0.
      MESSAGE e888(sabapdocu)
         WITH 'Invalid Material number'.
    ENDIF.

  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code checks for values entered into S_MATNR. If all the values entered are invalid it will throw up an error on the selection screen.&lt;/P&gt;&lt;P&gt;This restricts the execution of the program until a valid input is provided by the user on the screen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 10:02:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-this-through-coding/m-p/4314713#M1028476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-04T10:02:26Z</dc:date>
    </item>
  </channel>
</rss>

