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 make an Object oriented alv respond to double click

alex_georgek
Explorer
0 Kudos

Hi all,

HOw to make an Object oriented alv respond to double click.SAmple code will be helpful.

Thanks in advance,

Alex.

4 REPLIES 4

faisal_altaf2
Active Contributor
0 Kudos

Hi, Alex

Check out => [Search Results|http://forums.sdn.sap.com/search.jspa?threadID=&q=FOREVENTdouble_clickOFcl_gui_alv_grid&objID=&dateRange=all&numResults=30&rankBy=10001]

Hope you will get idea to fulfill your requirements

Thanks and Best Regards,

Faisal

Former Member
0 Kudos

Hi,

1. Create a Control (for Custom and Split Containers only)

2. Instantiate a Container Object (in case of Custom and Split Containers, specify the control which is created by us in Screen painter) CREATE OBJECT

3. Instantiate an Object of the kind of report that has to be displayed (List, Grid or Tree). CREATE OBJECT . Here we need to specify the Parent Container as the so that it sits in that container.

4. Call appropriate methods to display the report on the screen. CALL METHOD ->

DATA : g_dock TYPE REF TO cl_gui_docking_container,

g_split TYPE REF TO cl_gui_easy_splitter_container,

g_cont1 TYPE REF TO cl_gui_container,

g_cont2 TYPE REF TO cl_gui_container,

g_grid1 TYPE REF TO cl_gui_alv_grid,

g_grid2 TYPE REF TO cl_gui_alv_grid.

  • i_mara is an internal table of structure MARA

SELECT * FROM mara INTO TABLE i_mara.

  • i_kna1 is an internal table of structure KNA1

SELECT * FROM kna1 INTO TABLE i_kna1.

  • To create an Object of type Docking Container

CREATE OBJECT g_dock

EXPORTING

side = cl_gui_docking_container=>dock_at_top

extension = 200 .

  • To Create an Object of Type Split Container. Here we can see that the Docking *Container Created above has been used as a parent .

CREATE OBJECT g_split

EXPORTING

parent = g_dock

orientation = 1 .

  • Easy Split container splits one Control into 2 manageable controls, each of them is used * to handle one GUI Container each

g_cont1 = g_split->top_left_container.

g_cont2 = g_split->bottom_right_container.

  • To Create an Object of type Grid . Here we can see that the Left Split Container * Created above has been used as a parent .

CREATE OBJECT g_grid1

EXPORTING

i_parent = g_cont1 .

  • To Create an Object of type Grid . Here we can see that the Right Split Container * Created above has been used as a parent .

CREATE OBJECT g_grid2

EXPORTING

i_parent = g_cont2 .

  • The method of Grid Control Object is used to display the Data.

CALL METHOD g_grid1->set_table_for_first_display

EXPORTING

i_structure_name = 'MARA'

CHANGING

it_outtab = i_mara[] .

  • The method of Grid Control Object is used to display the Data.

CALL METHOD g_grid2->set_table_for_first_display

EXPORTING

i_structure_name = 'KNA1'

CHANGING

it_outtab = i_kna1[] .

Regards

Hari

Former Member
0 Kudos

Hi Alex,

Have a look at the package SLIS. This is huge repository of Object Oriented ALV's with loads of sample codes covering a wide array of various ALV Functionality.

Hope this will help.

Thanks,

Samantak.

ThomasZloch
Active Contributor
0 Kudos

Please search for availabe information before posting.

Thread locked.

Thomas