<?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: Class for LOAD_GUI_STATUS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-for-load-gui-status/m-p/1928822#M385035</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;CL_CTMENU is the class for method LOAD_GUI_STATUS&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CONTEXT MENU&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;  Context menu can be used in relation with the various screen elements like I/O fields, subscreen,group box,table control but not with push buttons,radio,check buttons.&lt;/P&gt;&lt;P&gt;  It can be used to show related options when the user right clicks on the screen elements. It is a type of status. SAP automatically creates a default context menu for dialog statuses consisting of all the function codes available.&lt;/P&gt;&lt;P&gt; We can create a context menu statically using the menu painter(SE41)or dynamically by using the methods of the &amp;lt;b&amp;gt;global class CL_CTMENU&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt; All context menus are objects of this global class.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; There are number of methods which can be used to create and modify context menu dynamically . These are:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;LOAD_GUI_STATUS&lt;/P&gt;&lt;P&gt; This method is used to load a static context menu already defined using&lt;/P&gt;&lt;P&gt;menu painter.The exporting parameters are PROGRAM ,STATUS and MENU. Where MENU indicates the menu to which the context menu will be attached .&lt;/P&gt;&lt;P&gt;ADD_FUNCTION&lt;/P&gt;&lt;P&gt; This method adds a function code to the menu ,The exporting parameters are FCODE and TEXT. These are used to specify the function code and the corresponding text in the men.&lt;/P&gt;&lt;P&gt;ADD_MENU&lt;/P&gt;&lt;P&gt; This method adds a context menu to another one.&lt;/P&gt;&lt;P&gt;ADD_SEPARATOR&lt;/P&gt;&lt;P&gt; This method adds a separator line.&lt;/P&gt;&lt;P&gt;ADD_SUBMENU&lt;/P&gt;&lt;P&gt; This method adds a menu to another one as a sub menu the exporting parameters are MENU and the TEXT that will be displayed.&lt;/P&gt;&lt;P&gt;HIDE_FUNCTIONS&lt;/P&gt;&lt;P&gt;SHOW_FUNCTIONS&lt;/P&gt;&lt;P&gt;DISABLE_FUNCTIONS&lt;/P&gt;&lt;P&gt;ENABLE_FUNCTIONS&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;These functions are used to modify the context menu by hiding,enabling etc them.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;SET_DEFAULT_FUNCTION&lt;/P&gt;&lt;P&gt; This method will mark a particular menu item as the default one ,the corresponding function code is passed as an exporting parameter.&lt;/P&gt;&lt;P&gt;The context menu should be linked to the screen element in the screen painte(SE51) by specifying an ID which is known as CONTEXT in the context menu field.&lt;/P&gt;&lt;P&gt;We can specify the same context for different screen elements or different context for different elements.&lt;/P&gt;&lt;P&gt;    For each context specified in the screen painter a special call back subroutine is used in the abap program. the syntax of this special routine is:&lt;/P&gt;&lt;P&gt;FORM ON_CTLMENU_context USING menu TYPE REF TO CL_CTMENU&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ENDFORM&lt;/P&gt;&lt;P&gt; This subroutine can be used to modify or load or create a context menu at runtime when the user right clicks the screen element.&lt;/P&gt;&lt;P&gt; In the above subroutine the context is the context assigned to the screen element and menu is the menu object that was passed to this call back routine which is initially blank, we have to use methods of the class as stated above to create a working menu or load an existing static context menu previously build in the menu painter.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;e.g. To load an existing context menu&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM on_ctmenu_text USING menu TYPE REF TO cl_ctmenu.&lt;/P&gt;&lt;P&gt;  CALL METHOD menu-&amp;gt;load_gui_status&lt;/P&gt;&lt;P&gt;                      EXPORTING program = prog&lt;/P&gt;&lt;P&gt;                                status  = 'CON_MENU'&lt;/P&gt;&lt;P&gt;                                menu    = menu .&lt;/P&gt;&lt;P&gt;  CALL METHOD  menu-&amp;gt;set_default_function&lt;/P&gt;&lt;P&gt;                      EXPORTING fcode = 'list'.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. CREATING A NEW CONTEXT MENU DYNAMICALLY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM on_ctmenu_text USING menu TYPE REF TO cl_ctmenu.&lt;/P&gt;&lt;P&gt;  DATA new_menu TYPE REF TO cl_ctmenu.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT new_menu.&lt;/P&gt;&lt;P&gt;  CALL METHOD new_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;                      EXPORTING fcode = 'list'&lt;/P&gt;&lt;P&gt;                                text  = text-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD  new_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;                       EXPORTING fcode = 'add'&lt;/P&gt;&lt;P&gt;                                 text  = text-002.  CALL METHOD   new_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;                       EXPORTING fcode = 'delete'&lt;/P&gt;&lt;P&gt;                                text  = text-003.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD   new_menu-&amp;gt;add_submenu&lt;/P&gt;&lt;P&gt;                       EXPORTING menu = new_menu&lt;/P&gt;&lt;P&gt;                                 text = text-005.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Feb 2007 09:11:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-26T09:11:06Z</dc:date>
    <item>
      <title>Class for LOAD_GUI_STATUS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-for-load-gui-status/m-p/1928820#M385033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please anybody tell me,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the class for method LOAD_GUI_STATUS in context menu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Feb 2007 06:02:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-for-load-gui-status/m-p/1928820#M385033</guid>
      <dc:creator>Sultanuddin</dc:creator>
      <dc:date>2007-02-25T06:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Class for LOAD_GUI_STATUS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-for-load-gui-status/m-p/1928821#M385034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class for LOAD_GUI_STATUS  is CL_CTMENU .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Asha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2007 09:00:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-for-load-gui-status/m-p/1928821#M385034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-26T09:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Class for LOAD_GUI_STATUS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-for-load-gui-status/m-p/1928822#M385035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;CL_CTMENU is the class for method LOAD_GUI_STATUS&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CONTEXT MENU&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;  Context menu can be used in relation with the various screen elements like I/O fields, subscreen,group box,table control but not with push buttons,radio,check buttons.&lt;/P&gt;&lt;P&gt;  It can be used to show related options when the user right clicks on the screen elements. It is a type of status. SAP automatically creates a default context menu for dialog statuses consisting of all the function codes available.&lt;/P&gt;&lt;P&gt; We can create a context menu statically using the menu painter(SE41)or dynamically by using the methods of the &amp;lt;b&amp;gt;global class CL_CTMENU&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt; All context menus are objects of this global class.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; There are number of methods which can be used to create and modify context menu dynamically . These are:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;LOAD_GUI_STATUS&lt;/P&gt;&lt;P&gt; This method is used to load a static context menu already defined using&lt;/P&gt;&lt;P&gt;menu painter.The exporting parameters are PROGRAM ,STATUS and MENU. Where MENU indicates the menu to which the context menu will be attached .&lt;/P&gt;&lt;P&gt;ADD_FUNCTION&lt;/P&gt;&lt;P&gt; This method adds a function code to the menu ,The exporting parameters are FCODE and TEXT. These are used to specify the function code and the corresponding text in the men.&lt;/P&gt;&lt;P&gt;ADD_MENU&lt;/P&gt;&lt;P&gt; This method adds a context menu to another one.&lt;/P&gt;&lt;P&gt;ADD_SEPARATOR&lt;/P&gt;&lt;P&gt; This method adds a separator line.&lt;/P&gt;&lt;P&gt;ADD_SUBMENU&lt;/P&gt;&lt;P&gt; This method adds a menu to another one as a sub menu the exporting parameters are MENU and the TEXT that will be displayed.&lt;/P&gt;&lt;P&gt;HIDE_FUNCTIONS&lt;/P&gt;&lt;P&gt;SHOW_FUNCTIONS&lt;/P&gt;&lt;P&gt;DISABLE_FUNCTIONS&lt;/P&gt;&lt;P&gt;ENABLE_FUNCTIONS&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;These functions are used to modify the context menu by hiding,enabling etc them.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;SET_DEFAULT_FUNCTION&lt;/P&gt;&lt;P&gt; This method will mark a particular menu item as the default one ,the corresponding function code is passed as an exporting parameter.&lt;/P&gt;&lt;P&gt;The context menu should be linked to the screen element in the screen painte(SE51) by specifying an ID which is known as CONTEXT in the context menu field.&lt;/P&gt;&lt;P&gt;We can specify the same context for different screen elements or different context for different elements.&lt;/P&gt;&lt;P&gt;    For each context specified in the screen painter a special call back subroutine is used in the abap program. the syntax of this special routine is:&lt;/P&gt;&lt;P&gt;FORM ON_CTLMENU_context USING menu TYPE REF TO CL_CTMENU&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ENDFORM&lt;/P&gt;&lt;P&gt; This subroutine can be used to modify or load or create a context menu at runtime when the user right clicks the screen element.&lt;/P&gt;&lt;P&gt; In the above subroutine the context is the context assigned to the screen element and menu is the menu object that was passed to this call back routine which is initially blank, we have to use methods of the class as stated above to create a working menu or load an existing static context menu previously build in the menu painter.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;e.g. To load an existing context menu&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM on_ctmenu_text USING menu TYPE REF TO cl_ctmenu.&lt;/P&gt;&lt;P&gt;  CALL METHOD menu-&amp;gt;load_gui_status&lt;/P&gt;&lt;P&gt;                      EXPORTING program = prog&lt;/P&gt;&lt;P&gt;                                status  = 'CON_MENU'&lt;/P&gt;&lt;P&gt;                                menu    = menu .&lt;/P&gt;&lt;P&gt;  CALL METHOD  menu-&amp;gt;set_default_function&lt;/P&gt;&lt;P&gt;                      EXPORTING fcode = 'list'.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. CREATING A NEW CONTEXT MENU DYNAMICALLY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM on_ctmenu_text USING menu TYPE REF TO cl_ctmenu.&lt;/P&gt;&lt;P&gt;  DATA new_menu TYPE REF TO cl_ctmenu.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT new_menu.&lt;/P&gt;&lt;P&gt;  CALL METHOD new_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;                      EXPORTING fcode = 'list'&lt;/P&gt;&lt;P&gt;                                text  = text-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD  new_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;                       EXPORTING fcode = 'add'&lt;/P&gt;&lt;P&gt;                                 text  = text-002.  CALL METHOD   new_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;                       EXPORTING fcode = 'delete'&lt;/P&gt;&lt;P&gt;                                text  = text-003.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD   new_menu-&amp;gt;add_submenu&lt;/P&gt;&lt;P&gt;                       EXPORTING menu = new_menu&lt;/P&gt;&lt;P&gt;                                 text = text-005.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2007 09:11:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-for-load-gui-status/m-p/1928822#M385035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-26T09:11:06Z</dc:date>
    </item>
  </channel>
</rss>

