<?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: Coding date format control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-date-format-control/m-p/5627909#M1281566</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi david,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a typical code to fullfil your requirement;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data input_date type d. " This you should be passing to the routine

data temp_date type d.
input_date = '20090522'. " 22 may 2009
temp_date = input_date - 1.
temp_Date = temp_date + 1.
IF temp_date NE input_date.
  "Wrong Format set date to empty
  clear input_Date.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i have given 20090522 which is in YYYYMMDD, if i give in wrong format the above code will empty the input date. If you have any queries revert back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 May 2009 11:45:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-22T11:45:55Z</dc:date>
    <item>
      <title>Coding date format control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-date-format-control/m-p/5627907#M1281564</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 would like to implement a ABAP routine BW. This routine will check the format of the date, if they are not "YYYYMMDD", the routine will set empty for this zone. As I am not good at ABAP, is there any informatioin about this ABAP code? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 10:56:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-date-format-control/m-p/5627907#M1281564</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-22T10:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Coding date format control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-date-format-control/m-p/5627908#M1281565</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 would like to implement a ABAP routine BW. This routine will check the format of the date, if they are not "YYYYMMDD", the routine will set empty for this zone. As I am not good at ABAP, is there any informatioin about this ABAP code? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAP default date format is YYYYMMDD. I hope your date format which you are going to pass like DDMMYYYY. For that, the DDMMYYYY date format you can use the concatenate statement to make it as SAP date format like YYYYMMDD. Find the below example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : V_DATE LIKE SY-DATUM.&lt;/P&gt;&lt;P&gt;DATA : V_SAP_DATE LIKE SY-DATUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : LV_DATE(2) TYPE N,&lt;/P&gt;&lt;P&gt;       LV_MONTH(2) TYPE N,&lt;/P&gt;&lt;P&gt;       LV_YEAR(4) TYPE N.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V_DATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LV_DATE = V_DATE+6(2).&lt;/P&gt;&lt;P&gt;LV_MONTH = V_DATE+4(2).&lt;/P&gt;&lt;P&gt;LV_YEAR = V_DATE+0(4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE LV_YEAR LV_MONTH LV_DATE INTO V_SAP_DATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Thiru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 11:16:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-date-format-control/m-p/5627908#M1281565</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-22T11:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Coding date format control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-date-format-control/m-p/5627909#M1281566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi david,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a typical code to fullfil your requirement;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data input_date type d. " This you should be passing to the routine

data temp_date type d.
input_date = '20090522'. " 22 may 2009
temp_date = input_date - 1.
temp_Date = temp_date + 1.
IF temp_date NE input_date.
  "Wrong Format set date to empty
  clear input_Date.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i have given 20090522 which is in YYYYMMDD, if i give in wrong format the above code will empty the input date. If you have any queries revert back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 11:45:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-date-format-control/m-p/5627909#M1281566</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-22T11:45:55Z</dc:date>
    </item>
  </channel>
</rss>

