<?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: Selection Screen field validation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707867#M1453328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Piotr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After passing a Value to F_VAL, now you have the Control Table which is Top most in the Heirarchy which must have the data then only other Child tables can have a relavent Value. You are obsolutely correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Single from the Control Table will work for you.&lt;/P&gt;&lt;P&gt;Hence you can Validate the Entry of the F_VAL field.&lt;/P&gt;&lt;P&gt;For Ex.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;I passed SPFLI to the FM and got the data and found SCARR as the control table for CARRID field.
now if i pass 'XX' into  F_VAL  field this can be validated against the table SCARR.


data ; var type spflic-carrid " declare this 
data : str type string.
at selection-screen. " Use this Event
select single carrid from SCARR into var where carrid = f_val.
if sy-subrc NE 0.
concatenate 'Air Line ID' f_val 'Not maintained in Control Table' into str separated by space.
MESSAGE str type 'E'
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Cheerz&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Feb 2010 04:15:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-26T04:15:16Z</dc:date>
    <item>
      <title>Selection Screen field validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707866#M1453327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there ABAP'ers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got a question haw to validate selection screen field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the selection-screen I have got two fields:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
F_DATAELEMENT (Type: FIELDNAME)  
F_VALUE       (Type: CHAR60)
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have got a SearchHelp attached to the F_DATAELEMENT. SHelp list shows list of ADRC table fields. I obtain it using module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL FUNCTION 'DDIF_FIELDINFO_GET'
      EXPORTING
        tabname        = 'ADRC'
      TABLES
        dfies_tab      = it_dfies
      EXCEPTIONS
        not_found      = 1
        internal_error = 2
        OTHERS         = 3 .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where &lt;STRONG&gt;it_dfies&lt;/STRONG&gt; contains detailed information about fields  (datatype, control table ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And now my question is it possible to validate the selection screen field &lt;STRONG&gt;F_VALUE&lt;/STRONG&gt; with data taken from DDIF_FIELDINFO_GET FModue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean such example:&lt;/P&gt;&lt;P&gt;User choses a CITY_CODE value in &lt;STRONG&gt;F_DATAELEMENT&lt;/STRONG&gt; field&lt;/P&gt;&lt;P&gt;Now I would like the F_VALUE field to be validated respecting the ADRCITY control table (CITY_CODE has got a ADRCITY control table assigned - such info I am getting from the DDIF_FIELDINFO_GET FModule)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will be thankful for suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2010 18:59:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707866#M1453327</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-25T18:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen field validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707867#M1453328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Piotr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After passing a Value to F_VAL, now you have the Control Table which is Top most in the Heirarchy which must have the data then only other Child tables can have a relavent Value. You are obsolutely correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Single from the Control Table will work for you.&lt;/P&gt;&lt;P&gt;Hence you can Validate the Entry of the F_VAL field.&lt;/P&gt;&lt;P&gt;For Ex.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;I passed SPFLI to the FM and got the data and found SCARR as the control table for CARRID field.
now if i pass 'XX' into  F_VAL  field this can be validated against the table SCARR.


data ; var type spflic-carrid " declare this 
data : str type string.
at selection-screen. " Use this Event
select single carrid from SCARR into var where carrid = f_val.
if sy-subrc NE 0.
concatenate 'Air Line ID' f_val 'Not maintained in Control Table' into str separated by space.
MESSAGE str type 'E'
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Cheerz&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 04:15:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707867#M1453328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-26T04:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen field validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707868#M1453329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;STRONG&gt;Ramchander Krishnamraju&lt;/STRONG&gt; it is solving my problem but I would like to take an opportunity to continue the topic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What if I would like to validate field regarding its format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example ADRC table contains DATE_TO field which lies in DATUM domain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now how to check when User choses a DATE_TO value in &lt;STRONG&gt;F_DATAELEMENT&lt;/STRONG&gt; field if &lt;STRONG&gt;F_VALUE&lt;/STRONG&gt; is of a proper format? I mean situation that user enters a string value into F_VALUE field - such situation should not be permitted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there some FModule or other convenience? Or do I must to check it manually by investigating the F_VALUE field string content?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 21:39:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707868#M1453329</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-26T21:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen field validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707869#M1453330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use the below FM for date validation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SFCS_FA_PARAMETER_SET&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: subas  Bose on Feb 26, 2010 11:42 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 22:42:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707869#M1453330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-26T22:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen field validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707870#M1453331</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 DESCRIBE key word which give you back the data type of the field &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : matnr TYPE matnr,
      date TYPE sy-datum.
DATA : type1, type2.
DESCRIBE FIELD matnr TYPE type1.
DESCRIBE FIELD date TYPE type2.

"Take F1 help which give the actual meaning returned by the type1 in above code.
for Ex if type1 = C then it is Char type or Basic ABAP data type C
if type1 = D then it is Elementary type D Etc.
This info is in Key word Documentation Take F1 Help on DESCRIBE FIELD key word
IF sy-subrc =  0.

ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Cheerz&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Feb 2010 03:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-field-validation/m-p/6707870#M1453331</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-27T03:00:35Z</dc:date>
    </item>
  </channel>
</rss>

