<?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 Date format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-format/m-p/1869428#M366220</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;My requirement is as below.&lt;/P&gt;&lt;P&gt;On selection screen select options date is expected in a certain format MM/DD/YYYY. but for new design I want to make it work dynamically, that the program works for all date formats based on user settings. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should be like making select options dynamic so that it would accept &lt;/P&gt;&lt;P&gt;  any date format and pass it to system date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any logic or Function module to convert select-options date to system date format. system accepts date in sy-datum i.e. yyyymmdd.&lt;/P&gt;&lt;P&gt;Please let me know if thre is something FM or logic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jan 2007 05:12:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-10T05:12:13Z</dc:date>
    <item>
      <title>Date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-format/m-p/1869428#M366220</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;My requirement is as below.&lt;/P&gt;&lt;P&gt;On selection screen select options date is expected in a certain format MM/DD/YYYY. but for new design I want to make it work dynamically, that the program works for all date formats based on user settings. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should be like making select options dynamic so that it would accept &lt;/P&gt;&lt;P&gt;  any date format and pass it to system date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any logic or Function module to convert select-options date to system date format. system accepts date in sy-datum i.e. yyyymmdd.&lt;/P&gt;&lt;P&gt;Please let me know if thre is something FM or logic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2007 05:12:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-format/m-p/1869428#M366220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-10T05:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-format/m-p/1869429#M366221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yogesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If my understanding is correct, the user enter the date with respect to his/her own profile format and you need to get the date into a variable in format yyyymmdd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can do this by using table &amp;lt;b&amp;gt;USR01&amp;lt;/b&amp;gt; and FM: &amp;lt;b&amp;gt;DATE_STRING_CONVERT&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field DATFM of table USR01 will give the format set in user's profile. Pass this and the date entered in the selection-screen to FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below sample code can help you understand the same:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;parameters: p_format type XUDATFM,
            p_date(10) type c.
data: date type datum.

CALL FUNCTION 'DATE_STRING_CONVERT'
  EXPORTING
    DATE_FORMAT       = p_format
    DATE_STRING       = p_date
*   START_DATE        = SY-DATUM
 IMPORTING
   RESULT_DATE       = date.

write:/ date.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the value in date when the break point is reached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2007 05:37:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-format/m-p/1869429#M366221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-10T05:37:03Z</dc:date>
    </item>
  </channel>
</rss>

