Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the calling referring object from inside the method of a class

MKM
Active Participant
0 Kudos
98

Hi all,

i am using one local class inside my program for handling different events called from two ALVs(one at TOP and another at BOTTOM) in my screen.

now I want to know which reference object is calling the class from inside my method so that i can handle the behavior of ALVs in a different way depending on which ALV(TOP or BOTTOM), i am working on.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
68

Use the parameter SENDER which is always available

class lcl_event_receiver definition.

  public section.

    methods:

      handle_double_click

        for event double_click of cl_gui_alv_grid

            importing e_row e_column sender,

...

class lcl_event_receiver implementation.

  method handle_double_click.

    case sender.

      when grid_main.

        read table itab_main index e_row-index into record_main.

...

Regards,

Raymond

1 REPLY 1

raymond_giuseppi
Active Contributor
0 Kudos
69

Use the parameter SENDER which is always available

class lcl_event_receiver definition.

  public section.

    methods:

      handle_double_click

        for event double_click of cl_gui_alv_grid

            importing e_row e_column sender,

...

class lcl_event_receiver implementation.

  method handle_double_click.

    case sender.

      when grid_main.

        read table itab_main index e_row-index into record_main.

...

Regards,

Raymond