<?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: How to customize date format error? help! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447893#M212350</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gopal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample code.&lt;/P&gt;&lt;P&gt;DATA: lv_value    TYPE domvalue_l,&lt;/P&gt;&lt;P&gt;      ls_usr01    TYPE usr01,&lt;/P&gt;&lt;P&gt;      ls_dd07v    TYPE dd07v.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK TEST.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF LINE.&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN COMMENT 1(18) lv_text&lt;/P&gt;&lt;P&gt;          FOR FIELD s_date.&lt;/P&gt;&lt;P&gt;  SELECT-OPTIONS  s_date FOR sy-datum.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF LINE.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get date format code from user profile&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'CETA_USR01_READ'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      BNAME          = sy-uname&lt;/P&gt;&lt;P&gt;   IMPORTING&lt;/P&gt;&lt;P&gt;     USR01_EXP       = ls_usr01&lt;/P&gt;&lt;P&gt;   EXCEPTIONS&lt;/P&gt;&lt;P&gt;     NO_ENTRY        = 1&lt;/P&gt;&lt;P&gt;     OTHERS          = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the date format text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  lv_value = ls_usr01-datfm.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'DD_DOMVALUE_TEXT_GET'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      DOMNAME             = 'XUDATFM'&lt;/P&gt;&lt;P&gt;      VALUE               = lv_value&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      DD07V_WA            = ls_dd07v.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_text = ls_dd07v-ddtext.&lt;/P&gt;&lt;P&gt;  CONCATENATE 'Date' ' (' lv_text ')' INTO lv_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Priya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Jun 2006 15:45:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-20T15:45:49Z</dc:date>
    <item>
      <title>How to customize date format error? help!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447889#M212346</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 have a select-option element for date. I have mapped it to type SY-DATUM.&lt;/P&gt;&lt;P&gt;When i run the selection screen, and try to give a junk date, the system generating an error: Enter date in format: __/__/____.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to my custom error message : Enter date in format: MM/DD/YYYY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. So how to override the system error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more thing, in SAP the date format depends on the format specified in the user's profile. So if a user with date format DD.MM.YYYY runs my program then he will get a message:Enter date in format: __.__.____&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. So how to get the user's date format and dynamically update the format in the comment statement. SELECTION-SCREEN COMMENT /32(50) 'DD/MM/YYYY'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Gopal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 15:07:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447889#M212346</guid>
      <dc:creator>gopalkrishna_baliga</dc:creator>
      <dc:date>2006-06-20T15:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize date format error? help!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447890#M212347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, that message is from message class 00 and message number 65.  Notice that it has a variable for the format.  I beleive this will be filled by the formatting of the user specific setting.  So,  just changing the message is not going to help here.  Looks like you will need to use another field type and handle it manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can get the user setting from USR01.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 

data: xusr01 type usr01.

 select single * from usr01 into xusr01
                where bname = sy-uname.

*1	DD.MM.YYYY
*2	MM/DD/YYYY
*3	MM-DD-YYYY
*4	YYYY.MM.DD
*5	YYYY/MM/DD
*6	YYYY-MM-DD

  case xusr01-datfm.

    when '1'.

    when '2'.

    when '3'.

    when '4'.

    when '5'.

    when '6'.

  endcase.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 15:14:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447890#M212347</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-20T15:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize date format error? help!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447891#M212348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It gives you date fromat from user profile ( tr.SU3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RETRIEVE USER PROFILE DATE SETTING&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  select single datfm&lt;/P&gt;&lt;P&gt;         into   user_set&lt;/P&gt;&lt;P&gt;         from   usr01&lt;/P&gt;&lt;P&gt;         where  bname = sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just check it  and give error message ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this&amp;#146;ll give you idea!!&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Pl... award the points.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Good luck &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Saquib Khan&lt;/P&gt;&lt;P&gt;"Some are wise and some are otherwise"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 15:17:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447891#M212348</guid>
      <dc:creator>former_member181966</dc:creator>
      <dc:date>2006-06-20T15:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize date format error? help!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447892#M212349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can fill your comment with the current user specific format in this way.  Here we are getting the text from the domain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

select-options: s_datum for sy-datum.
selection-screen comment /32(20) dt_fmt.


at selection-screen output.

  data: xusr01 type usr01.
  data: idd07v type table of  dd07v with header line.

  select single * from usr01 into xusr01
                 where bname = sy-uname.

*1	DD.MM.YYYY
*2	MM/DD/YYYY
*3	MM-DD-YYYY
*4	YYYY.MM.DD
*5	YYYY/MM/DD
*6	YYYY-MM-DD

  call function 'DD_DOMVALUES_GET'
       exporting
            domname        = 'XUDATFM'
            text           = 'X'
            langu          = sy-langu
       tables
            dd07v_tab      = idd07v
       exceptions
            wrong_textflag = 1
            others         = 2.

  read table idd07v with key DOMVALUE_L = xusr01-datfm.
  if sy-subrc  = 0.
    dt_fmt = idd07v-ddtext.
  endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 15:27:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447892#M212349</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-20T15:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize date format error? help!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447893#M212350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gopal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample code.&lt;/P&gt;&lt;P&gt;DATA: lv_value    TYPE domvalue_l,&lt;/P&gt;&lt;P&gt;      ls_usr01    TYPE usr01,&lt;/P&gt;&lt;P&gt;      ls_dd07v    TYPE dd07v.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK TEST.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF LINE.&lt;/P&gt;&lt;P&gt;  SELECTION-SCREEN COMMENT 1(18) lv_text&lt;/P&gt;&lt;P&gt;          FOR FIELD s_date.&lt;/P&gt;&lt;P&gt;  SELECT-OPTIONS  s_date FOR sy-datum.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF LINE.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get date format code from user profile&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'CETA_USR01_READ'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      BNAME          = sy-uname&lt;/P&gt;&lt;P&gt;   IMPORTING&lt;/P&gt;&lt;P&gt;     USR01_EXP       = ls_usr01&lt;/P&gt;&lt;P&gt;   EXCEPTIONS&lt;/P&gt;&lt;P&gt;     NO_ENTRY        = 1&lt;/P&gt;&lt;P&gt;     OTHERS          = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the date format text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  lv_value = ls_usr01-datfm.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'DD_DOMVALUE_TEXT_GET'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      DOMNAME             = 'XUDATFM'&lt;/P&gt;&lt;P&gt;      VALUE               = lv_value&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      DD07V_WA            = ls_dd07v.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lv_text = ls_dd07v-ddtext.&lt;/P&gt;&lt;P&gt;  CONCATENATE 'Date' ' (' lv_text ')' INTO lv_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Priya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 15:45:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447893#M212350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-20T15:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize date format error? help!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447894#M212351</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 still did not get the aswer for how to override system error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a sample subroutine to check format is valid or not. But before this subroutine gets fired system is generating its error message: Enter date format in: __/__/____. I am calling my subroutine in &lt;/P&gt;&lt;P&gt;at selection-screen event and on pressing "execute" button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is how to override this system error with my own custom message. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Gopal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 04:27:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-customize-date-format-error-help/m-p/1447894#M212351</guid>
      <dc:creator>gopalkrishna_baliga</dc:creator>
      <dc:date>2006-06-21T04:27:44Z</dc:date>
    </item>
  </channel>
</rss>

