<?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 Changing Date format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409353#M197294</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a report where the created date ERDAT is displayed in the output as DD/MM/YYYY format . I need to change it to DD/MON/YYYY format. I almost got done with it but for eg ....if my created date is 05/07/2006 in the output. The output should be         05/JUL/2006 in the output.&lt;/P&gt;&lt;P&gt;I am getting the output as   05/JUL/200  .&lt;/P&gt;&lt;P&gt;Please see the snippet code below and give your valuable feedback . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Begin of itab.&lt;/P&gt;&lt;P&gt;erdat(10),&lt;/P&gt;&lt;P&gt;erdat(11),&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to itab.&lt;/P&gt;&lt;P&gt;case itab-erdat+6(2).&lt;/P&gt;&lt;P&gt;WHEN '07'&lt;/P&gt;&lt;P&gt;itab-erdat1+6(3) = 'JUL'.&lt;/P&gt;&lt;P&gt;concatenate itab-erdat&lt;EM&gt;4(2) itab-erdat1&lt;/EM&gt;6(3)&lt;/P&gt;&lt;P&gt;            t_output-erdat(4)&lt;/P&gt;&lt;P&gt;            into t_output-erdat separated by '/'.&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform build_fieldcat_ddic using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ERDAT'       'itab' 'ERDAT' s_tab 'S' ' ' ' ' ' ' ' ' ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Hari  Gopalakrishna&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Jul 2006 19:13:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-05T19:13:29Z</dc:date>
    <item>
      <title>Changing Date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409353#M197294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a report where the created date ERDAT is displayed in the output as DD/MM/YYYY format . I need to change it to DD/MON/YYYY format. I almost got done with it but for eg ....if my created date is 05/07/2006 in the output. The output should be         05/JUL/2006 in the output.&lt;/P&gt;&lt;P&gt;I am getting the output as   05/JUL/200  .&lt;/P&gt;&lt;P&gt;Please see the snippet code below and give your valuable feedback . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Begin of itab.&lt;/P&gt;&lt;P&gt;erdat(10),&lt;/P&gt;&lt;P&gt;erdat(11),&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to itab.&lt;/P&gt;&lt;P&gt;case itab-erdat+6(2).&lt;/P&gt;&lt;P&gt;WHEN '07'&lt;/P&gt;&lt;P&gt;itab-erdat1+6(3) = 'JUL'.&lt;/P&gt;&lt;P&gt;concatenate itab-erdat&lt;EM&gt;4(2) itab-erdat1&lt;/EM&gt;6(3)&lt;/P&gt;&lt;P&gt;            t_output-erdat(4)&lt;/P&gt;&lt;P&gt;            into t_output-erdat separated by '/'.&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform build_fieldcat_ddic using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ERDAT'       'itab' 'ERDAT' s_tab 'S' ' ' ' ' ' ' ' ' ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Hari  Gopalakrishna&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 19:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409353#M197294</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-05T19:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409354#M197295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this you cannot refer to standard data type which is of length 10. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;change the length to char11 and try out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry...think you are already using, then change the field catalog to &amp;lt;b&amp;gt;char&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Manohar Reddy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 19:16:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409354#M197295</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-07-05T19:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409355#M197296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are referring to the ERDAT field in the field catalog whose output length is 10. Refer to some field which has a greater output length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 19:19:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409355#M197296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-05T19:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409356#M197297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see the sample program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0001.


data: begin of itab occurs 0,
      erdat type sy-datum,
      erdat_f(11) type c,
      end of itab.

data: month(3) type c.

itab-erdat = '20060615'.  append itab.
itab-erdat = '20060715'.  append itab.
itab-erdat = '20060815'.  append itab.


loop at itab.

  case itab-erdat+4(2).
    when '06'.
      month = 'JUN'.
    when '07'.
      month = 'JUL'.
    when '08'.
      month = 'AUG'.
  endcase.

  concatenate itab-erdat+6(2) month itab-erdat+0(4)
              into itab-erdat_f separated by '/'.
  modify itab.

endloop.



loop at itab.
  write:/ itab-erdat, itab-erdat_f.

endloop.

&lt;/CODE&gt;&lt;/PRE&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>Wed, 05 Jul 2006 19:25:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409356#M197297</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-05T19:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409357#M197298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Begin of itab.&lt;/P&gt;&lt;P&gt;erdat(10),&lt;/P&gt;&lt;P&gt;erdat1(11),&lt;/P&gt;&lt;P&gt;end of itab,&lt;/P&gt;&lt;P&gt;v_txt_month LIKE t015m-monam.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;SELECT SINGLE monam INTO v_txt_month &lt;/P&gt;&lt;P&gt; FROM t015m&lt;/P&gt;&lt;P&gt;  WHERE spras EQ sy-langu AND&lt;/P&gt;&lt;P&gt;        monum EQ  itab-erdat+4(2).&lt;/P&gt;&lt;P&gt;CONCATENATE itab-erdat+6(2) v_txt_month &lt;/P&gt;&lt;P&gt;t_output-erdat(4)&lt;/P&gt;&lt;P&gt;into itab-erdat1 separated by '/'.&lt;/P&gt;&lt;P&gt;MODIFY itab.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And take care when you fill field catalog for that field, use char11 type.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 19:26:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409357#M197298</guid>
      <dc:creator>LucianoBentiveg</dc:creator>
      <dc:date>2006-07-05T19:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409358#M197299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Rich .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 19:27:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409358#M197299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-05T19:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409359#M197300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may be useful if you don't want to hardcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: v_date LIKE sy-datum,
      v_out_date(11),
      v_mon(3).

DATA: BEGIN OF month_names OCCURS 0.
        INCLUDE STRUCTURE t247.
DATA: END OF month_names.

v_date = sy-datum.

CALL FUNCTION 'MONTH_NAMES_GET'
* EXPORTING
*   LANGUAGE                    = SY-LANGU
* IMPORTING
*   RETURN_CODE                 =
  TABLES
    month_names                 = month_names
* EXCEPTIONS
*   MONTH_NAMES_NOT_FOUND       = 1
*   OTHERS                      = 2
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

CLEAR month_names.
READ TABLE month_names WITH KEY mnr = v_date+4(2).
CHECK sy-subrc = 0.
v_mon = month_names-ktx.

CONCATENATE v_date+6(2)
            v_mon
            v_date+0(4)
       INTO v_out_date SEPARATED BY '/'.

WRITE:/ 'V_DATE = ', v_date,
      / 'V_OUT_DATE = ', v_out_date.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 19:43:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-date-format/m-p/1409359#M197300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-05T19:43:52Z</dc:date>
    </item>
  </channel>
</rss>

