<?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 Change the code do daynamic way in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-the-code-do-daynamic-way/m-p/6160376#M1370035</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;since i using methods i can do perform,&lt;/P&gt;&lt;P&gt;can i do it it better way instead of using the same logic for 3 time ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Chris &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lt_type_format =  me-&amp;gt;get_domain_value( ms_defultes ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF is_dev-date_format IS INITIAL.
    READ TABLE lt_type_format ASSIGNING &amp;lt;ls_type_format&amp;gt;
    WITH KEY domain_name = clconstants=&amp;gt;gc_date_type.
    is_de-date_format =   &amp;lt;ls_type_format&amp;gt;-format_value."Get date format
  ENDIF.

  IF is_de-time_format IS INITIAL.
    READ TABLE lt_type_format ASSIGNING &amp;lt;ls_type_format&amp;gt;
    WITH KEY domain_name = clconstants=&amp;gt;gc_time_type.
    is_de-time_format =   &amp;lt;ls_type_format&amp;gt;-format_value."Get time format
  ENDIF.

  IF is_de-num_format IS INITIAL.
    READ TABLE lt_type_format ASSIGNING &amp;lt;ls_type_format&amp;gt;
    WITH KEY domain_name = clconstants=&amp;gt;gc_dec_type.
    is_de-num_format  =   &amp;lt;ls_type_format&amp;gt;-format_value."Get dec notation
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Chris Teb on Oct 7, 2009 10:10 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Oct 2009 07:54:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-07T07:54:07Z</dc:date>
    <item>
      <title>Change the code do daynamic way</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-the-code-do-daynamic-way/m-p/6160376#M1370035</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;since i using methods i can do perform,&lt;/P&gt;&lt;P&gt;can i do it it better way instead of using the same logic for 3 time ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Chris &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lt_type_format =  me-&amp;gt;get_domain_value( ms_defultes ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF is_dev-date_format IS INITIAL.
    READ TABLE lt_type_format ASSIGNING &amp;lt;ls_type_format&amp;gt;
    WITH KEY domain_name = clconstants=&amp;gt;gc_date_type.
    is_de-date_format =   &amp;lt;ls_type_format&amp;gt;-format_value."Get date format
  ENDIF.

  IF is_de-time_format IS INITIAL.
    READ TABLE lt_type_format ASSIGNING &amp;lt;ls_type_format&amp;gt;
    WITH KEY domain_name = clconstants=&amp;gt;gc_time_type.
    is_de-time_format =   &amp;lt;ls_type_format&amp;gt;-format_value."Get time format
  ENDIF.

  IF is_de-num_format IS INITIAL.
    READ TABLE lt_type_format ASSIGNING &amp;lt;ls_type_format&amp;gt;
    WITH KEY domain_name = clconstants=&amp;gt;gc_dec_type.
    is_de-num_format  =   &amp;lt;ls_type_format&amp;gt;-format_value."Get dec notation
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Chris Teb on Oct 7, 2009 10:10 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2009 07:54:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-the-code-do-daynamic-way/m-p/6160376#M1370035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-07T07:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change the code do daynamic way</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-the-code-do-daynamic-way/m-p/6160377#M1370036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create your lt_type_format as the attribute of your class.&lt;/P&gt;&lt;P&gt;Create a method say GET_FORMAT&lt;/P&gt;&lt;P&gt;Signature: &lt;/P&gt;&lt;P&gt;Importing IV_TYPE TYPE CHAR30 (pass clconstants=&amp;gt;gc_date_type or clconstants=&amp;gt;gc_time_type)&lt;/P&gt;&lt;P&gt;Returning RV_FORMAT TYPE CHAR30 ( Recieve the value back)&lt;/P&gt;&lt;P&gt;Use the Read statement to read the table LT_TYPE_FORMAT and send back the values in RF_FORMAT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_format DEFINITION.
  PUBLIC SECTION.
    METHODS:
      constructor,
      get_format
        IMPORTING
          iv_type TYPE char30
        RETURNING value(rv_format) TYPE char30.
  PRIVATE SECTION.
    TYPES: BEGIN OF ty_tab,
             format_type TYPE char30,
             format      TYPE char30,
           END   OF ty_tab.
    DATA: i_tab TYPE STANDARD TABLE OF ty_tab.
ENDCLASS.                    "lcl_format DEFINITION

START-OF-SELECTION.
  DATA: o_format TYPE REF TO lcl_format,
        lv_date_format TYPE char30,
        lv_time_format  TYPE char30.
  CREATE OBJECT o_format.
  lv_date_format = o_format-&amp;gt;get_format( 'D' ).
  WRITE: / lv_date_format.
  lv_time_format = o_format-&amp;gt;get_format( 'T' ).
  WRITE: / lv_time_format.

CLASS lcl_format IMPLEMENTATION.

  METHOD constructor.
    FIELD-SYMBOLS: &amp;lt;lfs_tab&amp;gt; LIKE LINE OF me-&amp;gt;i_tab.
    APPEND INITIAL LINE TO me-&amp;gt;i_tab ASSIGNING &amp;lt;lfs_tab&amp;gt;.
    &amp;lt;lfs_tab&amp;gt;-format_type = 'D'.
    &amp;lt;lfs_tab&amp;gt;-format = 'MM/DD/YYYY'.
    APPEND INITIAL LINE TO me-&amp;gt;i_tab ASSIGNING &amp;lt;lfs_tab&amp;gt;.
    &amp;lt;lfs_tab&amp;gt;-format_type = 'T'.
    &amp;lt;lfs_tab&amp;gt;-format = 'HHMMSS'.
  ENDMETHOD.                    "constructor

  METHOD get_format.
    FIELD-SYMBOLS: &amp;lt;lfs_tab&amp;gt; LIKE LINE OF me-&amp;gt;i_tab.
    DATA: lv_key TYPE string.
    READ TABLE me-&amp;gt;i_tab ASSIGNING &amp;lt;lfs_tab&amp;gt;
      WITH KEY format_type = iv_type.
    IF sy-subrc = 0.
      rv_format = &amp;lt;lfs_tab&amp;gt;-format.
    ENDIF.
  ENDMETHOD.                    "get_format

ENDCLASS  .                    "lcl_format IMPLEMENTATION
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2009 15:29:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-the-code-do-daynamic-way/m-p/6160377#M1370036</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2009-10-07T15:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change the code do daynamic way</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-the-code-do-daynamic-way/m-p/6160378#M1370037</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;what is the purpose of &lt;U&gt;APPEND INITIAL LINE TO&lt;/U&gt;   ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 08:07:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-the-code-do-daynamic-way/m-p/6160378#M1370037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-08T08:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change the code do daynamic way</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-the-code-do-daynamic-way/m-p/6160379#M1370038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you use the field-symbols instead of the work area, you need to use the APPEND INITIAL LINE.. ASSIGNING &amp;lt;FS&amp;gt; to assign that new line to your Field-Symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code with Work area&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: WA_TAB LIKE LINE OF ITAB.
WA_TAB-FIELD1 = 'TEST'.
APPEND WA_TAB TO ITAB.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And code with Field-symbols:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FIELD-SYMBOLS: &amp;lt;FS_TAB&amp;gt; LIKE LINE OF ITAB.
APPEND INITIAL LINE TO ITAB ASSIGNING &amp;lt;FS_TAB&amp;gt;.
&amp;lt;FS_TAB&amp;gt;-FIELD1 = 'TEST'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Achieve the same end result, it appends a line to Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 13:41:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-the-code-do-daynamic-way/m-p/6160379#M1370038</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2009-10-08T13:41:21Z</dc:date>
    </item>
  </channel>
</rss>

