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: 

Get selected rows

Former Member
0 Kudos

Hi Experts,

Get selected rows in ALV oops doesn't work for the second time for the same object.

Can any one suggest, how can retrieve values using this method for multiple times.

Regards

RP.

1 ACCEPTED SOLUTION

awin_prabhu
Active Contributor
0 Kudos

Hi,

I think every time when selecting rows u are creating a new reference to grid .

Reference to grid has to be created only once

Check whether u have created reference like below.

DATA: g_o_container TYPE REF TO cl_gui_custom_container,

g_f_container TYPE scrfname VALUE 'G_CONTAINER_ALV', " Custom control name in screen painter

g_o_grid TYPE REF TO cl_gui_alv_grid.

IF g_o_container IS INITIAL.

CREATE OBJECT g_o_container

EXPORTING

container_name = g_f_container.

IF g_o_grid IS INITIAL.

CREATE OBJECT g_o_grid

EXPORTING

i_parent = g_o_container.

ENDIF.

ENDIF.

Thanks

Edited by: Sap Fan on Oct 28, 2009 4:11 PM

5 REPLIES 5

former_member191735
Active Contributor
0 Kudos

What is this?

Close it first

0 Kudos

Mr Sampath,

If you very much free in just writing comments.

Pls give us a suggestion on this thread ,

Thanks.

Gentle Remainder: We are here to solve the issues but not to comment.

awin_prabhu
Active Contributor
0 Kudos

Hi,

I think every time when selecting rows u are creating a new reference to grid .

Reference to grid has to be created only once

Check whether u have created reference like below.

DATA: g_o_container TYPE REF TO cl_gui_custom_container,

g_f_container TYPE scrfname VALUE 'G_CONTAINER_ALV', " Custom control name in screen painter

g_o_grid TYPE REF TO cl_gui_alv_grid.

IF g_o_container IS INITIAL.

CREATE OBJECT g_o_container

EXPORTING

container_name = g_f_container.

IF g_o_grid IS INITIAL.

CREATE OBJECT g_o_grid

EXPORTING

i_parent = g_o_container.

ENDIF.

ENDIF.

Thanks

Edited by: Sap Fan on Oct 28, 2009 4:11 PM

Former Member
0 Kudos

Hi,

We need to free the objects and then use set selected rows and assign values to it in PBO, which were retrieved using get selected rows earlier in PAI.

Thats it...it works fine now..

Issue is resolved.

Regards

RP.

Former Member
0 Kudos

Hai Mr. RP Reddy,

Could you pls post the code, how you got the get selected rows issue rectified for multifple times triggering.

I am also facing the same problem in my requirement. i await your quick reply.

Thanks & Regards,

Rajesh.K