2006 Jun 29 4:04 PM
Hi everybody.
I'm not sure how to perform the next situation:
I'm working with two ALV Grid (OO) at the same time. I have defined an Exit Handler class to get the value of a field since a double-click perform. Obviously each ALV has an own fcat and data.
Is it there a way to determine which ALV Instance has been double-clicked to get data just for its corresponding data table, or I shorld do it directly?
Can I use a method such like cl_exithandler=>get_instance (obviously if there's one available?
Cheers!!
I would highly reward a good question.
2006 Jun 29 4:42 PM
Hi Santiago,
If you are using version 4.6c or superior. You can define the importing parameter SENDER in the method that is called for double_click event. Something like this:
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: get_double_click FOR EVENT double_click OF cl_gui_alv_grid IMPORTING row
SENDER.
ENDCLASS.
DATA: event_handler TYPE REF TO lcl_event_handler.
CLASS lcl_event_handler IMPLEMENTATION.
METHOD get_double_click
if sender = alv_grid1.
do something...
elseif sender = alv_grid2.
...
endif.
ENDMETHOD.
ENDCLASS.
regards,
Alejandro
Hi everybody.
I'm not sure how to perform the next situation:
I'm working with two ALV Grid (OO) at the same time. I have defined an Exit Handler class to get the value of a field since a double-click perform. Obviously each ALV has an own fcat and data.
Is it there a way to determine which ALV Instance has been double-clicked to get data just for its corresponding data table, or I shorld do it directly?
Can I use a method such like cl_exithandler=>get_instance (obviously if there's one available?
Cheers!!
I would highly reward a good question.
2006 Jun 29 4:13 PM
Do need to identify which instance.
it will take u to the exact instance of the alv.
I think u have written diffrent defination for different instance
Make different Event reciever for different instance
o_evt_rcvr1 TYPE REF TO lcl_event_receiver1. for first instance
o_evt_rcvr2 TYPE REF TO lcl_event_receiver2. for first instance
and raise Event for different instnace
*Set the event handlers for first instance
SET HANDLER o_evt_rcvr1->double_click FOR o_alvgrid1.
*Set the event handlers for second instance
SET HANDLER o_evt_rcvr2->double_click FOR o_alvgrid2.
It will Take u to the Exact defination
Message was edited by: Manoj Gupta
2006 Jun 29 4:32 PM
so, what you mean is that I have to define to instances of the event handler class, don't I?
But, may the event handler class be the same for both instances?
Cheers!
2006 Jun 29 4:41 PM
Well unfortunately you will define two different event receivers one for each grid. As the problem is that you cannot identify the instance of the grid on which the event has happened.
Probably you can differentiate using the column name on which the double click has happened provided there are no common columns. Then you need to know which column exists in which grid.
Makes sense?
Regards,
Ravi
Note : Please mark the helpful answers
2006 Jun 29 4:42 PM
Hi Santiago,
If you are using version 4.6c or superior. You can define the importing parameter SENDER in the method that is called for double_click event. Something like this:
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: get_double_click FOR EVENT double_click OF cl_gui_alv_grid IMPORTING row
SENDER.
ENDCLASS.
DATA: event_handler TYPE REF TO lcl_event_handler.
CLASS lcl_event_handler IMPLEMENTATION.
METHOD get_double_click
if sender = alv_grid1.
do something...
elseif sender = alv_grid2.
...
endif.
ENDMETHOD.
ENDCLASS.
regards,
Alejandro
2006 Jun 29 5:26 PM
By the way,
Once I have selected a row of the ALV Grid, is it there any way to force an automatic refresh of the full dynpro.
The thing is that when I select the row, the field is not show in the destiny field (an output field) until I press Intro.
Is it there any solution to this?
Cheers.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |