<?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: Field catalog in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-catalog/m-p/4734999#M1111142</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a ton man....u took me out of a big troublesome situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Nov 2008 10:35:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-11T10:35:41Z</dc:date>
    <item>
      <title>Field catalog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-catalog/m-p/4734997#M1111140</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;I want to create a dynamic internal table which will be having a field as nested internal table.&lt;/P&gt;&lt;P&gt;how to make field catalog for such a dynamic table to craete a nested structure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ny kinda help is alwayz appreciated&lt;/P&gt;&lt;P&gt;Thanks n Regards,&lt;/P&gt;&lt;P&gt;Vivek Gaur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2008 09:33:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-catalog/m-p/4734997#M1111140</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-11T09:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Field catalog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-catalog/m-p/4734998#M1111141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vivek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Look Below Code this may help full for u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ztest_dynamic_table.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;r_dyn_table TYPE REF TO data,&lt;/P&gt;&lt;P&gt;r_wa_dyn_table TYPE REF TO data,&lt;/P&gt;&lt;P&gt;r_dock_ctnr TYPE REF TO cl_gui_docking_container,&lt;/P&gt;&lt;P&gt;r_alv_grid TYPE REF TO cl_gui_alv_grid,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;t_fieldcat1 TYPE lvc_t_fcat, "with cell color&lt;/P&gt;&lt;P&gt;t_fieldcat2 TYPE lvc_t_fcat, "without cell color&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;wa_fieldcat LIKE LINE OF t_fieldcat1,&lt;/P&gt;&lt;P&gt;wa_cellcolors TYPE LINE OF lvc_t_scol,&lt;/P&gt;&lt;P&gt;wa_is_layout TYPE lvc_s_layo.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS:&lt;/P&gt;&lt;P&gt;&amp;lt;t_dyn_table&amp;gt; TYPE STANDARD TABLE,&lt;/P&gt;&lt;P&gt;&amp;lt;wa_dyn_table&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;&amp;lt;t_cellcolors&amp;gt; TYPE lvc_t_scol,&lt;/P&gt;&lt;P&gt;&amp;lt;w_field&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build field catalog based on your criteria.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;wa_fieldcat-fieldname = 'FIELD1'.&lt;/P&gt;&lt;P&gt;wa_fieldcat-inttype = 'C'.&lt;/P&gt;&lt;P&gt;wa_fieldcat-outputlen = '10'.&lt;/P&gt;&lt;P&gt;wa_fieldcat-coltext = 'My Field 1'.&lt;/P&gt;&lt;P&gt;wa_fieldcat-seltext = wa_fieldcat-coltext.&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;wa_fieldcat-fieldname = 'FIELD2'.&lt;/P&gt;&lt;P&gt;wa_fieldcat-inttype = 'C'.&lt;/P&gt;&lt;P&gt;wa_fieldcat-outputlen = '10'.&lt;/P&gt;&lt;P&gt;wa_fieldcat-coltext = 'My Field 2'.&lt;/P&gt;&lt;P&gt;wa_fieldcat-seltext = wa_fieldcat-coltext.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Before adding cell color table, save fieldcatalog to pass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;to ALV call. The ALV call needs a fieldcatalog without&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the internal table for cell coloring.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;t_fieldcat2[] = t_fieldcat1[].&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic table including the internal table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;for cell coloring.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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_fieldcat1&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;ep_table = r_dyn_table&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;IF sy-subrc  0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get access to new table using field symbol.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ASSIGN r_dyn_table-&amp;gt;* TO &amp;lt;t_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create work area for new table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CREATE DATA r_wa_dyn_table LIKE LINE OF &amp;lt;t_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get access to new work area using field symbol.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ASSIGN r_wa_dyn_table-&amp;gt;* TO &amp;lt;wa_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get data into table from somewhere. Field names are&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;known at this point because field catalog is already&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;built. Read field names from the field catalog or use&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;COMPONENT &amp;lt;number&amp;gt; in a DO loop to access the fields. A&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;simpler hard coded approach is used here.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 'FIELD1' OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;w_field&amp;gt; = 'ABC'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 'FIELD2' OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;w_field&amp;gt; = 'XYZ'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;APPEND &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;t_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 'FIELD1' OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;w_field&amp;gt; = 'TUV'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 'FIELD2' OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;w_field&amp;gt; = 'DEF'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;APPEND &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;t_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Color cells based on your criteria. In this example, a test on&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FIELD2 is used to decide on color.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;t_dyn_table&amp;gt; INTO &amp;lt;wa_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 'FIELD2' OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get access to internal table used to color cells.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 'T_CELLCOLORS'&lt;/P&gt;&lt;P&gt;OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;t_cellcolors&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CLEAR wa_cellcolors.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;wa_cellcolors-fname = 'FIELD2'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;IF &amp;lt;w_field&amp;gt; = 'DEF'.&lt;/P&gt;&lt;P&gt;wa_cellcolors-color-col = '7'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;wa_cellcolors-color-col = '5'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;APPEND wa_cellcolors TO &amp;lt;t_cellcolors&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;t_dyn_table&amp;gt; FROM &amp;lt;wa_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDLOOP.&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;Display screen. Define screen 100 as empty, with next screen&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;set to 0 and flow logic of:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PROCESS BEFORE OUTPUT.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MODULE initialization.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PROCESS AFTER INPUT.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL SCREEN 100.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&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;MODULE initialization OUTPUT&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; &lt;/P&gt;&lt;P&gt;MODULE initialization OUTPUT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set up for ALV display.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;IF r_dock_ctnr IS INITIAL.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CREATE OBJECT r_dock_ctnr&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;side = cl_gui_docking_container=&amp;gt;dock_at_left&lt;/P&gt;&lt;P&gt;ratio = '90'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CREATE OBJECT r_alv_grid&lt;/P&gt;&lt;P&gt;EXPORTING i_parent = r_dock_ctnr.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set ALV controls for cell coloring table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;wa_is_layout-ctab_fname = 'T_CELLCOLORS'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL METHOD r_alv_grid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;is_layout = wa_is_layout&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;it_outtab = &amp;lt;t_dyn_table&amp;gt;&lt;/P&gt;&lt;P&gt;it_fieldcatalog = t_fieldcat2.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ELSE. "grid already prepared&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Refresh display.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL METHOD r_alv_grid-&amp;gt;refresh_table_display&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_soft_refresh = ' '&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;finished = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDMODULE. " initialization OUTPUT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2008 10:18:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-catalog/m-p/4734998#M1111141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-11T10:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Field catalog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-catalog/m-p/4734999#M1111142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a ton man....u took me out of a big troublesome situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2008 10:35:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-catalog/m-p/4734999#M1111142</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-11T10:35:41Z</dc:date>
    </item>
  </channel>
</rss>

