Skip to Content
avatar image
Former Member

Internet explorer browser 'right click' context menu

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 20, 2009 at 11:30 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 20, 2009 at 08:45 AM
    Add comment
    10|10000 characters needed characters exceeded

  • Apr 21, 2009 at 12:05 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded