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: 

Double click event in same container ( /ico/mo/3c)

Former Member
0 Kudos

Hi,

I have a typical requirement where I have a subscreen which is configured in sales cockpit transaction (/ico/mo_3c).

In the subscreen area I have created one container. In container I have created a grid and displayed the ALV data(Header data).

in the grid I have handled double click event to display the Item data. Item data is displaying properly in the same sub screen area. But on Item data when I double click again the same event (double click event ) is triggering which should not trigger.

Is there any possibilities to handle the event for the initial display.

8 REPLIES 8

huseyindereli
Active Contributor
0 Kudos

Hi,

You can separate event handlers like below ; (Link Different Methods)

SET HANDLER g_event_handler->handle_double_click_h
                                FOR go_alv_head.

  SET HANDLER g_event_handler->handle_double_click_i
                                FOR go_alv_item.

Regards.

0 Kudos

Hi,

I have only one grid. Your answer will be applicable when we have two grids.

0 Kudos

By default there is a implicit import parameter SENDER in the event handler method which is reference to the class which trigerred the event. You can access the public attributes and methods of the class and can easiliy find out the internal table name or any thing which differentiate your item data from header data .

0 Kudos

Hello Vijay,

Did you register the event handler for the specific instance or for [ALL INSTANCES|http://help.sap.com/abapdocu_702/en/abapset_handler_instance.htm#!ABAP_ADDITION_2@2@]?

BR,

Suhas

0 Kudos

Hi ,

If you have one grid , I can suggest you to use a flag. For example ;

gv_current_view = 'H' .   "" Header By Default

When double click event fired ,

if gv_current_view = 'H'.

" Here arrange your frontend to show items
" Set Flag
 gv_current_view = 'I'. "" Item view is active now

else gv_current_view = 'I'.

" Do nothing or whatever

endif.

When go back to header list somwhere , dont forget to set flag for header.

gv_current_view = 'H'.

0 Kudos

HI Dereli ,

Thanks for your suggestion. I think it will be helpfull to solve the problem.

I want to know if there is any other to achive this.

For Example I am explaining the scenario.

I have a Main screen(100) in which I have created sub screen area.

This subscreen area should call the subscreens dynamically.

There are two subscreens 200 & 300.

In subscreen 200 I have displayed VBAK data. I have double clicked on any line, it will trigger double_click event.

From the double_click event I want to call sub screen 300. In screen 300 I will display VBAP data.

If we can achieve this , we can use same container instead of conditions and all.

Thank you.

Bhaskar

0 Kudos

Hi Bhaskar ,

I could not get your specific need , maybe these can help you.

First of all , if you'd like to trigger PAI just after the ALV events , set i_appl_events parameter to X as below. This is important to execute PAI/PBO related tasks.

CREATE OBJECT go_alv
      EXPORTING
        i_parent          = cl_gui_container=>screen0
        i_appl_events     = 'X'
      EXCEPTIONS
        error_cntl_create = 1
        error_cntl_init   = 2
        error_cntl_link   = 3
        error_dp_create   = 4
        OTHERS            = 5.

On the other hand , you can use a grid to display different tables . At runtime , for example when double click event fired you can easily change field catalog and layout using SET_FRONTEND_FIELDCATALOG , SET_FRONTEND_LAYOUT methods. (Don't forget to refresh alv).

Using one handler for more than one instance.

Regards.

Former Member
0 Kudos

HI,

YOU HAVE TO DECLARE A METHOD WITH FOLLOWING SYNTAX THEN YOUR PROBLEM WILL SOLVED.

METHODS: DC FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID IMPORTING E_ROW E_COLUMN.

BR

PAVAN KUMAR.G