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

adding select/de-select column to salv report

Former Member
0 Likes
2,394

hi,

is there a way to add select/deselct column to report?

i am using SALV to create it .

thanks

1 ACCEPTED SOLUTION
Read only

rathishr_nair
Explorer
0 Likes
1,375

Hi,

DATA: o_table TYPE REF TO cl_salv_table,

o_selections TYPE REF TO cl_salv_selections.

TRY.

CALL METHOD cl_salv_table=>factory

IMPORTING

r_salv_table = o_table

CHANGING

t_table = t_vbak

.

CATCH cx_salv_msg .

ENDTRY.

o_selections = o_table->get_selections( ).

CALL METHOD o_selections->set_selection_mode

EXPORTING

value = 3.

This will create the Select/Deselect Column to the Report. The Method SET_SELECTION_MODE of CLASS CL_SALV_SELECTIONS will help you in achieving this.

Thanks and Regards,

Rathish R Nair

hi,

is there a way to add select/deselct column to report?

i am using SALV to create it .

thanks

4 REPLIES 4
Read only

Former Member
0 Likes
1,375

Give your users the layout capability, by using the SALV Standard GUI Status copied from one of the SALV* demo programs in SAP. In SE80, show the GUI status, right click on it and copy into your program name...adjust as needed....Here's what I use in SALV:

data: gr_layout  TYPE REF TO cl_salv_layout,
                   gr_alv        TYPE REF TO cl_salv_table,
                   gs_key     TYPE salv_s_layout_key,  
. . .
 gs_key-report = sy-repid.
. . .
* User can save layout.
  gr_layout  = gr_alv->get_layout( ).
  gr_layout->set_key( gs_key ).  "Pass Program Name
  gr_layout->set_save_restriction( cl_salv_layout=>restrict_none ).  "user can do all layout functions including change displayed * columns and sorts, etc.
  gr_layout->set_default( cl_salv_layout=>true ). "user can set his default layout.

Or...in your field catalog definition:

( declared gr_column type ref to cl_salv_column_table)

gr_column->set_visible( abap_false ).

Edited by: BreakPoint on Mar 31, 2011 7:37 PM

Read only

Former Member
0 Likes
1,375

use SET_SELECTED_ROWS method from CL_GUI_ALV_GRID

Read only

0 Likes
1,375

?? to choose whether or not to display a column in SALV? You have heard of SALV , right?

Read only

rathishr_nair
Explorer
0 Likes
1,376

Hi,

DATA: o_table TYPE REF TO cl_salv_table,

o_selections TYPE REF TO cl_salv_selections.

TRY.

CALL METHOD cl_salv_table=>factory

IMPORTING

r_salv_table = o_table

CHANGING

t_table = t_vbak

.

CATCH cx_salv_msg .

ENDTRY.

o_selections = o_table->get_selections( ).

CALL METHOD o_selections->set_selection_mode

EXPORTING

value = 3.

This will create the Select/Deselect Column to the Report. The Method SET_SELECTION_MODE of CLASS CL_SALV_SELECTIONS will help you in achieving this.

Thanks and Regards,

Rathish R Nair