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

Function using factory class

Former Member
0 Likes
3,369

Hi all

How can i display the various functions in an alv using factory class?

Points will be rewarded

Regards

Vivek

1 ACCEPTED SOLUTION
Read only

Former Member
2,009

Hii

are your referring to the factory class CL_SALV?

If so, here is some sample code:

use the CL_SALV_FUNCTIONS class. Create the object reference variable and receive the object using the GET_FUNCTIONS method of the GR_TABLE object.

Call the method SET_ALL to force the ALV grid to show all standard functions.


report zalvom_demo1. 
data: ispfli type table of spfli. 
data: gr_table type ref to cl_salv_table. 
data: gr_functions type ref to cl_salv_functions. 
start-of-selection. 
select * into table ispfli from spfli. 
cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = ispfli ). 
gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ). gr_table->display( ).

Regards

Preeti

Plz reward if useful

2 REPLIES 2
Read only

Former Member
2,010

Hii

are your referring to the factory class CL_SALV?

If so, here is some sample code:

use the CL_SALV_FUNCTIONS class. Create the object reference variable and receive the object using the GET_FUNCTIONS method of the GR_TABLE object.

Call the method SET_ALL to force the ALV grid to show all standard functions.


report zalvom_demo1. 
data: ispfli type table of spfli. 
data: gr_table type ref to cl_salv_table. 
data: gr_functions type ref to cl_salv_functions. 
start-of-selection. 
select * into table ispfli from spfli. 
cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = ispfli ). 
gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ). gr_table->display( ).

Regards

Preeti

Plz reward if useful

Read only

0 Likes
2,009

Thnk you for prompt reply.

I got the desired output