‎2007 Jan 30 11:00 AM
‎2007 Jan 30 11:01 AM
refer below links -
/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically
/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table
/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
‎2007 Jan 30 11:01 AM
refer below links -
/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically
/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table
/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
‎2007 Jan 30 11:10 AM
Hi,
Check this demo program:
BCALV_FIELDCAT_TEST
(This report allows to modify the fieldcatalog of a corresponding
output table and to view the effects of your changes directly.)
Regards,
Beejal
**Reward if helpful
‎2007 Jan 30 11:11 AM
Hi Anju,
This will create columns dynamically,check it out:
DATA: dt_outtab TYPE REF TO data.
FIELD-SYMBOLS: <outtab> 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=>create_dynamic_table
EXPORTING it_fieldcatalog = t_fcat
IMPORTING ep_table = dt_outtab.
ASSIGN dt_outtab->* TO <outtab>.
*... create your ALV
CALL METHOD alv->set_table_for_first_display
CHANGING it_outtab = <outtab>
it_fieldcatalog = t_fcat.
mark all helpful answers.
‎2007 Jan 30 11:15 AM