<?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: e_ucomm problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496372#M1063993</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Luchticha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend to define an instance (static) attribute in your event handler class, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_eventhandler  DEFINITION.
  " NOTE: I prefer to use static methods and attributes for my event handler class, but this is a matter of taste...
  PUBLIC SECTION.
    CLASS-DATA:
      md_okcode       TYPE ui_func.  
    CLASS-METHODS:
      handle_data_changed
         FOR EVENT data_changed OF cl_gui_alv_grid
             IMPORTING er_data_changed,


    handle_onf4 FOR EVENT onf4 OF cl_gui_alv_grid
          IMPORTING sender
                 e_fieldname
                 e_fieldvalue
                 es_row_no
                 er_event_data
                 et_bad_cells
                 e_display.

ENDCLASS.                    "lcl_eventhandler DEFINITION
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the user chooses a function of the context menu it should trigger event USER_COMMAND. Here you can store and refresh you attribute, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD handle_user_command.

  md_okcode = e_ucomm.
" Do something...
  CLEAR: md_okcode.
ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps you need another place where to clear the ok-code but I think you understand the concept and can easily adapt this to your scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Sep 2008 03:38:27 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2008-09-16T03:38:27Z</dc:date>
    <item>
      <title>e_ucomm problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496371#M1063992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;in my data_changed method I am doing a check on e_ucomm which is the function code of a context_menu in an ALV-Grid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method handle_data_changed.
    if e_ucomm = 'Context_menu_AAS'.
      /bmw/pur_a003_cl_inbox_appl=&amp;gt;gv_verantw_flag = 'X'.
    endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately the handle_data_changed is triggered also by pressing ENTER on the grid. I found out that e_ucomm is still set to value 'Context_menu_AAS' and is not set for exampe on initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I somehow clear the content of e_ucomm?&lt;/P&gt;&lt;P&gt;I tried&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method handle_data_changed.
    if e_ucomm = 'Context_menu_AAS'.
      /bmw/pur_a003_cl_inbox_appl=&amp;gt;gv_verantw_flag = 'X'.
     clear e_ucomm.
    endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that did not have any effects on future calls of handle_data_changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;had somebody had the same experience?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with best regards&lt;/P&gt;&lt;P&gt;luchticha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 20:35:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496371#M1063992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-15T20:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: e_ucomm problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496372#M1063993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Luchticha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend to define an instance (static) attribute in your event handler class, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_eventhandler  DEFINITION.
  " NOTE: I prefer to use static methods and attributes for my event handler class, but this is a matter of taste...
  PUBLIC SECTION.
    CLASS-DATA:
      md_okcode       TYPE ui_func.  
    CLASS-METHODS:
      handle_data_changed
         FOR EVENT data_changed OF cl_gui_alv_grid
             IMPORTING er_data_changed,


    handle_onf4 FOR EVENT onf4 OF cl_gui_alv_grid
          IMPORTING sender
                 e_fieldname
                 e_fieldvalue
                 es_row_no
                 er_event_data
                 et_bad_cells
                 e_display.

ENDCLASS.                    "lcl_eventhandler DEFINITION
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the user chooses a function of the context menu it should trigger event USER_COMMAND. Here you can store and refresh you attribute, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD handle_user_command.

  md_okcode = e_ucomm.
" Do something...
  CLEAR: md_okcode.
ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps you need another place where to clear the ok-code but I think you understand the concept and can easily adapt this to your scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2008 03:38:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496372#M1063993</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-09-16T03:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: e_ucomm problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496373#M1063994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Luchticha ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can define another variable like e_ucomm. Then you can modify your code something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: l_ucomm like e_ucomm

method handle_data_changed.
    l_ucomm = e_ucomm.
    if l_ucomm = 'Context_menu_AAS'.
       clear: e_ucomm,l_ucomm.
      /bmw/pur_a003_cl_inbox_appl=&amp;gt;gv_verantw_flag = 'X'.
    endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will change your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brajvir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2008 06:47:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496373#M1063994</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-16T06:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: e_ucomm problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496374#M1063995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately the problem remains.&lt;/P&gt;&lt;P&gt;I tried to clear e_ucomm on various places, but it is not set to INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe anybody else has an idea what happens?&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2008 09:25:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496374#M1063995</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-16T09:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: e_ucomm problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496375#M1063996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Luchticha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some problems understanding why you need to know E_UCOMM (triggered by choosing a context menu function) at the event handler HANDLE_DATA_CHANGED. Perhaps you can explain your scenario or show parts of the relevant coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2008 11:16:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496375#M1063996</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-09-16T11:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: e_ucomm problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496376#M1063997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will try to explain better,&lt;/P&gt;&lt;P&gt;in my data_changed method I am doing a check on e_ucomm which is the function code of a context_menu in an ALV-Grid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method handle_data_changed.
    if e_ucomm = 'Context_menu_AAS'.
      flag = 'X'.
    endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need this because if handel_data_changed is triggered by clicking on the context-menu some error checks, which will be called later in this method, must not be done. I am doing this by checking whether the flag is set or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Till here everything works fine, but if I change a field in the ALV and press Enter (which triggers handle_data_changed) e_ucomm is still set to 'Context_menu_AAS' and so the flag is set again to X and the error-checking again is not done which is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, shouldn't the u_ecomm not be initialized automatically?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2008 11:29:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496376#M1063997</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-16T11:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: e_ucomm problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496377#M1063998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure the problem is still alive.&lt;/P&gt;&lt;P&gt;I faced the same problem and found a solution to clear the e_ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user command is stored in CL_GUI_ALV_GRID-&amp;gt;M_UCOMM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data_changed event is triggered as follows:&lt;/P&gt;&lt;P&gt;raise event data_changed exporting er_data_changed = mr_data_changed&lt;/P&gt;&lt;P&gt;                                   e_onf4          = i_f4&lt;/P&gt;&lt;P&gt;                                   e_onf4_before   = i_f4_before&lt;/P&gt;&lt;P&gt;                                   e_onf4_after    = i_f4_after&lt;/P&gt;&lt;P&gt;                                   e_ucomm         = m_ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so all we need do is to clear M_UCOMM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a method:&lt;/P&gt;&lt;P&gt;CL_GUI_ALV_GRID-&amp;gt;SET_USER_COMMAND&lt;/P&gt;&lt;P&gt;  exporting&lt;/P&gt;&lt;P&gt;     i_ucomm = space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Viktor Bojtos&lt;/P&gt;&lt;P&gt;Hungary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 15:49:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496377#M1063998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-23T15:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: e_ucomm problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496378#M1063999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Viktor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am so happy that I see this post and your answer. I have the same problem and have searched for a solution for a long time. And your answer is correct and I have solved my problem. Thanks a lot!&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Wenwen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 14:02:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/e-ucomm-problem/m-p/4496378#M1063999</guid>
      <dc:creator>former_member658745</dc:creator>
      <dc:date>2013-02-08T14:02:17Z</dc:date>
    </item>
  </channel>
</rss>

