Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Context Menu in HTML Viewer class

Former Member
0 Likes
957

Hi all,

is that possible to disable context menu for CL_GUI_HTML_VIEWER control? It displays usual IE context menu and I don't want it.

Thanks for any advice.

Marcin

1 ACCEPTED SOLUTION
Read only

athavanraja
Active Contributor
0 Likes
690

while creating the instance of html_viewer pass uiflag parameter to disable context menu.

          CREATE OBJECT html_viewer
              EXPORTING
*                SHELLSTYLE         =
                parent             = container
*                LIFETIME           = LIFETIME_DEFAULT
*                SAPHTMLP           =
                 UIFLAG             = CL_GUI_HTML_VIEWER=>UIFLAG_NOIEMENU
*                NAME               =
*                SAPHTTP            =
*                QUERY_TABLE_DISABLED = ''
              EXCEPTIONS
                CNTL_ERROR         = 1
                CNTL_INSTALL_ERROR = 2
                DP_INSTALL_ERROR   = 3
                DP_ERROR           = 4
                others             = 5
                .
            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

Raja

3 REPLIES 3
Read only

venkata_ramisetti
Active Contributor
0 Likes
690

Hi,

Did you check the method TRACK_CONTEXT_MENU in class CL_GUI_HTML_VIEWER?

The parameter CTXMENU has attribute DISABLED. I think this needs be set to X. We also have to pass value to attribute TYPE (M(Menu), S(ubmenu), F(unction), D(elimiter)).

Thanks

Ramakrishna

Read only

athavanraja
Active Contributor
0 Likes
691

while creating the instance of html_viewer pass uiflag parameter to disable context menu.

          CREATE OBJECT html_viewer
              EXPORTING
*                SHELLSTYLE         =
                parent             = container
*                LIFETIME           = LIFETIME_DEFAULT
*                SAPHTMLP           =
                 UIFLAG             = CL_GUI_HTML_VIEWER=>UIFLAG_NOIEMENU
*                NAME               =
*                SAPHTTP            =
*                QUERY_TABLE_DISABLED = ''
              EXCEPTIONS
                CNTL_ERROR         = 1
                CNTL_INSTALL_ERROR = 2
                DP_INSTALL_ERROR   = 3
                DP_ERROR           = 4
                others             = 5
                .
            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

Raja

Read only

0 Likes
690

big thanks Raja, that is exactly what I was looking for.

regards,

Marcin