‎2008 Aug 08 6:00 AM
How to use application tool bar in tree contorl .
Please give a example .
‎2008 Aug 08 6:07 AM
hello
try this
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Class LCL_TOOLBAR_EVENT_RECEIVER
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
CLASS lcl_toolbar_event_receiver DEFINITION.
PUBLIC SECTION .
CLASS-METHODS: catch_function_selected FOR EVENT function_selected OF cl_gui_toolbar
IMPORTING fcode.
ENDCLASS. "LCL_TOOLBAR_EVENT_RECEIVER
*&---------------------------------------------------------------------*
*& Class (Implementation) LCL_TOOLBAR_EVENT_RECEIVER
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
CLASS lcl_toolbar_event_receiver IMPLEMENTATION.
METHOD catch_function_selected.
w_fcode = fcode.
CASE w_fcode.
WHEN 'EXPAND'.
PERFORM expand_nodes.
WHEN 'COLLAPSE'.
PERFORM collapse_nodes.
WHEN 'EXECUTE'.
PERFORM execute_node_item.
WHEN 'REFRESH'.
PERFORM collapse_nodes.
WHEN 'SCROLL'.
PERFORM scroll_tree.
ENDCASE.
ENDMETHOD. "CATCH_FUNCTION_SELECTED
ENDCLASS. "LCL_TOOLBAR_EVENT_RECEIVER
**also set handler"
*Set handler for events
SET HANDLER lcl_toolbar_event_receiver=>catch_function_selected FOR toolbar .
Hope this will help you
OR check these sap standard program
ALV Tree Control: Build Up the Hierarchy Tree BCALV_TREE_01
ALV Tree Control: Event Handling BCALV_TREE_02
ALV Tree Control: Use an Own Context Menu BCALV_TREE_03
ALV Tree Control: Add a Button to the Toolbar BCALV_TREE_04
ALV Tree Control: Add a Menu to the Toolbar BCALV_TREE_05
ALV tree control: Icon column and icon for nodes/items BCALV_TREE_06
Thanks
Anirudh Saini
‎2008 Aug 08 6:07 AM
hello
try this
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Class LCL_TOOLBAR_EVENT_RECEIVER
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
CLASS lcl_toolbar_event_receiver DEFINITION.
PUBLIC SECTION .
CLASS-METHODS: catch_function_selected FOR EVENT function_selected OF cl_gui_toolbar
IMPORTING fcode.
ENDCLASS. "LCL_TOOLBAR_EVENT_RECEIVER
*&---------------------------------------------------------------------*
*& Class (Implementation) LCL_TOOLBAR_EVENT_RECEIVER
*&---------------------------------------------------------------------*
* Text
*----------------------------------------------------------------------*
CLASS lcl_toolbar_event_receiver IMPLEMENTATION.
METHOD catch_function_selected.
w_fcode = fcode.
CASE w_fcode.
WHEN 'EXPAND'.
PERFORM expand_nodes.
WHEN 'COLLAPSE'.
PERFORM collapse_nodes.
WHEN 'EXECUTE'.
PERFORM execute_node_item.
WHEN 'REFRESH'.
PERFORM collapse_nodes.
WHEN 'SCROLL'.
PERFORM scroll_tree.
ENDCASE.
ENDMETHOD. "CATCH_FUNCTION_SELECTED
ENDCLASS. "LCL_TOOLBAR_EVENT_RECEIVER
**also set handler"
*Set handler for events
SET HANDLER lcl_toolbar_event_receiver=>catch_function_selected FOR toolbar .
Hope this will help you
OR check these sap standard program
ALV Tree Control: Build Up the Hierarchy Tree BCALV_TREE_01
ALV Tree Control: Event Handling BCALV_TREE_02
ALV Tree Control: Use an Own Context Menu BCALV_TREE_03
ALV Tree Control: Add a Button to the Toolbar BCALV_TREE_04
ALV Tree Control: Add a Menu to the Toolbar BCALV_TREE_05
ALV tree control: Icon column and icon for nodes/items BCALV_TREE_06
Thanks
Anirudh Saini
‎2008 Aug 08 6:09 AM
HI,
check below demo programs..
BCALV_GRID_05
BCALV_GRID_06
BCALV_GRID_07
BCALV_GRID_08
Hope it will help...
‎2008 Aug 08 6:10 AM
please refer to the demo program provided by SAP:
BCALV_TREE_DEMO