<?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: Alv date format change and need hardcoded value in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-date-format-change-and-need-hardcoded-value/m-p/6335771#M1396778</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;  when u make the final table , at that time u have to pass the constant value to vtweg field .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for date , u have to write a logic to change the format and pass the value to date field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no need to change the field catalog.&lt;/P&gt;&lt;P&gt;for date , u do not refer field to standard dataelement . only refer to char10.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Nov 2009 05:09:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-13T05:09:28Z</dc:date>
    <item>
      <title>Alv date format change and need hardcoded value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-date-format-change-and-need-hardcoded-value/m-p/6335770#M1396777</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;&lt;/P&gt;&lt;P&gt;In my ALV output, I need to change the date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Presently in final table i am getting date in following format. 21.09.2009 but in output i need it in 21/09/2009.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest how to do it programitically. Date field &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; ls_fieldtab-tabname = 'IT_FINAL'.&lt;/P&gt;&lt;P&gt;  ls_fieldtab-fieldname = 'SPTAG'.&lt;/P&gt;&lt;P&gt;  ls_fieldtab-seltext_s = ls_fieldtab-seltext_m =&lt;/P&gt;&lt;P&gt;  ls_fieldtab-seltext_l = 'Current Date'.&lt;/P&gt;&lt;P&gt;  APPEND ls_fieldtab TO fieldtab.&lt;/P&gt;&lt;P&gt;  CLEAR ls_fieldtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Distribution Channel :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) In the output , the Distribution channel l should always appers as AS01. Hardcoded . Pls suggest how to do programitically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fieldtab-tabname = 'IT_FINAL'.&lt;/P&gt;&lt;P&gt;  ls_fieldtab-fieldname = 'VTWEG'.&lt;/P&gt;&lt;P&gt;  ls_fieldtab-seltext_s = ls_fieldtab-seltext_m =&lt;/P&gt;&lt;P&gt;  ls_fieldtab-seltext_l = 'DIST. CHANNEL'.&lt;/P&gt;&lt;P&gt;  APPEND ls_fieldtab TO fieldtab.&lt;/P&gt;&lt;P&gt;  CLEAR ls_fieldtab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 05:01:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-date-format-change-and-need-hardcoded-value/m-p/6335770#M1396777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-13T05:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Alv date format change and need hardcoded value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-date-format-change-and-need-hardcoded-value/m-p/6335771#M1396778</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;  when u make the final table , at that time u have to pass the constant value to vtweg field .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for date , u have to write a logic to change the format and pass the value to date field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no need to change the field catalog.&lt;/P&gt;&lt;P&gt;for date , u do not refer field to standard dataelement . only refer to char10.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 05:09:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-date-format-change-and-need-hardcoded-value/m-p/6335771#M1396778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-13T05:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Alv date format change and need hardcoded value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-date-format-change-and-need-hardcoded-value/m-p/6335772#M1396779</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;Try using this Function module  .."CONVERT_DATE_TO_INTERNAL"  for the date format conversion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiki.sdn.sap.com/wiki/display/Snippets/FUNCTION" target="test_blank"&gt;http://wiki.sdn.sap.com/wiki/display/Snippets/FUNCTION&lt;/A&gt;&lt;EM&gt;MODULE&lt;/EM&gt;FOR&lt;EM&gt;CONVERTING&lt;/EM&gt;DATE&lt;EM&gt;INTO&lt;/EM&gt;THE&lt;EM&gt;GIVEN&lt;/EM&gt;FORMAT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz go through the above link .Hope it will be useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Rajasekhar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 06:08:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-date-format-change-and-need-hardcoded-value/m-p/6335772#M1396779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-13T06:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Alv date format change and need hardcoded value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-date-format-change-and-need-hardcoded-value/m-p/6335773#M1396780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can hardcode the date format as you required. &lt;/P&gt;&lt;P&gt;When you appedn this date field into Final table in the loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can write this piece of code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: gd_date(10). &lt;/P&gt;&lt;P&gt;       : Date type sy-datum.        &lt;/P&gt;&lt;P&gt;       : Date_format type SPTAG or Sy-datum. &lt;/P&gt;&lt;P&gt;Move SPTAG to another field...gd_date                        &lt;/P&gt;&lt;P&gt;        gd_date   =   Wa_table-SPTAG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Converts SAP date from 20.01.2001 to 01/09/2001&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  Date(2)   = gd_date+6(2).&lt;/P&gt;&lt;P&gt;  Date&lt;EM&gt;2(2) = gd_date&lt;/EM&gt;4(2).&lt;/P&gt;&lt;P&gt;  Date&lt;EM&gt;4(4) = gd_date&lt;/EM&gt;2(4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can change the above code while checking in the debugger&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CONCATENATE    Date(2) '/' Date&lt;EM&gt;2(2) '/' Date&lt;/EM&gt;4(4) INTO Date_Format. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_final-sptag = Date_format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; append wa_final to it_final. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now pass it to the field catalog&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code is just to give you an idea. You can change it accordingly in your scenario by using diff variables and concatenate into one variable and then pass it to the finalinternal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By doing this it will change the date format at the final internal table level and you will not have any issues displaying it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will resolve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also you the FM :  SLS_MISC_CONVERT_TO_DATE &lt;/P&gt;&lt;P&gt;                        &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, date format's usually displayed ina format in which youe SAP is configured. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://wiki.sdn.sap.com/wiki/display/B1/Changing" target="test_blank"&gt;https://wiki.sdn.sap.com/wiki/display/B1/Changing&lt;/A&gt;&lt;EM&gt;the&lt;/EM&gt;Format&lt;EM&gt;of&lt;/EM&gt;a&lt;EM&gt;Date&lt;/EM&gt;in&lt;EM&gt;a&lt;/EM&gt;Print&lt;EM&gt;Layout&lt;/EM&gt;Design+Template&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1238577"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see that you had posted same topic twice in this thread, it is not recomended. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the issue is still not resolved ,  please paste your code here so that we will be able to assist you.   &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;Kittui&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kittu on Nov 13, 2009 7:37 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kittu on Nov 13, 2009 7:44 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kittu on Nov 13, 2009 8:09 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 06:35:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-date-format-change-and-need-hardcoded-value/m-p/6335773#M1396780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-13T06:35:38Z</dc:date>
    </item>
  </channel>
</rss>

