<?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 create table field inside the dynamically created table? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-table-field-inside-the-dynamically-created-table/m-p/1072732#M95335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Srikanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT WORKS NOW! Hurra ! Thank you !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tatiana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Dec 2005 13:35:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-09T13:35:25Z</dc:date>
    <item>
      <title>How to create table field inside the dynamically created table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-table-field-inside-the-dynamically-created-table/m-p/1072730#M95333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, All!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created dynamic internal table (using field catalog and CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table )&lt;/P&gt;&lt;P&gt;and put this table  into FM REUSE_ALV_GRID_DISPLAY. ALV grid work. Now I need to color rows of my ALV, therefore  I have to insert new column with name "COLORS" and type lvc_t_scol. I  see three ways to do it , but all ones are unsuccessful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Insert column into field catalog. FM REUSE_ALV_FIELDCATALOG_MERGE does not return info about "COLORS" I guess because COLORS is a table.&lt;/P&gt;&lt;P&gt;2. Insert column into field catalog manually. It provides a short dump during dynamic table creating or during call of REUSE_ALV_GRID_DISPLAY.&lt;/P&gt;&lt;P&gt;3. Create dyn table first, then add new field . I could not find a way how to do it :(((((((&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tatiana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2005 13:01:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-table-field-inside-the-dynamically-created-table/m-p/1072730#M95333</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-09T13:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table field inside the dynamically created table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-table-field-inside-the-dynamically-created-table/m-p/1072731#M95334</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;Are you doing some thing like the following and still it is not working?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add cell color table.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALENDAR_TYPE is a structure in the dictionary with a&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field called COLTAB of type LVC_T_SCOL. You can use&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;any structure and field that has the type LVC_T_SCOL.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_fieldcat-fieldname = 'T_CELLCOLORS'.&lt;/P&gt;&lt;P&gt;wa_fieldcat-ref_field = 'COLTAB'.&lt;/P&gt;&lt;P&gt;wa_fieldcat-ref_table = 'CALENDAR_TYPE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND wa_fieldcat TO t_fieldcat1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then call to cl_alv_table_create=&amp;gt;create_dynamic_table ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rest of the code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And do not forget to mention it in your Layout structure's&lt;/P&gt;&lt;P&gt;COLTAB_FNAME field..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Infact Check the following link, very useful..&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="83984"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srikanth Pinnamaneni&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2005 13:22:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-table-field-inside-the-dynamically-created-table/m-p/1072731#M95334</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-09T13:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table field inside the dynamically created table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-table-field-inside-the-dynamically-created-table/m-p/1072732#M95335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Srikanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT WORKS NOW! Hurra ! Thank you !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tatiana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2005 13:35:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-table-field-inside-the-dynamically-created-table/m-p/1072732#M95335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-09T13:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table field inside the dynamically created table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-table-field-inside-the-dynamically-created-table/m-p/1072733#M95336</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;Here is the solution for this problem, Sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZCHA_ALV_GRID_CELL_COLOR                                    *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZCHA_ALV_GRID_CELL_COLOR                .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES:MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: W_CONTAINER         TYPE SCRFNAME VALUE 'ALV_CONTAINER',&lt;/P&gt;&lt;P&gt;      W_GRID              TYPE REF TO CL_GUI_ALV_GRID,&lt;/P&gt;&lt;P&gt;      W_CUSTOM_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     W_EVENT_RECEIVER    TYPE REF TO LCL_EVENT_RECEIVER.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*layout&lt;/P&gt;&lt;P&gt;DATA: WA_LAYOUT           TYPE LVC_S_LAYO.&lt;/P&gt;&lt;P&gt;*field catalog&lt;/P&gt;&lt;P&gt;DATA: IT_FIELDCAT_WRT_OFF TYPE LVC_T_FCAT,&lt;/P&gt;&lt;P&gt;      WA_FIELDCAT_WRT_OFF TYPE LVC_S_FCAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:BEGIN OF IT_MARA OCCURS 0,&lt;/P&gt;&lt;P&gt;     MATNR LIKE MARA-MATNR,&lt;/P&gt;&lt;P&gt;     MAKTX LIKE MAKT-MAKTX,&lt;/P&gt;&lt;P&gt;     CELLCOLORS TYPE LVC_T_SCOL,&lt;/P&gt;&lt;P&gt;     END OF IT_MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT P~MATNR&lt;/P&gt;&lt;P&gt;       Q~MAKTX&lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF TABLE IT_MARA&lt;/P&gt;&lt;P&gt;       FROM MARA AS P INNER JOIN&lt;/P&gt;&lt;P&gt;            MAKT AS Q ON&lt;/P&gt;&lt;P&gt;            P&lt;SUB&gt;MATNR = Q&lt;/SUB&gt;MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL SCREEN 100.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE STATUS_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;  SET PF-STATUS 'STATUS'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; SET TITLEBAR 'xxx'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT W_CONTAINER IS INITIAL.&lt;/P&gt;&lt;P&gt;    CREATE OBJECT W_CUSTOM_CONTAINER&lt;/P&gt;&lt;P&gt;             EXPORTING CONTAINER_NAME = W_CONTAINER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CREATE OBJECT W_GRID&lt;/P&gt;&lt;P&gt;             EXPORTING I_PARENT = W_CUSTOM_CONTAINER.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR IT_FIELDCAT_WRT_OFF.&lt;/P&gt;&lt;P&gt;  REFRESH IT_FIELDCAT_WRT_OFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WA_FIELDCAT_WRT_OFF-FIELDNAME = 'MATNR'.&lt;/P&gt;&lt;P&gt;  WA_FIELDCAT_WRT_OFF-COL_POS   = '1'.&lt;/P&gt;&lt;P&gt;  WA_FIELDCAT_WRT_OFF-OUTPUTLEN = '35'.&lt;/P&gt;&lt;P&gt;  WA_FIELDCAT_WRT_OFF-SCRTEXT_L = 'Material No'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND WA_FIELDCAT_WRT_OFF TO IT_FIELDCAT_WRT_OFF.&lt;/P&gt;&lt;P&gt;  CLEAR WA_FIELDCAT_WRT_OFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WA_FIELDCAT_WRT_OFF-FIELDNAME = 'MAKTX'.&lt;/P&gt;&lt;P&gt;  WA_FIELDCAT_WRT_OFF-COL_POS   = '2'.&lt;/P&gt;&lt;P&gt;  WA_FIELDCAT_WRT_OFF-OUTPUTLEN = '45'.&lt;/P&gt;&lt;P&gt;  WA_FIELDCAT_WRT_OFF-SCRTEXT_L = 'Material Desc'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND WA_FIELDCAT_WRT_OFF TO IT_FIELDCAT_WRT_OFF.&lt;/P&gt;&lt;P&gt;  CLEAR WA_FIELDCAT_WRT_OFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA LS_CELLCOLOR TYPE LVC_S_SCOL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE IT_MARA INDEX 5 .&lt;/P&gt;&lt;P&gt;  LS_CELLCOLOR-FNAME = 'MATNR'.&lt;/P&gt;&lt;P&gt;  LS_CELLCOLOR-COLOR-COL = '3'.&lt;/P&gt;&lt;P&gt;  LS_CELLCOLOR-COLOR-INT = '1'.&lt;/P&gt;&lt;P&gt;  APPEND LS_CELLCOLOR TO IT_MARA-CELLCOLORS.&lt;/P&gt;&lt;P&gt;  MODIFY IT_MARA INDEX 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WA_LAYOUT-CTAB_FNAME = 'CELLCOLORS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD W_GRID-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      IS_LAYOUT       = WA_LAYOUT&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IT_FIELDCATALOG = IT_FIELDCAT_WRT_OFF&lt;/P&gt;&lt;P&gt;      IT_OUTTAB       = IT_MARA[].&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE USER_COMMAND_0100 INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CASE SY-UCOMM.&lt;/P&gt;&lt;P&gt;    WHEN 'BACK'.&lt;/P&gt;&lt;P&gt;      LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to assign appropriate points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2005 13:52:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-table-field-inside-the-dynamically-created-table/m-p/1072733#M95336</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-09T13:52:28Z</dc:date>
    </item>
  </channel>
</rss>

