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

CL_GUI_ALV_GRID - Question

maulik
Contributor
0 Likes
1,090

When you execute BCALV_GRID_05, a blue icon "i" shows up on the toolbar.

It links to "end user doc."

Is there a way to re-program it?

Any help would be appreciated.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,053

Hello Maulik

My understanding of standard toolbar function codes is that they do NOT trigger event USER_COMMAND.

However, if you replace the standard function code with your own (use method go_grid->set_toolbar_interactive and implement handler for event TOOLBAR) then you can re-program this function.

Regards

Uwe

When you execute BCALV_GRID_05, a blue icon "i" shows up on the toolbar.

It links to "end user doc."

Is there a way to re-program it?

Any help would be appreciated.

5 REPLIES 5
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,054

Hello Maulik

My understanding of standard toolbar function codes is that they do NOT trigger event USER_COMMAND.

However, if you replace the standard function code with your own (use method go_grid->set_toolbar_interactive and implement handler for event TOOLBAR) then you can re-program this function.

Regards

Uwe

Read only

0 Likes
1,053

I have set the toolbar interactive, which specific event should I capture in method handle_user_command.

DATA: lt_col_info TYPE lvc_s_col.
    DATA: lt_row_info TYPE lvc_s_row.


    CLEAR:  lt_rows, wa_lt_rows, s_report_line.
    REFRESH lt_rows.

*   Get the Selected Row from the Grid.
    CALL METHOD g_alv_grid->get_selected_rows
      IMPORTING
        et_index_rows = lt_rows.

    CLEAR lt_col_info.
    CALL METHOD g_alv_grid->get_scroll_info_via_id
      IMPORTING
        es_col_info = lt_col_info.

*   Read the Row and then Query the Main Data Table.
    READ TABLE lt_rows INTO wa_lt_rows INDEX 1.
    READ TABLE i_report_tab INTO s_report_line INDEX wa_lt_rows-index.

    CASE e_ucomm.
*     F-43
      WHEN 'ZF43'.
        PERFORM process_f43.
        PERFORM check_and_redisplay.

*     F-44
      WHEN 'ZF44'.
        PERFORM process_f44.
        PERFORM check_and_redisplay.

*     Reject
      WHEN 'ZREJ'.
        IF s_report_line-status = 'A'.
          PERFORM reject_record.
          PERFORM check_and_redisplay.
        ELSE.
          MESSAGE s001(00) WITH 'Cannot Reject this Record'.
        ENDIF.

*     Others do nothing.
      WHEN OTHERS.
    ENDCASE.

Read only

0 Likes
1,053

For now, I have removed the button,

append cl_gui_alv_grid=>mc_fc_info           to lt_excl_func.

CALL METHOD g_alv_grid->set_table_for_first_display
      EXPORTING
        i_structure_name = 'ZALV'
        is_layout        = gs_layout
        is_variant       = gs_variant
        i_save           = 'A'
        i_default        = 'X'
        it_toolbar_excluding = lt_excl_func
      CHANGING
        it_outtab        = i_report_tab
        it_fieldcatalog  = gt_fieldcat[].

Read only

Former Member
0 Likes
1,053

Copy a GUI status into your program (if necessary...would need to in SALV probably), check your class/methods for adding your own functions....add your own function, and use the same documentation ICON (and remove the old function that the icon represents).... and, as noted, utilize event handler to do what you want.... and write a method to do what you want when that function button is pressed. The ICON itself is pretty meaningless, other than something a user can quickly identify...it's the function code assigned that controls what happens.... You can add a function and use any ICON you want...

Read only

0 Likes
1,053

My whole point was whether there is any standard functionality to override standard sap and re-use it seamlessly.

I guess this is not something that is possible without actually copy or replicating it with one's own extensive code.

Appreciate everyone who took the time to respond.