2006 Mar 08 8:59 AM
Hi again...
I want to update my ALV(OO)-Toolbar during runtime
Is there a method for this like SET_FRONTEND_FIELDCAT - for the fieldcatalog update?
I only found a INIT_TOOLBAR Method, this method is Private...
thanks in advance,
Sebastian
Hi again...
I want to update my ALV(OO)-Toolbar during runtime
Is there a method for this like SET_FRONTEND_FIELDCAT - for the fieldcatalog update?
I only found a INIT_TOOLBAR Method, this method is Private...
thanks in advance,
Sebastian
2006 Mar 08 9:12 AM
Hi,
Could you pls. tell me what do you want to do at runtime ?.
Regs,
Venkat Ramanan
2006 Mar 08 9:16 AM
I want to exclude buttons from the ALV toolbar (delete row, add row,...)
I know how to exclude it on creating the ALV object but not during lifetime of the object...
2006 Mar 08 9:18 AM
Hi,
may be you can do one thing, you can exclude the tool bar when ever you want to do it, and then refresh the alv grid using the method refresh.
CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY
EXCEPTIONS
FINISHED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.regards
vijay
2006 Mar 08 9:26 AM
vijay, tried refresh but this does only update the changed Fieldcat correctly...
2006 Mar 08 9:53 AM
Hi Sebastian,
when do you want to change the Toolbar. if you want to do tool bar refresh then you need to recall the grid , by clearing and free the container. and fill your exclude structure again and call the method.
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
<b>IT_TOOLBAR_EXCLUDING = LT_EXCLUDE</b>
IS_VARIANT = LS_VARI
IS_LAYOUT = GS_LAYOUT
I_SAVE = 'A'
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = IT_FINAL[].regards
vijay
2006 Mar 08 10:09 AM
thanks, vijay...
I feared that this would be the only chance...
seems as If I have to do it this way now, but please keep looking for a better way
2006 Mar 08 10:16 AM
hi Sebastian ,
Instead of excluding the delete/add row button , u can make them disable.
Then u don't need the set table for first display method
2006 Mar 08 10:31 AM
do you have toolbar event handler. i hope you are having it. if so i was thinking why can't we try with that...
METHOD HANDLE_TOOLBAR_SET.
* create own Menubuttons and ToolbarButtons
* append a separator to normal toolbar
CLEAR GS_TOOLBAR.
MOVE 3 TO GS_TOOLBAR-BUTN_TYPE.
APPEND GS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
* append detail button
CLEAR GS_TOOLBAR.
MOVE FCODE_DISP TO GS_TOOLBAR-FUNCTION.
MOVE ICON_DETAIL TO GS_TOOLBAR-ICON.
MOVE TEXT-005 TO GS_TOOLBAR-QUICKINFO.
MOVE ' ' TO GS_TOOLBAR-DISABLED.
APPEND GS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
* append a separator to normal toolbar
CLEAR GS_TOOLBAR.
MOVE 3 TO GS_TOOLBAR-BUTN_TYPE.
APPEND GS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
* append new button
CLEAR GS_TOOLBAR.
MOVE FCODE_PLANE TO GS_TOOLBAR-FUNCTION.
MOVE ICON_WS_PLANE TO GS_TOOLBAR-ICON.
MOVE TEXT-002 TO GS_TOOLBAR-QUICKINFO.
MOVE ' ' TO GS_TOOLBAR-DISABLED.
APPEND GS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
ENDMETHOD.regards
vijay
2006 Mar 09 10:37 AM
thanks vijay think this could work, there is one problem now: the event is triggered somewhere in refresh_table_display... unfortunately this method also seems to overwrite my changes for the buttons... I tried to add a separator but the changes just don't work...
2006 Mar 09 10:45 AM
Is it so.
can you show how you tried...
and try this way also create the tool bar buttons , but hide them and in runtime using the event handler you enable them..
Regards
vijay
Message was edited by: Vijay Babu Dudla
2006 Mar 09 11:04 AM
coding is on another PC, but will give a short process flow:
change/display button -> change fieldcat and refresh table -> event toolbar is called -> adding a separator to provided reference of CL_ALV_EVENT_TOOLBAR_SET (debugger shows new value (the separator) in there)
just debugged the wohle thing, the toolbar event get raised 3 times, after the refresh of the table it is called the last time and the separator stays then in the toolbar table, but the ALV does not getting updated with that table, so is there an additional method to update the toolbar then?
2006 Mar 17 7:09 AM
vijay, unfortunately I can create new buttons with this, but I could not delete buttons from ALV, still have to exclude them on first display
2006 Mar 08 10:22 AM
Hi,
Try this,
FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions .
DATA ls_exclude TYPE ui_func.
ls_exclude = cl_gui_alv_grid=>mc_fc_maximum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_minimum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_subtot .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_sum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_average .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_sum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_subtot .
ENDFORM .
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = pt_exclude
IS_VARIANT = LS_VARI
IS_LAYOUT = GS_LAYOUT
I_SAVE = 'A'
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = IT_FINAL[].
Regards,
Venkat Ramanan
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |