<?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: Adding columns dynamically into an ALV report.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203584#M131539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; to add colums dynamically ..in your ALV you'll have to modify the fieldcat and then again call the LIST display FM..&lt;/P&gt;&lt;P&gt; Initially keep the field catalogue with the fielsd that you want to display..&lt;/P&gt;&lt;P&gt; then modify the fieldcatalogue on a usercommand event..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;satesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Mar 2006 12:23:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-23T12:23:09Z</dc:date>
    <item>
      <title>Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203582#M131537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt; Could somebody please tell me how to add columns at run time into an Alv report...&lt;/P&gt;&lt;P&gt; Thanks in advance..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 11:58:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203582#M131537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T11:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203583#M131538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi arup,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the way...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create your field catalog either manually or automatically using the function module, LVC_FIELDCATALOG_MERGE. Add more rows to the field catalog table (T_FIELDCAT) at run time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use the field catalog to create a table dynamically using the method below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: T_OUTPUT TYPE REF TO DATA &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;T_OUTPUT&amp;gt; TYPE TABLE &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;&lt;/P&gt;&lt;P&gt;Exporting &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT_FIELDCATALOG = T_FIELDCAT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Importing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EP_TABLE = T_OUTPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN T_OUTPUT-&amp;gt;* TO &amp;lt;T_OUTPUT&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the field symbol &amp;lt;T_OUTPUT&amp;gt; is pointing to an output table of the structure that contains the fields which were determined at runtime. Now fill this table with the data and pass &amp;lt;T_OUTPUT&amp;gt; to the method SET_TABLE_FOR_FIRST_DISPLAY and the ALV grid should show the data properly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if you want to access or modify or fill in the data for specific columns, you have to use the ASSIGN COMPONENT statement for the specific field name and do it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it is usefull....reward points,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;padma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 12:13:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203583#M131538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T12:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203584#M131539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; to add colums dynamically ..in your ALV you'll have to modify the fieldcat and then again call the LIST display FM..&lt;/P&gt;&lt;P&gt; Initially keep the field catalogue with the fielsd that you want to display..&lt;/P&gt;&lt;P&gt; then modify the fieldcatalogue on a usercommand event..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;satesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 12:23:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203584#M131539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T12:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203585#M131540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi arup,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. for adding columns dynamically in alv,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   the first thing is that the columns&lt;/P&gt;&lt;P&gt;   should come dynamically in &lt;/P&gt;&lt;P&gt;   the INTERNAL TABLE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. if that is possible, then rest can be easily done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. It depends upon what kind of internal table it is.&lt;/P&gt;&lt;P&gt;   Is is static ( defined already)&lt;/P&gt;&lt;P&gt;   or u are using the concept of dynamic internal table !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. What u are asking is somewhat difficult !!!&lt;/P&gt;&lt;P&gt;5. The best thing is to keep all posible&lt;/P&gt;&lt;P&gt;   list of fields in the internal table,&lt;/P&gt;&lt;P&gt;   and hide them (NO_OUT) previously,&lt;/P&gt;&lt;P&gt;  and then as and when required,&lt;/P&gt;&lt;P&gt;   show them as required !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 12:29:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203585#M131540</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T12:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203586#M131541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Check this Code , here i am adding the columns dynamically.&lt;/P&gt;&lt;P&gt;this code i have a button , first it will display vbeln, posnr. when i click that button my posnr will disappear.&lt;/P&gt;&lt;P&gt;i did it with the help of pf-status,user_command.&lt;/P&gt;&lt;P&gt;check it.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report  ztest_alv123                            .

type-pools:slis.
data :   it_fieldcat type slis_t_fieldcat_alv,
          it_fieldcat1 type slis_t_fieldcat_alv.


data: begin of itab occurs 0,
       vbeln like vbak-vbeln,
       posnr like vbap-posnr,
       end of itab.

data: begin of itab1 occurs 0,
       vbeln like likp-vbeln,
       posnr like lips-posnr,
       vgbel like lips-vgbel,
       vgpos like lips-vgpos,
       end of itab1.

data: it_lips like itab1 occurs 0 with header line.
select  vbeln
        posnr
        up to 1000 rows
        from vbap
        into table itab.

if sy-subrc = 0.
  sort itab by vbeln .
  select vbeln
   posnr
   vgbel
   vgpos
   into table itab1
   from lips
   for all entries in itab
   where vgbel = itab-vbeln
     and    vgpos = itab-posnr.
endif.
data: x_fieldcat type slis_fieldcat_alv.
x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos  = 1.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.
x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos  = 1.
append x_fieldcat to it_fieldcat.
clear x_fieldcat.

perform alv_grid_display.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  POPUP
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;P_EXTAB    text
*----------------------------------------------------------------------*
form popup using p_extab type slis_t_extab.

*- Pf status
  set pf-status 'POPUP'.

endform.                 " POPUP

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  HANDLE_USER_COMMAND
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;R_UCOMM      text
*      --&amp;gt;RS_SELFIELD  text
*----------------------------------------------------------------------*
form handle_user_command using r_ucomm     like sy-ucomm
                               rs_selfield type slis_selfield.

  case r_ucomm.
    when 'BACK' or 'CANC' or 'EXIT'.

    leave to screen 0.

    when '&amp;amp;IC1'.
      set parameter id 'AUN' field rs_selfield-value.
      call transaction 'VA03' and skip first screen.
    when 'BUTTON'.
      loop at it_fieldcat into x_fieldcat.
        if x_fieldcat-fieldname = 'POSNR'.
          x_fieldcat-no_out = 'X'.
          modify it_fieldcat from x_fieldcat transporting no_out.
        endif.
      endloop.
      rs_selfield-exit = 'X'.
      perform alv_grid_display.
  endcase.

endform.                    "HANDLE_USER_COMMAND
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  alv_grid_display
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form alv_grid_display .
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program       = sy-repid
      i_callback_pf_status_set = 'POPUP'
      i_callback_user_command  = 'HANDLE_USER_COMMAND'
      it_fieldcat              = it_fieldcat
    tables
      t_outtab                 = itab
    exceptions
      program_error            = 1
      others                   = 2.

  if sy-subrc  = 0.

  endif.
endform.                    " alv_grid_display&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 12:32:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203586#M131541</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-23T12:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203587#M131542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arup,&lt;/P&gt;&lt;P&gt;If you want to make it fully dynamically, you can create the internal table dynamically as well. First you create your fieldcatalog You can do it dynamically - fully manual, or semi-dynamically, meaning that you can take an existing structure and add then fields manually. Then you create your internal table and pass it to the ALV along with the fieldcat. Like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: dt_outtab TYPE REF TO data.
FIELD-SYMBOLS: &amp;lt;outtab&amp;gt; TYPE STANDARD TABLE.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
                  EXPORTING i_structure_name       = 'ZSOME_EXISTING_STRUCTURE'
                            i_client_never_display = 'X'
                  CHANGING  ct_fieldcat = t_fcat.
s_fcat-fieldname = 'NEW_FIELD'.
* ...supply all other fieldcat attributes
APPEND s_fcat TO t_fcat.
CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
                     EXPORTING it_fieldcatalog = t_fcat
                     IMPORTING ep_table        = dt_outtab.
ASSIGN dt_outtab-&amp;gt;* TO &amp;lt;outtab&amp;gt;.
*... create your ALV
CALL METHOD alv-&amp;gt;set_table_for_first_display
        CHANGING  it_outtab       = &amp;lt;outtab&amp;gt;
                  it_fieldcatalog = t_fcat.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Igor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2006 13:17:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203587#M131542</guid>
      <dc:creator>former_member185943</dc:creator>
      <dc:date>2006-03-23T13:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203588#M131543</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;By using the method CREATE_DYNAMIC_TABLE, I will get the dynamic internal table &amp;lt;OUTTAB&amp;gt;, but with no value. How do I assign value back to this &amp;lt;OUTTAB&amp;gt;. More specifically, how do I assign specific value to specific columns into this dynamic internal table &amp;lt;OUTTAB&amp;gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2007 06:24:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203588#M131543</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-06T06:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203589#M131544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Assumption: Structure of the dynamic table should be known before hand.(At least in this program, I am not sure how to do it otherwise. Probably the FIELD-SYMBOL stud programmers can help us out).

report  ytest.
data: lt_fieldcatalog type lvc_t_fcat.
data: ls_fieldcatalog type lvc_s_fcat.
field-symbols: &amp;lt;fs_data&amp;gt; type ref to data.
field-symbols: &amp;lt;fs_1&amp;gt;.
field-symbols: &amp;lt;fs_2&amp;gt; type any table.
field-symbols: &amp;lt;fs_3&amp;gt; type ypoll.


data: lt_data type ref to data.

assign lt_data to &amp;lt;fs_data&amp;gt;.

ls_fieldcatalog-fieldname = 'MANDT'.
ls_fieldcatalog-tabname   = 'LT_TAB'.
append ls_fieldcatalog to lt_fieldcatalog.

ls_fieldcatalog-fieldname = 'POLLID'.
ls_fieldcatalog-tabname   = 'LT_TAB'.
append ls_fieldcatalog to lt_fieldcatalog.

ls_fieldcatalog-fieldname = 'TEAM'.
ls_fieldcatalog-tabname   = 'LT_TAB'.
append ls_fieldcatalog to lt_fieldcatalog.

ls_fieldcatalog-fieldname = 'INITIATOR'.
ls_fieldcatalog-tabname   = 'LT_TAB'.
append ls_fieldcatalog to lt_fieldcatalog.

ls_fieldcatalog-fieldname = 'DESCRIPTION'.
ls_fieldcatalog-tabname   = 'LT_TAB'.
append ls_fieldcatalog to lt_fieldcatalog.

ls_fieldcatalog-fieldname = 'APPROVED'.
ls_fieldcatalog-tabname   = 'LT_TAB'.
append ls_fieldcatalog to lt_fieldcatalog.

ls_fieldcatalog-fieldname = 'INITIATED_DATE'.
ls_fieldcatalog-tabname   = 'LT_TAB'.
append ls_fieldcatalog to lt_fieldcatalog.

ls_fieldcatalog-fieldname = 'END_DATE'.
ls_fieldcatalog-tabname   = 'LT_TAB'.
append ls_fieldcatalog to lt_fieldcatalog.

ls_fieldcatalog-fieldname = 'WINNER'.
ls_fieldcatalog-tabname   = 'LT_TAB'.
append ls_fieldcatalog to lt_fieldcatalog.


call method cl_alv_table_create=&amp;gt;create_dynamic_table
  exporting
    it_fieldcatalog           = lt_fieldcatalog
  importing
    ep_table                  = &amp;lt;fs_data&amp;gt;
  exceptions
    generate_subpool_dir_full = 1
    others                    = 2
        .
if sy-subrc &amp;lt;&amp;gt; 0.
endif.

assign &amp;lt;fs_data&amp;gt;-&amp;gt;* to &amp;lt;fs_1&amp;gt;.
assign &amp;lt;fs_1&amp;gt; to &amp;lt;fs_2&amp;gt;.

loop at &amp;lt;fs_2&amp;gt; assigning &amp;lt;fs_3&amp;gt;.
  write: &amp;lt;fs_3&amp;gt;-pollid.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2007 06:25:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203589#M131544</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-06T06:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203590#M131545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just refer to build a dynamic internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/ab030.htm" target="test_blank"&gt;http://www.sap-img.com/ab030.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rusidar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2007 06:43:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203590#M131545</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-06T06:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203591#M131546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can dynamically change your fcat then call&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 it_fieldcatalog = fcat&lt;/P&gt;&lt;P&gt;IMPORTING ep_table        = datatab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to create your dynamic itab according to fcat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2007 06:48:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203591#M131546</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-06T06:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203592#M131547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Igor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I have doubt with create_dynamic_table can i use REUSE_ALV_GRID_DISPLAY FM to display the data ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;kevin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 10:52:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203592#M131547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-23T10:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Adding columns dynamically into an ALV report..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203593#M131548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls check this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONSTANTS : lc_structure TYPE tabname VALUE  'ZSXX.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;lfs_s_fcat&amp;gt; TYPE lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_structure_name       = lc_structure&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      ct_fieldcat            = t_fieldcat&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      inconsistent_interface = 1&lt;/P&gt;&lt;P&gt;      program_error          = 2&lt;/P&gt;&lt;P&gt;      OTHERS                 = 3.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  LOOP AT t_fieldcat ASSIGNING &amp;lt;lfs_s_fcat&amp;gt;.&lt;/P&gt;&lt;P&gt;    CASE &amp;lt;lfs_s_fcat&amp;gt;-fieldname.&lt;/P&gt;&lt;P&gt;      WHEN 'PERNR'.&lt;/P&gt;&lt;P&gt;        &amp;lt;lfs_s_fcat&amp;gt;-coltext = text-055.&lt;/P&gt;&lt;P&gt;      WHEN 'EMP_USERID'.&lt;/P&gt;&lt;P&gt;        &amp;lt;lfs_s_fcat&amp;gt;-coltext = text-002.&lt;/P&gt;&lt;P&gt;      WHEN OTHERS.&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this initially, i'm getting the fieldcatelog from my STRUCTURE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that, i need to add some more fields into it. so i'm looping it and appending my values into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if there is anymore to done, pls reply &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be Happy!! &lt;/P&gt;&lt;P&gt;Enjoy!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 11:00:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-columns-dynamically-into-an-alv-report/m-p/1203593#M131548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-23T11:00:47Z</dc:date>
    </item>
  </channel>
</rss>

