<?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: Missing columns headers -when trying to display dynamic tab - cl_salv_table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/missing-columns-headers-when-trying-to-display-dynamic-tab-cl-salv-table/m-p/4940364#M1152312</link>
    <description>&lt;P&gt;this solution is working&lt;/P&gt;</description>
    <pubDate>Wed, 07 Sep 2022 11:13:30 GMT</pubDate>
    <dc:creator>AJeB</dc:creator>
    <dc:date>2022-09-07T11:13:30Z</dc:date>
    <item>
      <title>Missing columns headers -when trying to display dynamic tab - cl_salv_table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/missing-columns-headers-when-trying-to-display-dynamic-tab-cl-salv-table/m-p/4940361#M1152309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I wrote a small Report that reads dataset from Exelfile into a dynamic Table. After it I would like to display the table with cl_salv_table=&amp;gt;factory function, but there are no columns headers displaying.&lt;/P&gt;&lt;P&gt;Any Ideas ? thanks a lot !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="5" type="ul"&gt;&lt;P&gt;MAKE THE DYNAMIC TABLE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA:&lt;/P&gt;&lt;P&gt;    gr_tabtype TYPE REF TO cl_abap_tabledescr,&lt;/P&gt;&lt;P&gt;    gr_struc   TYPE REF TO cl_abap_structdescr,&lt;/P&gt;&lt;P&gt;    lr_itab    TYPE REF TO data,&lt;/P&gt;&lt;P&gt;    lv_index   TYPE string,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it_component TYPE cl_abap_structdescr=&amp;gt;component_table,&lt;/P&gt;&lt;P&gt;    wa_component LIKE LINE OF it_component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONSTANTS lc_colums TYPE i VALUE 20."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DO lc_colums TIMES.&lt;/P&gt;&lt;P&gt;    lv_index = sy-index.&lt;/P&gt;&lt;P&gt;    CONCATENATE 'col' lv_index INTO wa_component-name.&lt;/P&gt;&lt;P&gt;    CONDENSE wa_component-name NO-GAPS.&lt;/P&gt;&lt;P&gt;    wa_component-type ?= cl_abap_typedescr=&amp;gt;describe_by_name( 'CHAR30' ).&lt;/P&gt;&lt;P&gt;    INSERT wa_component INTO TABLE it_component.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating new structure-ref -&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CLEAR gr_struc.&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_abap_structdescr=&amp;gt;create&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      p_components = it_component&lt;/P&gt;&lt;P&gt;    RECEIVING&lt;/P&gt;&lt;P&gt;      p_result     = gr_struc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating new table-ref -&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD cl_abap_tabledescr=&amp;gt;create&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      p_line_type = gr_struc&lt;/P&gt;&lt;P&gt;    RECEIVING&lt;/P&gt;&lt;P&gt;      p_result    = gr_tabtype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creating itab with table-ref -&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE DATA lr_itab TYPE HANDLE gr_tabtype.&lt;/P&gt;&lt;P&gt;  ASSIGN lr_itab-&amp;gt;* TO &amp;lt;gr_xlstab&amp;gt;. "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;READ FROM EXCEL&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    I_FIELD_SEPERATOR        =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      i_line_header            =  'X'&lt;/P&gt;&lt;P&gt;      i_tab_raw_data           =  lt_raw[]       " WORK TABLE&lt;/P&gt;&lt;P&gt;      i_filename               =  p_file&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      i_tab_converted_data     = &amp;lt;gr_xlstab&amp;gt;    "ACTUAL DATA&lt;/P&gt;&lt;P&gt;   EXCEPTIONS&lt;/P&gt;&lt;P&gt;      conversion_failed        = 1&lt;/P&gt;&lt;P&gt;      OTHERS                   = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;DISPLAY TABLE (with the missing columns header ?)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;  cl_salv_table=&amp;gt;factory(&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;        list_display = abap_true&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;        r_salv_table = lo_alv&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;        t_table      = &amp;lt;gr_xlstab&amp;gt; ).&lt;/P&gt;&lt;P&gt;  CATCH cx_salv_msg .&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="4" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 09:14:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/missing-columns-headers-when-trying-to-display-dynamic-tab-cl-salv-table/m-p/4940361#M1152309</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T09:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Missing columns headers -when trying to display dynamic tab - cl_salv_table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/missing-columns-headers-when-trying-to-display-dynamic-tab-cl-salv-table/m-p/4940362#M1152310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it's not so surprising that sap cannot find the relationship between a dynamic field and the ddic (usually we use it for internal tables statically defined and fields based on ddic data elements). Or maybe a language problem? Otherwise, use ALV tools that allow to enter column names (REUSE_ALV_GRID_DISPLAY function module, CL_GUI_ALV_GRID, etc.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2008 00:09:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/missing-columns-headers-when-trying-to-display-dynamic-tab-cl-salv-table/m-p/4940362#M1152310</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2008-12-11T00:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Missing columns headers -when trying to display dynamic tab - cl_salv_table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/missing-columns-headers-when-trying-to-display-dynamic-tab-cl-salv-table/m-p/4940363#M1152311</link>
      <description>&lt;P&gt;Here is the solution that I used to add the column names from a passed dynamic table before outputting to the ALV.&lt;/P&gt;&lt;P&gt;Form outputALV using it_results type standard table.&lt;/P&gt;&lt;P&gt;  DATA: gr_table TYPE REF TO CL_SALV_TABLE.&lt;/P&gt;&lt;P&gt;  DATA: gr_funct TYPE REF TO CL_SALV_FUNCTIONS.&lt;/P&gt;&lt;P&gt;  "Use the factory method to initialize the SALV object&lt;/P&gt;&lt;P&gt;  Try.&lt;/P&gt;&lt;P&gt;    cl_salv_table=&amp;gt;factory( IMPORTING r_salv_table = gr_table&lt;/P&gt;&lt;P&gt;                            CHANGING  t_table = it_results ).&lt;/P&gt;&lt;P&gt;  Catch cx_salv_msg.&lt;/P&gt;&lt;P&gt;  EndTry.&lt;/P&gt;&lt;P&gt;  "Loop through the table headings and set the column names&lt;/P&gt;&lt;P&gt;  DATA: columns TYPE REF TO cl_salv_columns_table,&lt;/P&gt;&lt;P&gt;        column  TYPE REF TO cl_salv_column,&lt;/P&gt;&lt;P&gt;        colNames TYPE SALV_T_COLUMN_REF,&lt;/P&gt;&lt;P&gt;        colName like line of colNames,&lt;/P&gt;&lt;P&gt;        txtMedium TYPE SCRTEXT_M.&lt;/P&gt;&lt;P&gt;  Try.&lt;/P&gt;&lt;P&gt;    columns = gr_table-&amp;gt;get_columns( ).&lt;/P&gt;&lt;P&gt;    colNames = columns-&amp;gt;get( ).&lt;/P&gt;&lt;P&gt;    Loop at colNames into colName.&lt;/P&gt;&lt;P&gt;      column    = columns-&amp;gt;get_column( to_upper( colName-columnname ) ).&lt;/P&gt;&lt;P&gt;      txtMedium = colName-columnname.&lt;/P&gt;&lt;P&gt;      column-&amp;gt;set_medium_text( txtMedium ).&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  Catch cx_salv_not_found.&lt;/P&gt;&lt;P&gt;  EndTry.&lt;/P&gt;&lt;P&gt;  gr_table-&amp;gt;display( ).&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2022 17:18:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/missing-columns-headers-when-trying-to-display-dynamic-tab-cl-salv-table/m-p/4940363#M1152311</guid>
      <dc:creator>DanReeves</dc:creator>
      <dc:date>2022-03-30T17:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Missing columns headers -when trying to display dynamic tab - cl_salv_table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/missing-columns-headers-when-trying-to-display-dynamic-tab-cl-salv-table/m-p/4940364#M1152312</link>
      <description>&lt;P&gt;this solution is working&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 11:13:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/missing-columns-headers-when-trying-to-display-dynamic-tab-cl-salv-table/m-p/4940364#M1152312</guid>
      <dc:creator>AJeB</dc:creator>
      <dc:date>2022-09-07T11:13:30Z</dc:date>
    </item>
  </channel>
</rss>

