<?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: Function code for dropdown on OO ALV Grid to trigger user_command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540487#M1265420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Advait ,&lt;/P&gt;&lt;P&gt;                   I have got exactly similar requirement as yours ,. Could you please share how resolved this issue ? It would be of great help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Kumaran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Oct 2010 12:43:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-18T12:43:26Z</dc:date>
    <item>
      <title>Function code for dropdown on OO ALV Grid to trigger user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540478#M1265411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know we can add a dropdown to a column of an OO ALV Grid, set values to the dropdown list and allow the user to select some these values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However , what I'm not sure is that if we can *assign a function code to the dropdown * which would then trigger the event user_command ( PAI ) of the ALV class so I can handle the changes to when a particular value is selected from a dropdown list, just like we do in normal dialogs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I know that I can register the 'Enter' event and handle the data changes in data_changed event, but that is something I want to avoid the user from doing as far as possible to make the report more user friendly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Awaiting your valuable inputs and would really appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2009 00:32:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540478#M1265411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-19T00:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Function code for dropdown on OO ALV Grid to trigger user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540479#M1265412</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;Check the Demo program BCALV_EDIT_06 with having the DATA_CHANGED event still you can capture the changed data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you cannot assign the FCODES so that the change in list box will triggere the USER_COMMAND. You need to go with DATA_CHANGED event only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2009 00:45:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540479#M1265412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-19T00:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Function code for dropdown on OO ALV Grid to trigger user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540480#M1265413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Avinash,&lt;/P&gt;&lt;P&gt;Thanks for your reply. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I know this example and I know how dropdown is created etc as I have mentioned this in my original post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However to get the data_changed triggered, I need to register the &lt;STRONG&gt;Enter event&lt;/STRONG&gt; and the method data_changed is called only when enter is pressed after the value changed in the dropdown.&lt;/P&gt;&lt;P&gt;But I need to call the data_changed &lt;STRONG&gt;immediately&lt;/STRONG&gt; after the value is changed in the dropdown list without having the user to press the enter button. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that possible anyways ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 08:03:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540480#M1265413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-20T08:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Function code for dropdown on OO ALV Grid to trigger user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540481#M1265414</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;Register you edit event with &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
      CALL METHOD o_alv_grid-&amp;gt;register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv=&amp;gt;mc_evt_modified.  "this constant will triger event change withouth ENTER key
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 12:44:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540481#M1265414</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-04-20T12:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Function code for dropdown on OO ALV Grid to trigger user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540482#M1265415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have the same question, too. If a value is selected by dropdown, another cell-value should change.&lt;/P&gt;&lt;P&gt;I registered the event&lt;/P&gt;&lt;P&gt;    call method alv-&amp;gt;register_edit_event&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't work. &lt;/P&gt;&lt;P&gt;The DATA_CHANGED is just triggered when I leave to another cell, so I can't manage the done changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another possibility to get the event?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings Ramona&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 12:51:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540482#M1265415</guid>
      <dc:creator>ramona_wolf</dc:creator>
      <dc:date>2009-04-28T12:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Function code for dropdown on OO ALV Grid to trigger user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540483#M1265416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;Sorry for the late reply, was occupied in lot of things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks of your reply. It worked to some extent, as in, the event data_changed is triggered after the focus is changed from the field, but not at the very moment I change the value by selecting it from the dropdown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can live with that for the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But any more replies are most welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 13:32:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540483#M1265416</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T13:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Function code for dropdown on OO ALV Grid to trigger user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540484#M1265417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Advait,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No problem. Yes, this functionality requires changing the focus to other cell.&lt;/P&gt;&lt;P&gt;I think there is other solution. As the dropdown is kind of F4 activity try this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: it_f4 type lvc_t_f4,
        wa_f4 type lvc_s_f4.

        wa_f4-FIELDNAME = 'CONNID'.
        wa_f4-REGISTER = 'X'.
        wa_f4-GETBEFORE = 'X'.
        wa_f4-CHNGEAFTER = 'X'.
        append wa_f4 to it_f4.

"register F4 event
  CALL METHOD g_alv_grid_ref-&amp;gt;register_f4_for_fields
    EXPORTING
      it_f4  = it_f4.

"Once you try to pick the value HANDLE_DATA_CHANGED event will be triggered

"Definition
     methods:
     handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
                              IMPORTING er_data_changed e_onf4 e_onf4_before e_onf4_after,

"Implementation
METHOD handle_data_changed .
    DATA: ls_mod_cells TYPE lvc_s_modi.

    IF e_onf4_before = 'X'.
      MESSAGE 'Data changed before F4' TYPE 'I'.
    ENDIF.

    IF e_onf4 = 'X'.   "if event triggered by F4
      MESSAGE 'Data changed on F4' TYPE 'I'.
    ENDIF.

    IF e_onf4_after = 'X'.
      MESSAGE 'Data changed after F4' TYPE 'I'.
    ENDIF.


   "here you know which cell was modified
    LOOP AT er_data_changed-&amp;gt;mt_mod_cells INTO ls_mod_cells.
      
     "just example test case, here you can implement your code for modified cells
      IF ls_mod_cells-value &amp;gt;=5.
        CALL METHOD er_data_changed-&amp;gt;add_protocol_entry
          EXPORTING
            i_msgid     = 'SABAPDOCU'
            i_msgty     = 'E'
            i_msgno     = '888'
            i_msgv1     = 'Only numbers below 5 are possibe'
            i_msgv2     = 'Please correct'
            i_fieldname = ls_mod_cells-fieldname
            i_row_id    = ls_mod_cells-row_id.

        CALL METHOD er_data_changed-&amp;gt;modify_cell
          EXPORTING
            i_fieldname = ls_mod_cells-fieldname
            i_row_id    = ls_mod_cells-row_id
            i_value     = space.

      ENDIF.
    ENDLOOP.

  ENDMETHOD.                    "handle_data_changed

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This approach works fine for picking value from input help. Never tried it for dropdown list. You have to try it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 14:10:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540484#M1265417</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-04-28T14:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Function code for dropdown on OO ALV Grid to trigger user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540485#M1265418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;Sounds interesting, thanks again, I will try this tomorrow for sure &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 15:01:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540485#M1265418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T15:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Function code for dropdown on OO ALV Grid to trigger user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540486#M1265419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin,&lt;/P&gt;&lt;P&gt;I tried with f4 registration, but it still didn't work the way I thought it would. However, thanks for you valuable input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 18:53:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540486#M1265419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-05T18:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Function code for dropdown on OO ALV Grid to trigger user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540487#M1265420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Advait ,&lt;/P&gt;&lt;P&gt;                   I have got exactly similar requirement as yours ,. Could you please share how resolved this issue ? It would be of great help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Kumaran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Oct 2010 12:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-code-for-dropdown-on-oo-alv-grid-to-trigger-user-command/m-p/5540487#M1265420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-18T12:43:26Z</dc:date>
    </item>
  </channel>
</rss>

