Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV columns dynamically

Former Member
0 Likes
498

Hi,

How to create Dynamically ALV columns??

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
431

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

4 REPLIES 4
Read only

Former Member
0 Likes
432

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

Read only

Former Member
0 Likes
431

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

Read only

Former Member
0 Likes
431

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.

Read only

Former Member