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: 

ALV Class Double click event

former_member188326
Active Participant
0 Kudos
584

Hi All,

I have created an alv report using alv class. I have handled the double click event in that i am calling transaction using row currenlty selected. But after doing subtotalling the list and then i double click a line it is passing wrong data.

Points are awarded,

Regards,

Bharat Mistry

Message was edited by: Bharat Mistry

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos
141

Hello,

Whenever you double click on the subtotal line, contents of E_ROW-ROWTYPE will not be initial. So, you can check on this basis like,

if E_ROW-ROWTYPE is initial.

  • call other transaction with the row number

else.

message click on the data line.

endif.

Regards,

Naimesh

8 REPLIES 8

naimesh_patel
Active Contributor
0 Kudos
142

Hello,

Whenever you double click on the subtotal line, contents of E_ROW-ROWTYPE will not be initial. So, you can check on this basis like,

if E_ROW-ROWTYPE is initial.

  • call other transaction with the row number

else.

message click on the data line.

endif.

Regards,

Naimesh

0 Kudos
141

Hi Naimesh,

Thanks for your solution.

Is it possible that i can get the content of the particular row?

Regards,

Bharat.

Message was edited by: Bharat Mistry

0 Kudos
141

Hi Bharat,

Read the internal table contents in double click event with e_row-index , then you will get the data of that particular row.

check below code :

  • local class to handle semantic checks

CLASS lcl_event_receiver DEFINITION DEFERRED.

DATA: g_event_receiver TYPE REF TO lcl_event_receiver.

**************************************************************

  • LOCAL CLASS Definition

**************************************************************

*§4.Define and implement event handler to handle event DATA_CHANGED.

*

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.

ENDCLASS.

CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_double_click.

read table gt_outtab index e_row-index into

Regards

Appana

*Reward Points for helpful answers

Message was edited by: L Appana

0 Kudos
141

Hi L Appana

I had done the same way but after doing total and subtotals on the list internal table also gets sorted and so i am not able to fetch the right record from the internal table on the basis of row no. . So is it possible to get the row contents at this time?

Regards,

Bharat Mistry.

Message was edited by: Bharat Mistry

0 Kudos
141

Hi L Appana,

You have spot the problem and it is solved.

Thank you very much.

Provide help in future.

Regards,

Bharat Mistry.

Former Member
0 Kudos
141

Try clearing the parameters E_ROW and E_COLUMN before thatmethod and try

Former Member
0 Kudos
141

Hi,

you can get the content of the row you have selected,

by calling method GET_SELECTED_ROW, this returns you the row number, using this as index read your internal table to get the content.

Regards,

Raghavendra

Former Member
0 Kudos
141

Hi Bharat

Try using the Sort Catalog.

Refer to the following:

http://www.sapfans.com/forums/viewtopic.php?t=17335

http://www.esnips.com/doc/2d953590-e8c5-490c-a607-d1ab7cf517d7/ALV.pdf

Award points if necessary.

Regards

Inder