Skip to Content
author's profile photo Former Member
Former Member

two ALV buttons with same function code but different functionalities

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jul 25, 2012 at 04: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 26, 2012 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 26, 2012 at 07:18 AM

    Hello,

    Isn't is possible to store the m_ucomm into a global variable?

    Thanks,

    Abhijit

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 26, 2012 at 10: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.