<?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: Creating Context Menus for reports in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829991#M662269</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sushma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the below program.&lt;/P&gt;&lt;P&gt;I hope It helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT Zjai_test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: wa_spfli TYPE spfli,&lt;/P&gt;&lt;P&gt;wa_sflight TYPE sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'BASIC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM spfli INTO wa_spfli.&lt;/P&gt;&lt;P&gt;WRITE: / wa_spfli-carrid,&lt;/P&gt;&lt;P&gt;wa_spfli-connid,&lt;/P&gt;&lt;P&gt;wa_spfli-cityfrom,&lt;/P&gt;&lt;P&gt;wa_spfli-cityto.&lt;/P&gt;&lt;P&gt;HIDE: wa_spfli-carrid, wa_spfli-connid.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;CLEAR wa_spfli.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT USER-COMMAND.&lt;/P&gt;&lt;P&gt;CASE sy-ucomm.&lt;/P&gt;&lt;P&gt;WHEN 'DETAIL'.&lt;/P&gt;&lt;P&gt;CHECK NOT wa_spfli IS INITIAL.&lt;/P&gt;&lt;P&gt;WRITE sy-lisel COLOR COL_HEADING.&lt;/P&gt;&lt;P&gt;SELECT * FROM sflight INTO wa_sflight&lt;/P&gt;&lt;P&gt;WHERE carrid = wa_spfli-carrid&lt;/P&gt;&lt;P&gt;AND connid = wa_spfli-connid.&lt;/P&gt;&lt;P&gt;WRITE / wa_sflight-fldate.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;CLEAR wa_spfli.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM on_ctmenu_request USING l_menu TYPE REF TO cl_ctmenu.&lt;/P&gt;&lt;P&gt;DATA lin TYPE i.&lt;/P&gt;&lt;P&gt;GET CURSOR LINE lin.&lt;/P&gt;&lt;P&gt;IF lin &amp;gt; 2 AND sy-lsind = 0.&lt;/P&gt;&lt;P&gt;CALL METHOD l_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;EXPORTING fcode = 'DETAIL'&lt;/P&gt;&lt;P&gt;text = text-001.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CALL METHOD l_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;EXPORTING fcode = 'BACK'&lt;/P&gt;&lt;P&gt;text = text-002.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Reward if it is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Sep 2007 10:03:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-20T10:03:35Z</dc:date>
    <item>
      <title>Creating Context Menus for reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829990#M662268</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;I have a classic report with some fields. Whenever I right click on any of the values in the report column, a context menu should appear with the options I define.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea abt how to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sushma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 09:34:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829990#M662268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T09:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Context Menus for reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829991#M662269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sushma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the below program.&lt;/P&gt;&lt;P&gt;I hope It helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT Zjai_test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: wa_spfli TYPE spfli,&lt;/P&gt;&lt;P&gt;wa_sflight TYPE sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'BASIC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM spfli INTO wa_spfli.&lt;/P&gt;&lt;P&gt;WRITE: / wa_spfli-carrid,&lt;/P&gt;&lt;P&gt;wa_spfli-connid,&lt;/P&gt;&lt;P&gt;wa_spfli-cityfrom,&lt;/P&gt;&lt;P&gt;wa_spfli-cityto.&lt;/P&gt;&lt;P&gt;HIDE: wa_spfli-carrid, wa_spfli-connid.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;CLEAR wa_spfli.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT USER-COMMAND.&lt;/P&gt;&lt;P&gt;CASE sy-ucomm.&lt;/P&gt;&lt;P&gt;WHEN 'DETAIL'.&lt;/P&gt;&lt;P&gt;CHECK NOT wa_spfli IS INITIAL.&lt;/P&gt;&lt;P&gt;WRITE sy-lisel COLOR COL_HEADING.&lt;/P&gt;&lt;P&gt;SELECT * FROM sflight INTO wa_sflight&lt;/P&gt;&lt;P&gt;WHERE carrid = wa_spfli-carrid&lt;/P&gt;&lt;P&gt;AND connid = wa_spfli-connid.&lt;/P&gt;&lt;P&gt;WRITE / wa_sflight-fldate.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;CLEAR wa_spfli.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM on_ctmenu_request USING l_menu TYPE REF TO cl_ctmenu.&lt;/P&gt;&lt;P&gt;DATA lin TYPE i.&lt;/P&gt;&lt;P&gt;GET CURSOR LINE lin.&lt;/P&gt;&lt;P&gt;IF lin &amp;gt; 2 AND sy-lsind = 0.&lt;/P&gt;&lt;P&gt;CALL METHOD l_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;EXPORTING fcode = 'DETAIL'&lt;/P&gt;&lt;P&gt;text = text-001.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CALL METHOD l_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;EXPORTING fcode = 'BACK'&lt;/P&gt;&lt;P&gt;text = text-002.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Reward if it is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 10:03:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829991#M662269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T10:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Context Menus for reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829992#M662270</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;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;Context Menus for Lists&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;As with normal screens, the system creates a standard context menu when you use a dialog status in a list. You can call this standard context menu using the right-hand mouse button (Shift + F10). It displays all of the functions assigned to function keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can define context menus for list lines in the same way as for screen elements. To do this, you must assign a special function code to the function key Shift+F10 in the dialog status of the list. To define context menus for a list, you must first have defined a dialog status for the list and set it using SET PF-STATUS.&lt;/P&gt;&lt;P&gt;In this dialog status, which you will normally create using the List status template, the List with context menu option must be selected in the function key setting attributes. To do this, place the cursor on a function key setting in the Menu Painter and choose Attributes or Goto   Attributes   F key setting. The function code %CTX is assigned to function key Shift&lt;EM&gt;F10. Since the introduction of context menus on lists, it is no longer possible to assign Shift&lt;/EM&gt;F10 freely to any&lt;/P&gt;&lt;P&gt;function in the Menu Painter. In any existing dialog status where a function code was assigned to Shift&lt;EM&gt;F10, it has been reassigned to Shift&lt;/EM&gt;Ctrl+0. You must activate the function code %CTX manually before it has any effect in the dialog status.&lt;/P&gt;&lt;P&gt;As on screens, context menus on lists are generated dynamically in ABAP programs as objects of the class CL_CTMENU. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For context menus on lists, you must program a callback routine in the ABAP program:&lt;/P&gt;&lt;P&gt;FORM on_ctmenu_request USING &amp;lt;l_menu&amp;gt; TYPE REF TO cl_ctmenu.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;In this subroutine, you can define a context menu using the object reference &amp;lt;l_menu&amp;gt; as described in the Context Menus [Page 639] section. To define a specific context menu, for example, you could get the cursor position on the list using GET CURSOR. If required, you may need to find out the current list level from the corresponding system fields (for example, SYLISTI).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you right-click a list line (or choose Shift+F10), the callback routine is executed, and the context menu defined in it is displayed. If the user chooses a menu item, the system carries on processing according to the function code assigned to it. The function is either executed by the runtime environment, or the corresponding event is triggered (in which case, the function code is placed in the system field SY-UCOMM).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you right-click outside a list line, the system displays the standard context menu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex.&lt;/P&gt;&lt;P&gt;REPORT demo_list_context_menu .&lt;/P&gt;&lt;P&gt;DATA: wa_spfli TYPE spfli,&lt;/P&gt;&lt;P&gt;wa_sflight TYPE sflight.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'BASIC'.&lt;/P&gt;&lt;P&gt;SELECT * FROM spfli INTO wa_spfli.&lt;/P&gt;&lt;P&gt;WRITE: / wa_spfli-carrid,&lt;/P&gt;&lt;P&gt;wa_spfli-connid,&lt;/P&gt;&lt;P&gt;wa_spfli-cityfrom,&lt;/P&gt;&lt;P&gt;wa_spfli-cityto.&lt;/P&gt;&lt;P&gt;HIDE: wa_spfli-carrid, wa_spfli-connid.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;CLEAR wa_spfli.&lt;/P&gt;&lt;P&gt;AT USER-COMMAND.&lt;/P&gt;&lt;P&gt;CASE sy-ucomm.&lt;/P&gt;&lt;P&gt;WHEN 'DETAIL'.&lt;/P&gt;&lt;P&gt;CHECK NOT wa_spfli IS INITIAL.&lt;/P&gt;&lt;P&gt;WRITE sy-lisel COLOR COL_HEADING.&lt;/P&gt;&lt;P&gt;SELECT * FROM sflight INTO wa_sflight&lt;/P&gt;&lt;P&gt;WHERE carrid = wa_spfli-carrid&lt;/P&gt;&lt;P&gt;AND connid = wa_spfli-connid.&lt;/P&gt;&lt;P&gt;WRITE / wa_sflight-fldate.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;FORM on_ctmenu_request USING l_menu TYPE REF TO cl_ctmenu.&lt;/P&gt;&lt;P&gt;DATA lin TYPE i.&lt;/P&gt;&lt;P&gt;IF sy-listi = 0.&lt;/P&gt;&lt;P&gt;GET CURSOR LINE lin.&lt;/P&gt;&lt;P&gt;IF lin &amp;gt; 2.&lt;/P&gt;&lt;P&gt;CALL METHOD l_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;EXPORTING fcode = 'DETAIL'&lt;/P&gt;&lt;P&gt;text = text-001.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CALL METHOD l_menu-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;EXPORTING fcode = 'BACK'&lt;/P&gt;&lt;P&gt;text = text-002.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the dialog status BASIC for the basic list, %CTX is assigned to Shift+F10. In the&lt;/P&gt;&lt;P&gt;callback routine, a context menu is defined. The definition depends on the cursor&lt;/P&gt;&lt;P&gt;position and the list currently displayed.&lt;/P&gt;&lt;P&gt;If the user right-clicks the two-line default page header on the basic list, the system displays a single-line context menu. The Back function is executed by the runtime environment. If you right-click a list line, a two-line context menu is displayed. The Detail function triggers the event AT USER-COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 10:18:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829992#M662270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T10:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Context Menus for reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829993#M662271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhaskar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.But the context menu is getting displayed only with shift+F10...but not with right click......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 11:47:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829993#M662271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T11:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Context Menus for reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829994#M662272</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;Its working fine when we right click.  I tested and send to you.  once again try with that code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 11:55:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829994#M662272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T11:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Context Menus for reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829995#M662273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey I have have tried with the right click many no of times but only shift+F10 is working...Do we need to change some settings for the right click to work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2007 11:59:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-context-menus-for-reports/m-p/2829995#M662273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-20T11:59:11Z</dc:date>
    </item>
  </channel>
</rss>

