<?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: Convert date to internal format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605982#M271902</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;cl_abap_datfm=&amp;gt;conv_date_ext_to_int&lt;BR /&gt;            cl_abap_datfm=&amp;gt;conv_date_ext_to_int(&lt;BR /&gt;              EXPORTING&lt;BR /&gt;                im_datext    = rv_date     "   external representation of date&lt;BR /&gt;                im_datfmdes  = iv_pattern    " date format provided&lt;BR /&gt;              IMPORTING&lt;BR /&gt;                ex_datint    =  DATA(lv_int_date)     " internal representation of date&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cl_abap_datfm=&amp;gt;conv_date_int_to_ext&lt;BR /&gt;            cl_abap_datfm=&amp;gt;conv_date_int_to_ext(&lt;BR /&gt;              EXPORTING&lt;BR /&gt;                im_datint    = CONV d( rv_date )    " internal representation of date&lt;BR /&gt;                im_datfmdes  = iv_pattern    " date format wanted for conversion&lt;BR /&gt;              IMPORTING&lt;BR /&gt;                ex_datext    = rv_date    " external representation of date&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Aug 2023 15:14:20 GMT</pubDate>
    <dc:creator>PRAGSMATIC</dc:creator>
    <dc:date>2023-08-16T15:14:20Z</dc:date>
    <item>
      <title>Convert date to internal format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605977#M271897</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;I am getting date in the format as detailed below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10/16/2005, 6/16/2005, 10/6/2005 - MM/DD/YYYY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to convert it to the internal date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help with the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;SAPBW&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 16:39:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605977#M271897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T16:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date to internal format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605978#M271898</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 the function module CONVERT_DATE_TO_INTERNAL..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'&lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;DATE_EXTERNAL = V_DATE_EX&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;DATE_INTERNAL = V_DATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 16:45:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605978#M271898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T16:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date to internal format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605979#M271899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Use Function module &amp;lt;b&amp;gt;CONVERT_DATE_TO_INTERNAL&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
      EXPORTING
           DATE_EXTERNAL            =  PL_BUDAT
      IMPORTING
           DATE_INTERNAL            =  P_BUDAT
      EXCEPTIONS
           DATE_EXTERNAL_IS_INVALID = 1
           OTHERS                   = 2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 16:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605979#M271899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T16:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date to internal format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605980#M271900</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 Function module &amp;lt;b&amp;gt;CONVERT_DATE_TO_INTERNAL&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;It will consider all types of date formats 10/16/2005, 6/16/2005, 10/6/2005 etc. Whether you will give 1 or 2 digits to month or date. You can also give 2 digits to year even then it will converts to internal format. &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;You need to give dates in User defined format otherwise it generates an exception DATE_EXTERNAL_IS_INVALID.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA V_EXT_DATE(10) VALUE '10/06/2005'.&lt;/P&gt;&lt;P&gt;DATA V_DATE TYPE SY-DATUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    date_external                  = V_EXT_DATE&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    DATE_INTERNAL                  = V_DATE&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    DATE_EXTERNAL_IS_INVALID       = 1&lt;/P&gt;&lt;P&gt;    OTHERS                         = 2.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/ 'INTERNAL FORMAT OF DATE IS: ', V_DATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 16:55:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605980#M271900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T16:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date to internal format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605981#M271901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the FM &amp;lt;b&amp;gt;/SAPDMC/LSM_DATE_CONVERT&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pass DATE_IN = 10/16/2005&lt;/P&gt;&lt;P&gt;DATE_FORMAT_IN    = DMDY&lt;/P&gt;&lt;P&gt;TO_OUTPUT_FORMAT  = BLANK&lt;/P&gt;&lt;P&gt;TO_INTERNAL_FORMAT = X&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OUTPUT&lt;/P&gt;&lt;P&gt;DATE_OUT   = 20051016&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prakash.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 16:55:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605981#M271901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-05T16:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date to internal format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605982#M271902</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;cl_abap_datfm=&amp;gt;conv_date_ext_to_int&lt;BR /&gt;            cl_abap_datfm=&amp;gt;conv_date_ext_to_int(&lt;BR /&gt;              EXPORTING&lt;BR /&gt;                im_datext    = rv_date     "   external representation of date&lt;BR /&gt;                im_datfmdes  = iv_pattern    " date format provided&lt;BR /&gt;              IMPORTING&lt;BR /&gt;                ex_datint    =  DATA(lv_int_date)     " internal representation of date&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cl_abap_datfm=&amp;gt;conv_date_int_to_ext&lt;BR /&gt;            cl_abap_datfm=&amp;gt;conv_date_int_to_ext(&lt;BR /&gt;              EXPORTING&lt;BR /&gt;                im_datint    = CONV d( rv_date )    " internal representation of date&lt;BR /&gt;                im_datfmdes  = iv_pattern    " date format wanted for conversion&lt;BR /&gt;              IMPORTING&lt;BR /&gt;                ex_datext    = rv_date    " external representation of date&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Aug 2023 15:14:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-date-to-internal-format/m-p/1605982#M271902</guid>
      <dc:creator>PRAGSMATIC</dc:creator>
      <dc:date>2023-08-16T15:14:20Z</dc:date>
    </item>
  </channel>
</rss>

