‎2012 Jul 25 4:45 PM
I am using the same method for handling the user command for both buttons. Since the function code is same i want to identify the object from which the button got called .. Can any one help in this ?? Thanks in advance
Message was edited by: Thomas Zloch - subject adjusted
‎2012 Jul 25 5:04 PM
In your local class where you have created method to handle event create an attribute for example NAME
create two instance of your local class with different value in NAME attribute and then register these to your individual grid.
When methods are called, you can read value from NAME attribute to find out which grid has triggered the event.
Regards,
Pawan
‎2012 Jul 26 7:39 AM
Dear Pawan ,
While debugging , suppose i clicked the button from the second alv (say object obj2) , then while debugging i could find that ,obj2->m_ucomm = FCODE , same time for obj1 (instance of alv1 )it is blank.
But i can not access obj2->m_ucomm or obj_ucomm->m_ucomm in the program since it is a protected attribute of the class cl_gui_alv_grid. How can i pass the value of m_ucom to a variable. ? If i can pass the value to a variable or if i am able to access m_ucomm using the object of alv in program then i can do the rest by checking the value of it . Can you help me in this ???
regards
Varun
‎2012 Jul 26 8:18 AM
Hello,
Isn't is possible to store the m_ucomm into a global variable?
Thanks,
Abhijit
‎2012 Jul 26 8:29 AM
‎2012 Jul 26 11:24 AM
Hi Varun,
can you explane why are you using the same event handler method for two different alv grids, if you want to have different functionalities? I think it would be better to use two different methods or you can create a second event handler which inherits from the first and overrides the event handler method.
Best regards,
Viktor