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 in GET_CURRENT_CELL method in oops ALV GRID

Former Member
0 Likes
1,095

Hi,

I got output records int eh ALV GRID and i have a one push button in the report. When i select any CELL(say 5 row) in ALV GRID and click on this push Button, it should display me the Row number (row number = 5). I have used the GET_CURRENT_CELL. when I execute the report and select one cell (5 row cell )and click on push button, it is giving me the Row number(row number = 5) correctly. Again when i choose the cell (say 8 record)second time, it should display give the row number = 8 but always it is giving me the First row number .

  • Get selected row

PERFORM get_selected_row CHANGING l_sel_row.

FORM get_selected_row CHANGING p_l_sel_row.

DATA: li_sel_row TYPE i, "Selected row

lv_rowid TYPE lvc_s_row.

  • Query which row was selected.

CALL METHOD grid_brr_main->get_current_cell

IMPORTING

e_row = li_sel_row

es_row_id = lv_rowid.

MOVE lv_rowid-index TO p_l_sel_row.

ENDFORM. " get_selected_row

Regards,

Deepthi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
612

Hi,

Probably the data is not getting refreshed.

Please call the following methods.

REFRESH_TABLE_DISPLAY in PBO.

Call this method only if the grid has been created and called once using SET_TABLE_FOR_FIRST_DISPLAY.

As follows:-

If grid is initial.

call method grid-set_table_for_first_display


else

call method grid->REFRESH_TABLE_DISPLAY.

endif.

In the PAI.

call the following method.

grid->CHECK_CHANGED_DATA

So that the data changes are transferred.

Regards,

Ankur Parab

Edited by: Ankur Parab on Jun 4, 2009 5:18 PM

Hi,

I got output records int eh ALV GRID and i have a one push button in the report. When i select any CELL(say 5 row) in ALV GRID and click on this push Button, it should display me the Row number (row number = 5). I have used the GET_CURRENT_CELL. when I execute the report and select one cell (5 row cell )and click on push button, it is giving me the Row number(row number = 5) correctly. Again when i choose the cell (say 8 record)second time, it should display give the row number = 8 but always it is giving me the First row number .

  • Get selected row

PERFORM get_selected_row CHANGING l_sel_row.

FORM get_selected_row CHANGING p_l_sel_row.

DATA: li_sel_row TYPE i, "Selected row

lv_rowid TYPE lvc_s_row.

  • Query which row was selected.

CALL METHOD grid_brr_main->get_current_cell

IMPORTING

e_row = li_sel_row

es_row_id = lv_rowid.

MOVE lv_rowid-index TO p_l_sel_row.

ENDFORM. " get_selected_row

Regards,

Deepthi.

1 REPLY 1
Read only

Former Member
0 Likes
613

Hi,

Probably the data is not getting refreshed.

Please call the following methods.

REFRESH_TABLE_DISPLAY in PBO.

Call this method only if the grid has been created and called once using SET_TABLE_FOR_FIRST_DISPLAY.

As follows:-

If grid is initial.

call method grid-set_table_for_first_display


else

call method grid->REFRESH_TABLE_DISPLAY.

endif.

In the PAI.

call the following method.

grid->CHECK_CHANGED_DATA

So that the data changes are transferred.

Regards,

Ankur Parab

Edited by: Ankur Parab on Jun 4, 2009 5:18 PM