Google Search - Blog...........

Showing posts with label display all tables of mara table in alv grid display. Show all posts
Showing posts with label display all tables of mara table in alv grid display. Show all posts

ABAP - Display All The Columns Of A Table In ALV Grid Using Class CL_SALV_TABLE.



Suppose I have an internal table of the length of the database table. Means suppose I have an internal table declared like this .

Data : it_mara type table of mara. (I am currently working with ecc6) .

Here in the mara table I have 220 fields , I want to show all the columns in the output . For this I am using class CL_SALV_TABLE .

this will work best with the higher version . generally it is not possible to display all fields , not all the fields but atleast nearly 80 fields in the alv display , but here it is possible to display all the fields .


REPORT ZALV_TEST.

data: it_mara type table of mara,

g_table type ref to cl_salv_table,

g_functions type ref to cl_salv_functions,

g_display type ref to cl_salv_display_settings.


start-of-selection.

Select * into table it_mara from mara up to 10 rows.


cl_salv_table=>factory( importing r_salv_table = g_table changing t_table = it_mara ).


g_functions = g_table->get_functions( ).

g_functions->set_all( abap_true ).


g_table->display( ).


After execution of the program I got 200 plus fields in the output .


ALSO READ:

- ALV With Page Numbers & Subtotals.

- Footer Functionality In ALV Reports.

- Calling One ALV From Other ALV Report Program.

- Capture Single & Multiple Row Selction In ALV Report Program.

..... Back To Index On ALV List/ Grid Display.

..... Back To MAIN INDEX.