Share this page

# Example: sapgui_grid_press_toolbar_context_button

This example uses sapgui_grid_press_toolbar_context_button to open a context button paired with a "Sum" button. The user chooses the "Sum" option from the list.

    / Save the Grid ID in variable "GridID"

    lr_save_string(
    	"/app/con[0]/ses[0]/wnd[0]/usr/cntlBCALV_GRID_DEMO_0100_CONT1/shellcont/shell",
           "GridID");

    sapgui_grid_select_columns("(CtrlGrid)",
            "{GridID}",
            "SEATSOCC",LAST );

    // Open context menu

    sapgui_grid_press_toolbar_context_button("'Total'",
            "{GridID}",
            "&MB_SUM",
            BEGIN_OPTIONAL,
                "AdditionalInfo=sapgui1054",
            END_OPTIONAL);

    // Choose Sum from the list

    sapgui_call_method("{GridID}",
            "selectToolbarMenuItem",
            "&SUMC",
            LAST );

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: