<?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: Dynamic table with field type table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129626#M743404</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know, thse are the things you will need to do:&lt;/P&gt;&lt;P&gt;1. In your structure w_layout, there should be field called INFO_FIELDNAME which should be set to 'COLOR'.&lt;/P&gt;&lt;P&gt;2. In the the final output internal table that you are outputting using the field catalog add an additional field called COLOR defined as char 3.&lt;/P&gt;&lt;P&gt;3. Set the value of and this color parameter to be 'C20' ex: t_final-color = 'C20'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: C20 is only an example color, you may want to change the number based on what color you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this, it worked for me for multiple list ALV.. it should work for the grid too..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Nov 2007 19:07:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-29T19:07:53Z</dc:date>
    <item>
      <title>Dynamic table with field type table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129624#M743402</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´m using "cl_alv_table_create=&amp;gt;create_dynamic_table" to create a dynamic table for ALV Grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But...I need to use colors in ALV, then I need to declare a field type LVC_S_SCOL in dynamic table from "cl_alv_table_create=&amp;gt;create_dynamic_table".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I declare this in fieldcat?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;B&gt;The code:&lt;/B&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating dynamic table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: table_agrup TYPE REF TO data,&lt;/P&gt;&lt;P&gt;        line_agrup  TYPE REF TO data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      it_fieldcatalog           = t_fieldcat&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ep_table                  = table_agrup&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      generate_subpool_dir_full = 1&lt;/P&gt;&lt;P&gt;      OTHERS                    = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ASSIGN table_agrup-&amp;gt;* TO .&lt;/P&gt;&lt;P&gt;&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;Printing ALV&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD obj_grid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      is_variant                    = w_variant&lt;/P&gt;&lt;P&gt;      i_save                        = 'A'&lt;/P&gt;&lt;P&gt;      is_layout                     = w_layout&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      it_outtab                     = &lt;/P&gt;&lt;TABLE&gt;&lt;/TABLE&gt;&lt;P&gt;      it_fieldcatalog               = t_fieldcat&lt;/P&gt;&lt;P&gt;      it_sort                       = t_sort&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      invalid_parameter_combination = 1&lt;/P&gt;&lt;P&gt;      program_error                 = 2&lt;/P&gt;&lt;P&gt;      too_many_lines                = 3&lt;/P&gt;&lt;P&gt;      OTHERS                        = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2007 18:55:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129624#M743402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-29T18:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table with field type table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129625#M743403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know, thse are the things you will need to do:&lt;/P&gt;&lt;P&gt;1. In your structure w_layout, there should be field called INFO_FIELDNAME which should be set to 'COLOR'.&lt;/P&gt;&lt;P&gt;2. In the the final output internal table that you are outputting using the field catalog add an additional field called COLOR defined as char 3.&lt;/P&gt;&lt;P&gt;3. Set the value of and this color parameter to be 'C20' ex: t_final-color = 'C20'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: C20 is only an example color, you may want to change the number based on what color you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this, it worked for me for multiple list ALV.. it should work for the grid too..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2007 19:07:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129625#M743403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-29T19:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table with field type table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129626#M743404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know, thse are the things you will need to do:&lt;/P&gt;&lt;P&gt;1. In your structure w_layout, there should be field called INFO_FIELDNAME which should be set to 'COLOR'.&lt;/P&gt;&lt;P&gt;2. In the the final output internal table that you are outputting using the field catalog add an additional field called COLOR defined as char 3.&lt;/P&gt;&lt;P&gt;3. Set the value of and this color parameter to be 'C20' ex: t_final-color = 'C20'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: C20 is only an example color, you may want to change the number based on what color you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this, it worked for me for multiple list ALV.. it should work for the grid too..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2007 19:07:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129626#M743404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-29T19:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table with field type table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129627#M743405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but this is not solution for this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need colors in diferents cells. &lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;ALV Grid:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;line 1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;date1 (*)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;date2 &lt;SPAN __jive_emoticon_name="minus"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;date3 (*)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;line 2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;date1 &lt;SPAN __jive_emoticon_name="minus"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;date2 (*)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;date3 &lt;SPAN __jive_emoticon_name="minus"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;line 3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;date1 (*)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;date2 &lt;SPAN __jive_emoticon_name="minus"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;date3 &lt;SPAN __jive_emoticon_name="minus"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(*) Red&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="minus"&gt;&lt;/SPAN&gt; White&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2007 19:35:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129627#M743405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-29T19:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table with field type table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129628#M743406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not possible with the  METHOD cl_alv_table_create=&amp;gt;create_dynamic_table to include another table inside that newly generated table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to do it with the code and I got the dynamic table created after at the end of the program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code, &lt;/P&gt;&lt;P&gt;&amp;lt;DYN_TABLE&amp;gt; has same effect as your &amp;lt;table&amp;gt; variable&lt;/P&gt;&lt;P&gt;&amp;lt;DYN_WA&amp;gt; has same effect as your &amp;lt;HEADER&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ZTEST_NP_DYNAMIC.


DATA: DY_TABLE TYPE REF TO DATA,
      DY_LINE  TYPE REF TO DATA.

FIELD-SYMBOLS: &amp;lt;DYN_TABLE&amp;gt; TYPE STANDARD TABLE,
               &amp;lt;DYN_WA&amp;gt;,
               &amp;lt;DYN_FIELD&amp;gt;.

FIELD-SYMBOLS: &amp;lt;FS&amp;gt; TYPE ANY.

* To generate the Dyanmic table with the COLOR
DATA: LS_SOURCE TYPE STRING.
DATA: LT_SOURCE LIKE STANDARD TABLE OF LS_SOURCE WITH HEADER LINE.

DATA: L_NAME LIKE SY-REPID.
DATA: L_MESSAGE(240) TYPE C,
      L_LINE TYPE I,
      L_WORD(72) TYPE C.

DATA: L_FORM(30) TYPE C VALUE 'TABLE_CREATE'.

LT_SOURCE = 'REPORT ZTEST_SUBROUTINE_POOL.'.
APPEND LT_SOURCE.

LT_SOURCE = 'FORM  TABLE_CREATE USING I_FS TYPE ANY.'.
APPEND LT_SOURCE.

LT_SOURCE = 'DATA: BEGIN OF LT_GENTAB OCCURS 0.'.
APPEND LT_SOURCE.

LT_SOURCE = 'DATA: BUKRS TYPE BUKRS. '.
APPEND LT_SOURCE.

LT_SOURCE = 'DATA: BKTXT TYPE BKTXT. '.
APPEND LT_SOURCE.
* you can add your fields here.....

LT_SOURCE = 'DATA: COLOR TYPE lvc_t_scol. '.
APPEND LT_SOURCE.

LT_SOURCE = 'DATA: END OF LT_GENTAB.'.
APPEND LT_SOURCE.

LT_SOURCE = 'DATA: POINTER TYPE REF TO DATA.'.
APPEND LT_SOURCE.

LT_SOURCE = 'CREATE DATA POINTER LIKE STANDARD TABLE OF LT_GENTAB.'.
APPEND LT_SOURCE.

LT_SOURCE = 'I_FS = POINTER.'.
APPEND LT_SOURCE.

LT_SOURCE = 'ENDFORM. '.
APPEND LT_SOURCE.

L_NAME = 'ZTEST_SUBROUTINE_POOL'.

CATCH SYSTEM-EXCEPTIONS GENERATE_SUBPOOL_DIR_FULL = 9.
  GENERATE SUBROUTINE POOL LT_SOURCE NAME L_NAME
           MESSAGE L_MESSAGE LINE L_LINE WORD L_WORD.  "#EC CI_GENERATE
ENDCATCH.

IF NOT L_MESSAGE IS INITIAL.
  MESSAGE E000(0K) WITH L_MESSAGE L_LINE L_WORD.
ENDIF.

ASSIGN DY_TABLE TO &amp;lt;FS&amp;gt;.

PERFORM (L_FORM) IN PROGRAM (L_NAME) USING &amp;lt;FS&amp;gt;.

ASSIGN DY_TABLE-&amp;gt;* TO &amp;lt;DYN_TABLE&amp;gt;.

* Create dynamic work area and assign to FS
CREATE DATA DY_LINE LIKE LINE OF &amp;lt;DYN_TABLE&amp;gt;.
ASSIGN DY_LINE-&amp;gt;* TO &amp;lt;DYN_WA&amp;gt;.


Write: 'bye'.&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>Thu, 29 Nov 2007 20:43:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129628#M743406</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2007-11-29T20:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table with field type table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129629#M743407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! This is the solution!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2007 10:46:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-with-field-type-table/m-p/3129629#M743407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-30T10:46:31Z</dc:date>
    </item>
  </channel>
</rss>

