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

OOPS ALV - Exclude Buttons

Former Member
0 Likes
4,890

Hi Gurus,

I have a requirement to exclude one BUTTON in OOPS ALV.

The Fcode of the Button is - &ASG

Code is written as below . Please let me know how Can i exclude .

if not gi_outtab[] is not initial.

" Create instance of CL_SALV_TABLE Object

try.

cl_salv_table=>factory(

importing

r_salv_table = gr_table

changing

t_table = gi_outtab ).

catch cx_salv_msg. "#EC NO_HANDLER

endtry.

" Set functions (for toolbar and menus)

lr_functions = gr_table->get_functions( ).

lr_functions->set_all( abap_true ).

" Set the Menu bar

gr_table->set_screen_status(

pfstatus = 'ZALV_SETTLE_NOLOT'

report = sy-repid

set_functions = gr_table->c_functions_all ).

" Set layout (Display variant)

lr_layout = gr_table->get_layout( ).

v_key-report = sy-repid.

lr_layout->set_key( v_key ).

lr_layout->set_save_restriction( cl_salv_layout=>restrict_none ).

lr_layout->set_initial_layout( p_layout ).

lr_layout->set_default( cl_salv_display_settings=>true ).

" Set Table display settings

lr_display = gr_table->get_display_settings( ).

lr_display->set_striped_pattern( cl_salv_display_settings=>true ).

lr_display->set_list_header( 'Settlement Batch Generator' ).

" Turn off list info (info such as filter, sort, and number of data records appears on printout)

lr_print = gr_table->get_print( ).

lr_print->set_listinfo_on( abap_false ).

" Set Event handler

create object lr_eventhndlr.

lr_events = gr_table->get_event( ).

  • set handler lr_eventhndlr->on_double_click for lr_events.

set handler lr_eventhndlr->on_link_click for lr_events.

set handler lr_eventhndlr->on_user_command for lr_events.

" Write information to the list header area (online)

perform top_of_page.

" Optimize column width

lr_columns = gr_table->get_columns( ).

  • lr_columns->set_optimize( abap_true ).

perform set_columns using lr_columns.

" Set up selections.

lr_selections = gr_table->get_selections( ).

lr_selections->set_selection_mode( if_salv_c_selection_mode=>row_column ). "Multiple

  • perform set_columns using lr_columns.

gr_table->display( ).

Endif.

6 REPLIES 6
Read only

former_member203501
Active Contributor
0 Likes
1,931

Hi ,

Redefine the standard method to write the custom coding .

Regards,

Venkat Appikonda.

Read only

0 Likes
1,931

Yes, You need to copy the GUI STATUS that you would like to omit the button from and create your own 'Z' version and take that button out.

Read only

Former Member
0 Likes
1,931

hello,

In method SET_TABLE_FOR_FIRST_DISPLAY there is a parameter IT_EXCLUDE_BUTTON.

You have to fill a table with function doe of excludable button and pass on to that...

Please have a look in code of BC_ALV_TEST_FUNCTIONS.

Thanks.

Read only

p604431
Active Participant
0 Likes
1,931

Hi,

try like this

    " Set functions (for toolbar and menus)
    lr_functions = gr_table->get_functions( ).
    lr_functions->set_all( abap_true ).

    " Set the Menu bar
    gr_table->set_screen_status( pfstatus = 'ZALV_SETTLE_NOLOT'
    report = sy-repid set_functions = gr_table->c_functions_all ).

    TRY.
        CALL METHOD lr_functions->set_function
          EXPORTING
            name    = '&ASG'
            boolean = space.
      CATCH cx_salv_not_found .
      CATCH cx_salv_wrong_call .
    ENDTRY.

Read only

former_member209920
Active Participant
0 Likes
1,931

In method SET_TABLE_FIRST_DISPLAY, pass GT_EXCULDE to ITAB_EXCULDE_TABLE.

Add the desired button in GT_EXCLUDE.

Read only

Former Member
0 Likes
1,931

Answered