<?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 ALV Insert Button Drop Down in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-insert-button-drop-down/m-p/2768651#M644936</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;Can any body please tell me that in ALV grid, how can i get the drop down for insert button in the tool bar with options "Add 1", "Add 2" ... inserting 1, 2 or 3 lines??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Kulwant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Sep 2007 06:17:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-13T06:17:59Z</dc:date>
    <item>
      <title>ALV Insert Button Drop Down</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-insert-button-drop-down/m-p/2768651#M644936</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;Can any body please tell me that in ALV grid, how can i get the drop down for insert button in the tool bar with options "Add 1", "Add 2" ... inserting 1, 2 or 3 lines??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Kulwant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2007 06:17:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-insert-button-drop-down/m-p/2768651#M644936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-13T06:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Insert Button Drop Down</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-insert-button-drop-down/m-p/2768652#M644937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check in SE38 for BCALV* or RSDEMO *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALVOOPS&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.erpgenie.com/abap/controls/alvgrid.htm" target="test_blank"&gt;http://www.erpgenie.com/abap/controls/alvgrid.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3826571"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action&amp;amp;pageid=37566" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action&amp;amp;pageid=37566&lt;/A&gt;&lt;/P&gt;&lt;P&gt;/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For understanding COntrol Frameworks in OO ABAP, check this.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/controls/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/controls/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt" target="test_blank"&gt;http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf" target="test_blank"&gt;http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt" target="test_blank"&gt;http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.allsaplinks.com/" target="test_blank"&gt;http://www.allsaplinks.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/" target="test_blank"&gt;http://www.sap-img.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/" target="test_blank"&gt;http://www.sapgenie.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com" target="test_blank"&gt;http://help.sap.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com" target="test_blank"&gt;http://www.sapgenie.com&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/controls/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/controls/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf" target="test_blank"&gt;http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf" target="test_blank"&gt;http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/victorav15/sapr3/abap_ood.html" target="test_blank"&gt;http://www.geocities.com/victorav15/sapr3/abap_ood.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.brabandt.de/html/abap_oo.html" target="test_blank"&gt;http://www.brabandt.de/html/abap_oo.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards if useful...............&lt;/P&gt;&lt;P&gt;Minal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2007 07:50:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-insert-button-drop-down/m-p/2768652#M644937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-13T07:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Insert Button Drop Down</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-insert-button-drop-down/m-p/2768653#M644938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) define following macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE toolbar_funcs.&lt;/P&gt;&lt;P&gt;   CLEAR ls_toolbar.&lt;/P&gt;&lt;P&gt;    MOVE 0 TO ls_toolbar-butn_TYPE.&lt;/P&gt;&lt;P&gt;    MOVE &amp;amp;1 TO ls_toolbar-function.&lt;/P&gt;&lt;P&gt;    MOVE SPACE TO ls_toolbar-disabled.&lt;/P&gt;&lt;P&gt;    MOVE &amp;amp;2 TO ls_toolbar-icon.&lt;/P&gt;&lt;P&gt;    MOVE &amp;amp;3 TO ls_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;    APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt; END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)  in the class definition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  EVENTS: user_command.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;     on_user_command&lt;/P&gt;&lt;P&gt;        FOR EVENT user_command OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          e_ucomm&lt;/P&gt;&lt;P&gt;          sender,&lt;/P&gt;&lt;P&gt;     on_toolbar&lt;/P&gt;&lt;P&gt;        FOR EVENT toolbar OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          e_object&lt;/P&gt;&lt;P&gt;          e_interactive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) define the handlers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET HANDLER z_object-&amp;gt;on_user_command for grid1.&lt;/P&gt;&lt;P&gt;    SET HANDLER z_object-&amp;gt;on_toolbar for grid1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) in the implementation part  code the functions you've given your  buttons&lt;/P&gt;&lt;P&gt;for example &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; METHOD on_user_command.&lt;/P&gt;&lt;P&gt;  break-point 1.&lt;/P&gt;&lt;P&gt;    CASE e_ucomm.&lt;/P&gt;&lt;P&gt;      WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;        LEAVE PROGRAM.&lt;/P&gt;&lt;P&gt;      WHEN 'EXCEL'.&lt;/P&gt;&lt;P&gt;        CALL METHOD me-&amp;gt;download_to_excel.&lt;/P&gt;&lt;P&gt;      WHEN 'SAVE'.&lt;/P&gt;&lt;P&gt;      WHEN 'PROC'.&lt;/P&gt;&lt;P&gt;        CALL METHOD me-&amp;gt;process.&lt;/P&gt;&lt;P&gt;      WHEN 'REFR'.&lt;/P&gt;&lt;P&gt;        CALL METHOD me-&amp;gt;refresh.&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.  "on_user_command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the toolbar method  --use YOUR buttons and functions&lt;/P&gt;&lt;P&gt;Using the macro in step 1) means you have to write a lot less code. Some people don't like macros but in this case we are using it for pure code generation and not complex processing so it's (IMO) still OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; METHOD on_toolbar.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;customize this section with your own Buttons&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;When a button is pressed method ON_USER_COMMAND is entered&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   toolbar_funcs 'EXIT'  icon_system_end            'Click2exit'.&lt;/P&gt;&lt;P&gt;   toolbar_funcs 'SAVE'  icon_system_save           'Savedata'.&lt;/P&gt;&lt;P&gt;   toolbar_funcs 'EDIT'  icon_toggle_display_change 'Edit data'.&lt;/P&gt;&lt;P&gt;   toolbar_funcs 'PROC'  icon_businav_process       'Process'.&lt;/P&gt;&lt;P&gt;   toolbar_funcs 'EXCEL' icon_xxl                   'Excel'.&lt;/P&gt;&lt;P&gt;   toolbar_funcs 'REFR'  icon_refresh               'Refresh'.&lt;/P&gt;&lt;P&gt;   ENDMETHOD.                    "on_toolbar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the toolbar button type to what you want. It's all in the ALV documentation. The code above uses standard rather than drop down buttons but the process is the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The permitted values and types can be found by looking at the values for domain  TB_BTYPE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you want 2 (Menu type button).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change this line in the macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE 0 TO ls_toolbar-butn_TYPE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a menu set the type to 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Include the menu handler in the class definition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;handle_menu_button&lt;/P&gt;&lt;P&gt;        FOR EVENT menu_button OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;            IMPORTING e_object e_ucomm,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET HANDLER z_object-&amp;gt;handle_menu_button FOR grid1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add your choices when you click the button&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; METHOD handle_menu_button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;handle own menubuttons&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF e_ucomm = 'DETAIL_MENU'.&lt;/P&gt;&lt;P&gt;      CALL METHOD e_object-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;                  EXPORTING fcode   = 'ADD1'&lt;/P&gt;&lt;P&gt;                            text    = text1. &lt;/P&gt;&lt;P&gt;      CALL METHOD e_object-&amp;gt;add_function&lt;/P&gt;&lt;P&gt;                  EXPORTING fcode   = 'ADD2'&lt;/P&gt;&lt;P&gt;                            text    = text2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The choices  (function codes from your menu) are still handled in the ON_USER_COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2007 08:05:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-insert-button-drop-down/m-p/2768653#M644938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-13T08:05:06Z</dc:date>
    </item>
  </channel>
</rss>

