Application Development and Automation 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: 
Read only

Problem with Method GET SELECTED ROWS

Former Member
0 Likes
2,695

Hello,

I'am expiriencing a strange problem:

I'am using ALV Grid on a normal dynpro.

The User can mark on ore more rows for a jump to another dynpro.

Problem as follows: when no row is marked, I make sure that a message is raised:

FORM GET_SELECTED_ROWS.

...

CLEAR: LT_ROWS, <A>, <B>.

CALL METHOD G_ALV_GRID->GET_SELECTED_ROWS

IMPORTING ET_INDEX_ROWS = LT_ROWS.

DESCRIBE TABLE LT_ROWS.

CASE SY-TFILL.

WHEN 0.

MESSAGE S398(00) WITH 'Please mark a row'.

G_EXIT = 'X'. "don't go on in PAI dynpro

EXIT.

WHEN OTHERS.

ENDCASE.

...

But when the Error-message is raised, and I mark a row again, the method GET SELECTED ROWS don't bring up any entries in LT_ROW. I already tried the method CL_GUI_CFW=>FLUSH (before and after GET SELECTED ROWS), but nothing ist going on, the internal table is still empty.

What is wrong here?

Greetings

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,759

Hi Maik,

Although this method should be used in case either the data has changed or methods have been used which change the display of grid, I think you should.

Could you please try if this helps?

John.

7 REPLIES 7
Read only

Former Member
0 Likes
1,759

Hi Maik,

Do you use the METHOD refresh_table_display during PBO? Because this sounds like a synchronization problems between the screen and the control on the front end.

Regards,

John.

Read only

0 Likes
1,759

There is an event called 'DATA_CHANGED' which should be handy here. In any case, take a look at this program 'BCALV_TEST_GRID_EDITABLE' and I am sure you will be able to figure out the problem

Read only

0 Likes
1,759

Hi John,

no, I don't use the REFRESH-Method...

should I ?

Regards

Maik

Read only

Former Member
0 Likes
1,759

Was way tangent over there.... That was for the EDIT in ALV section..

THe program you should be looking is BCALV_GRID_05.

Sorry for the mistake.

Let me know if the issue is still there.

Regards,

Subramanian V.

Read only

Former Member
0 Likes
1,760

Hi Maik,

Although this method should be used in case either the data has changed or methods have been used which change the display of grid, I think you should.

Could you please try if this helps?

John.

Read only

0 Likes
1,759

Hi John,

well I'am impressed - what I didn't realised so far was taht every time a new instance of g_alv_grid was created. So i marked a row of g_alv_grid-<359>, but during get_selected_rows it was something like g_alv_grid-<383>.

Thanks you very much.

Regards

Maik

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,759

Hi Maik

It seems you have solved your problem. There are some actions clearing all selection and scrolling info. And since you every time create a new instance or call some method which clears your selections your selections table is lost.

For a screen session, you should use "set_table_for_first_display" for just once and for next PBO triggers you should execute the method "refresh_table_display".

*--Serdar