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 Reports

Former Member
0 Likes
475

Hi,

In ALV Reports dynamically how can fields can declare?suppose dynamically i want to 90 fields?

Hi,

In ALV Reports dynamically how can fields can declare?suppose dynamically i want to 90 fields?

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
460

Look at this sdn code sample [ABAP Code Sample for ALV Grid from Dynamically-Created Internal Table|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1d22e990-0201-0010-588d-c4b4b431c52b]

There are also many threads on this in sdn : [ALV dynamic table|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=ALVdynamic+table&cat=sdn_all]

Regards

Read only

sreelatha_gullapalli
Active Participant
0 Likes
460

hi

This piece of code might be useful.

The following sections will help you to understand the steps required to define a Dynamic ALV.

Following symbol signifies:

Þ Important

Main Steps Required

The following are the main steps that are to be performed for defining a dynamic Alv

1. Defining a field catalog

2. Defining the dynamic table

3. Filling data into the table

4. Displaying ALV list

Defining a field catalog

The purpose of defining a field catalog first in case of Dynamic ALV is somewhat different than in case of normal ALV. In case of Dynamic ALV the field catalog is used to define the final internal table that will hold the data, and would be used to display the final output.

Þ It is very important to remember that the field catalog table be refreshed first, else it might give an error.

For example:

DATA: T_FIELDCAT TYPE LVC_T_FCAT,

L_FIELDCAT TYPE LVC_S_FCAT.

Refresh T_FIELDCAT.

CLEAR L_FIELDCAT.

L_FIELDCAT-FIELDNAME = 'LIFNR'.

L_FIELDCAT-INTTYPE = ''.

L_FIELDCAT-OUTPUTLEN = 10.

L_FIELDCAT-COLTEXT = TEXT-002.

APPEND L_FIELDCAT TO T_FIELDCAT.

Defining the dynamic table.

This table will hold the final data that needs to be displayed. To declare the table the following things need to be done.

Declare a field symbol

Displaying Alv List

This is done in the same way as we do for normal Alv. Call function “REUSE_ALV_GRID_DISPLAY” and pass the field catalog table in the export parameters and the dynamic table in Tables.

And also chexk the following link

you can do that.

/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically

Reward Points if it is helpful.

regards,

sreelatha gullapalli