on 04-19-2009 6:31 PM
Hi All,
How do i display Internet explorer browser 'right click' context menu in a web dynpro abap application instead of the default context menu with 'quick help' etc items.
Thanks and Regards
Sunil Kumar.
Hey.
You can create your own context menus for user interfaces elements in Web Dynpro for ABAP。
First,you need to add code in order to create your own context menus in WDDOONCONTEXTMENU hook method .
Second,you need to create acction for your own context menus item. At one time,you need to add code in action method. When context menus item will be click,this method will be called and respond
your handle.
Below are test code of sample. Hope that these are helpful.
-
method WDDOONCONTEXTMENU .
DATA: LR_CONTEXT_ELEMENT TYPE REF TO IF_WD_CONTEXT_ELEMENT,
LR_MENU TYPE REF TO CL_WD_MENU,
LR_MENU_ITEM TYPE REF TO CL_WD_MENU_ACTION_ITEM.
CASE CONTEXT_MENU_EVENT->ORIGINATOR->ID.
WHEN 'GROUP01'.
CALL METHOD CL_WD_MENU=>NEW_MENU
EXPORTING
ID = 'ZHANGWH'
TITLE = 'Zhang wei hong test context menu'
RECEIVING
CONTROL = MENU.
CALL METHOD CL_WD_MENU_ACTION_ITEM=>NEW_MENU_ACTION_ITEM
EXPORTING
ID = 'CHECK'
ON_ACTION = 'CHECK_DATA'
TEXT = 'Check input data'
RECEIVING
CONTROL = LR_MENU_ITEM.
CALL METHOD MENU->ADD_ITEM
EXPORTING
THE_ITEM = LR_MENU_ITEM.
WHEN OTHERS.
ENDCASE.
endmethod.
-
Action Action type
CHECK_DATA Standard
-
method ONACTIONCHECK_DATA .
Define local variables
DATA: LR_API TYPE REF TO IF_WD_VIEW_CONTROLLER,
LR_MESSAGE_MANAGER TYPE REF TO IF_WD_MESSAGE_MANAGER,
RT_CARRID TYPE REF TO DATA,
R_CARRID TYPE RANGE OF S_CARRID,
LS_CARRID LIKE LINE OF R_CARRID,
LV_MESSAGE_TEXT TYPE STRING,
LV_LOW TYPE S_CARRID,
LV_HIGH TYPE S_CARRID.
FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE.
Check airline id
CALL METHOD WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD
EXPORTING
I_ID = 'CARRID'
RECEIVING
RT_RANGE_TABLE = RT_CARRID.
ASSIGN RT_CARRID->* TO <FS_CARRID>.
READ TABLE <FS_CARRID> INTO LS_CARRID INDEX 1.
LV_LOW = LS_CARRID-LOW.
LV_HIGH = LS_CARRID-HIGH.
IF LV_LOW IS NOT INITIAL.
SELECT COUNT(*)
FROM SCARR
WHERE CARRID = LV_LOW.
IF SY-SUBRC <> 0.
LR_API = WD_THIS->WD_GET_API( ).
LR_MESSAGE_MANAGER = LR_API->GET_MESSAGE_MANAGER( ).
CONCATENATE 'Inputed Airline ID' LV_LOW 'is not exist!'
INTO LV_MESSAGE_TEXT SEPARATED BY SPACE.
CALL METHOD LR_MESSAGE_MANAGER->REPORT_ERROR_MESSAGE
EXPORTING
MESSAGE_TEXT = LV_MESSAGE_TEXT.
ENDIF.
ENDIF.
IF LV_HIGH IS NOT INITIAL.
SELECT COUNT(*)
FROM SCARR
WHERE CARRID = LV_HIGH.
IF SY-SUBRC <> 0.
LR_API = WD_THIS->WD_GET_API( ).
LR_MESSAGE_MANAGER = LR_API->GET_MESSAGE_MANAGER( ).
CONCATENATE 'Inputed Airline ID' LV_HIGH 'is not exist!'
INTO LV_MESSAGE_TEXT SEPARATED BY SPACE.
CALL METHOD LR_MESSAGE_MANAGER->REPORT_ERROR_MESSAGE
EXPORTING
MESSAGE_TEXT = LV_MESSAGE_TEXT.
ENDIF.
ENDIF.
endmethod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
SAP intentionaly disables the browser right click context menu. There is no way within Web Dynpro to get back to the browser supplied context menu. This is done for consistency when running the same application in different "clients" = browser, NetWeaver Business Client, and Flex Client.
The suggestions given here are correct in the way that you can enhance or extend the Web Dynpro Context Menu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.