<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Menu_button event in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/menu-button-event/m-p/12775692#M2023367</link>
    <description>&lt;P&gt;Attribute means a Data Object inside a class section (public/private/protected). A data object can be any type. Here, m_cl_menu_button_export is declared in the protected section of CL_GUI_ALV_GRID as:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data M_CL_MENU_BUTTON_EXPORT type ref to CL_CTMENU .&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 10 Jun 2023 16:45:10 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2023-06-10T16:45:10Z</dc:date>
    <item>
      <title>Menu_button event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/menu-button-event/m-p/12775689#M2023364</link>
      <description>&lt;P&gt;Hello everyone, &lt;/P&gt;
  &lt;P&gt;In my program on the ALV grid, I added a button using the event menu_button. Now I want to change a standard menu button's context menu. For example: &lt;/P&gt;
  &lt;P&gt;METHOD menu_button.&lt;/P&gt;
  &lt;P&gt; CASE e_ucomm. &lt;BR /&gt; WHEN 'FC2'. &lt;BR /&gt;* CALL METHOD e_object-&amp;gt;add_function &lt;BR /&gt;* EXPORTING &lt;BR /&gt;* fcode = 'G1' &lt;BR /&gt;* text = 'Tcodes'. &lt;BR /&gt;DATA: obsubmenu TYPE REF TO cl_ctmenu. &lt;BR /&gt;CREATE OBJECT obsubmenu. &lt;BR /&gt; &lt;BR /&gt;CALL METHOD obsubmenu-&amp;gt;add_function &lt;BR /&gt; EXPORTING &lt;BR /&gt; fcode = 'M1' &lt;BR /&gt; text = 'ABAP editor'. &lt;BR /&gt; &lt;BR /&gt;CALL METHOD obsubmenu-&amp;gt;add_function &lt;BR /&gt; EXPORTING &lt;BR /&gt; fcode = 'M2' &lt;BR /&gt; text = 'ABAP classes'. &lt;BR /&gt; &lt;BR /&gt;CALL METHOD obsubmenu-&amp;gt;add_function &lt;BR /&gt; EXPORTING &lt;BR /&gt; fcode = 'M3' &lt;BR /&gt; text = 'ABAP Functions'. &lt;BR /&gt; &lt;BR /&gt;CALL METHOD e_object-&amp;gt;add_submenu &lt;BR /&gt;EXPORTING &lt;BR /&gt; menu = obsubmenu &lt;BR /&gt; text = 'Tcodes'. &lt;BR /&gt;when '&amp;amp;MB_EXPORT'. &amp;lt;------------------------------- issue. &lt;BR /&gt; message 'WORKING' type 'I'. &lt;BR /&gt;ENDCASE. &lt;/P&gt;
  &lt;P&gt;When I try to debug it, it skips when '&amp;amp;MB_EXPORT' condition and I can not clear, change, add, or do anything else for this standard menu button. It simply does not recognize the button.&lt;/P&gt;
  &lt;P&gt;If you have any sample codes or any suggestions, please provide them. &lt;/P&gt;
  &lt;P&gt;Thank you for time and interest &lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 10:52:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/menu-button-event/m-p/12775689#M2023364</guid>
      <dc:creator>ULGIA</dc:creator>
      <dc:date>2023-06-09T10:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Menu_button event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/menu-button-event/m-p/12775690#M2023365</link>
      <description>&lt;P&gt;There is this non-standard solution. I don't know if there's a better solution (could be, as there's all a façade stuff...)&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2171831-image.png" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ztest.
CLASS lcl_app DEFINITION INHERITING FROM cl_gui_alv_grid.
  PUBLIC SECTION.
    METHODS constructor.
    METHODS exit.
    METHODS on_toolbar FOR EVENT toolbar OF cl_gui_alv_grid IMPORTING e_object.
    METHODS on_user_command FOR EVENT user_command OF cl_gui_alv_grid IMPORTING e_ucomm.
    DATA gt_sbook TYPE TABLE OF sbook.
ENDCLASS.
CLASS lcl_app IMPLEMENTATION.
  METHOD constructor.
    CALL METHOD super-&amp;gt;constructor
      EXPORTING
        i_parent = cl_gui_container=&amp;gt;screen0.
    SELECT * FROM sbook INTO TABLE gt_sbook.
    SET HANDLER on_toolbar FOR me.
    SET HANDLER on_user_command FOR me.
    set_table_for_first_display(
        EXPORTING i_structure_name = 'SBOOK'
                  is_layout        = VALUE #( no_toolbar = space )
        CHANGING it_outtab         = gt_sbook ).
  ENDMETHOD.
  METHOD exit.
    free( ).
  ENDMETHOD.
  METHOD on_toolbar.
    m_cl_menu_button_export-&amp;gt;add_function( fcode = 'ZZ' text = 'Test ZZ' ).
  ENDMETHOD.
  METHOD on_user_command.
    CASE e_ucomm.
      WHEN 'ZZ'.
        MESSAGE 'Nice!' TYPE 'I'.
    ENDCASE.
  ENDMETHOD.
ENDCLASS.

DATA go_app TYPE REF TO lcl_app.
PARAMETERS dummy.

AT SELECTION-SCREEN OUTPUT.
  IF go_app IS NOT BOUND.
    go_app = NEW #( ).
  ENDIF.

AT SELECTION-SCREEN ON EXIT-COMMAND.
  go_app-&amp;gt;exit( ).
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 15:30:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/menu-button-event/m-p/12775690#M2023365</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-06-09T15:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Menu_button event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/menu-button-event/m-p/12775691#M2023366</link>
      <description>&lt;P&gt;Hello Sandra, thank you for your time.&lt;/P&gt;&lt;P&gt;Can I ask you? m_cl_menu_button_export is an attribute right ? How do you call a method using attribute name? &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;m_cl_menu_button_export-&amp;gt;add_function&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 14:53:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/menu-button-event/m-p/12775691#M2023366</guid>
      <dc:creator>ULGIA</dc:creator>
      <dc:date>2023-06-10T14:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Menu_button event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/menu-button-event/m-p/12775692#M2023367</link>
      <description>&lt;P&gt;Attribute means a Data Object inside a class section (public/private/protected). A data object can be any type. Here, m_cl_menu_button_export is declared in the protected section of CL_GUI_ALV_GRID as:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data M_CL_MENU_BUTTON_EXPORT type ref to CL_CTMENU .&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 16:45:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/menu-button-event/m-p/12775692#M2023367</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-06-10T16:45:10Z</dc:date>
    </item>
  </channel>
</rss>

