<?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 How to validate for proper date format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-for-proper-date-format/m-p/3441653#M826521</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using following Fm to calculate date difference.....&lt;/P&gt;&lt;P&gt;call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        i_date_from = wa_draw-zdm_vld_to_dat&lt;/P&gt;&lt;P&gt;        i_date_to   = sy-datum&lt;/P&gt;&lt;P&gt;      importing&lt;/P&gt;&lt;P&gt;        e_days      = v_days.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if v_days &amp;gt; 0. &lt;/P&gt;&lt;P&gt;             -&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;              -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But value of field  zdm_vld_to_dat (data type DATS  , YYYYMMDD)   in database tables itself is wrong   ...like  ct/-0/29-o&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to avoid passing these wrong data entry, in the FM...as also i give info message for this in spool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So can anybody tel me How can I detect or know this fields zdm_vld_to_dat  conatins wrong date other than YYYYMMDD...e.g. &lt;/P&gt;&lt;P&gt;ct/-0/29-o   means any charecter or hyphen &lt;SPAN __jive_emoticon_name="minus"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.   &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Feb 2008 12:54:16 GMT</pubDate>
    <dc:creator>Kloud_Nilesh</dc:creator>
    <dc:date>2008-02-14T12:54:16Z</dc:date>
    <item>
      <title>How to validate for proper date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-for-proper-date-format/m-p/3441653#M826521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using following Fm to calculate date difference.....&lt;/P&gt;&lt;P&gt;call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        i_date_from = wa_draw-zdm_vld_to_dat&lt;/P&gt;&lt;P&gt;        i_date_to   = sy-datum&lt;/P&gt;&lt;P&gt;      importing&lt;/P&gt;&lt;P&gt;        e_days      = v_days.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if v_days &amp;gt; 0. &lt;/P&gt;&lt;P&gt;             -&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;              -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But value of field  zdm_vld_to_dat (data type DATS  , YYYYMMDD)   in database tables itself is wrong   ...like  ct/-0/29-o&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to avoid passing these wrong data entry, in the FM...as also i give info message for this in spool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So can anybody tel me How can I detect or know this fields zdm_vld_to_dat  conatins wrong date other than YYYYMMDD...e.g. &lt;/P&gt;&lt;P&gt;ct/-0/29-o   means any charecter or hyphen &lt;SPAN __jive_emoticon_name="minus"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.   &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2008 12:54:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-for-proper-date-format/m-p/3441653#M826521</guid>
      <dc:creator>Kloud_Nilesh</dc:creator>
      <dc:date>2008-02-14T12:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to validate for proper date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-for-proper-date-format/m-p/3441654#M826522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just use this FM CONVERT_DATE_TO_INTERNAL if the date what you have given is correct then it will convert to your format. other wise skip that record or pass error msg.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2008 13:04:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-for-proper-date-format/m-p/3441654#M826522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-14T13:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to validate for proper date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-for-proper-date-format/m-p/3441655#M826523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG&gt;Nilesh Hiwale&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. First thing is there is no need for any function module for difference between two dates&lt;/P&gt;&lt;P&gt;    See this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Data: &lt;/P&gt;&lt;P&gt;days type i&lt;/P&gt;&lt;P&gt; date1 type wa_draw-zdm_vld_to_dat&lt;/P&gt;&lt;P&gt; date2 type sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;days = date2 - date1&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write / days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                      &amp;gt; (OR)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. write this condition in PAI module of your screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;At selection-screen.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if date1 cn '1234567890'. or date2 cn '123456789'.&lt;/P&gt;&lt;P&gt;  write e000(Sabapdocu) with 'Enter YYYYMMDD Formate'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if it is useful,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mahi&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2008 13:04:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-validate-for-proper-date-format/m-p/3441655#M826523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-14T13:04:24Z</dc:date>
    </item>
  </channel>
</rss>

