2007 Aug 03 9:55 AM
Hi SAP guys,....
Any help about how to manage context menus with FM REUSE_ALV_GRID_DISPLAY ? I would like to add new entries into the context menu. I have review all entries into the forum but I haven't find any solution.
Thanks in advance,
Luis López
2007 Aug 04 9:04 AM
Hi,
Look at the below DEMO Porgram
<b>demo_dynpro_context_menu
demo_list_context_menu</b>
Regards
Sudheer
2007 Aug 03 10:26 AM
Hi,
To create a context menu follow this: See also report BCALV_GRID_06 in development class SLIS .
Defining a Context Menu
Use
The ALV Grid Control uses the context menu and assigns standard functions to it. Depending on the context, you can add self-defined functions to this menu and hide or disable preset functions.
Integration
The context menu is an instance of class CL_CTMENU . If event CONTEXT_MENU_REQUEST is triggered by the user, event parameter E_OBJECT contains a reference to the standard context menu.
Features
You can change this menu as follows:
To add an option to the menu, call method add_function :
CALL METHOD E_OBJECT->ADD_FUNCTION
EXPORTING FCODE = 'DELE'
TEXT = TEXT-003. "Delete
To disable existing functions (and gray them out), you pass all corresponding function codes of method disable_functions in a table:
DATA: LT_FCODES TYPE UI_FUNCTIONS,
CLEAR LT_FCODES.
APPEND CL_GUI_ALV_GRID=>MC_FC_COL_OPTIMIZE TO LT_FCODES.
APPEND CL_GUI_ALV_GRID=>MC_FC_HELP TO LT_FCODES.
CALL METHOD E_OBJECT->DISABLE_FUNCTIONS
EXPORTING FCODES = LT_FCODES.
Jogdand M B
Jogdand M B
2007 Aug 03 10:57 AM
Hi Jogdand:
Thanks for your answer but I don't know how to implement your solution. I checked BCAL_GRID_06 but it is using OO programing not the FM REUSE_.....
When I code the Call method E_OBJECT->ADD_FUNCTION, I get a sintax error (field e_object->add_function is unknow). I think that I can not triger the event CONTEXT_MENU_REQUEST. It is none of the events returned by the FM REUSE_ALV_EVENTS_GET.
A short example will be really very nice.
Thanks in advance,
Luis
2007 Aug 04 8:39 AM
Hi
Go through this link it will solve your problem
http://www.erpgenie.com/sap/abap/controls/alvgrid.htm
Reward for all helpfull answers
Regards
Pavan
2007 Aug 04 9:04 AM
Hi,
Look at the below DEMO Porgram
<b>demo_dynpro_context_menu
demo_list_context_menu</b>
Regards
Sudheer