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 all rows of alv grid

Former Member
0 Kudos
2,124

Hi gurus,

i have the following question for u.

I have to read all rows of alv grid(OOP progamming) without read internal table. At point that i have to read this rows the internal table and table of alv grid didn't match and i cant do refresh.

The only way to read a rows by oop is the method get_selected_rows but i ve to read all rows not only selected ones.

THANKS!!!!

3 REPLIES 3

Former Member
0 Kudos
274

Hi Michele,

check the program BCALV_EDIT_05

call method g_grid->set_table_for_first_display

exporting it_toolbar_excluding = lt_exclude

changing it_fieldcatalog = pt_fieldcat

it_outtab = pt_outtab.

  • Set editable cells to ready for input initially

CALL METHOD g_grid->set_ready_for_input

EXPORTING

I_READY_FOR_INPUT = 1.

clear lt_f4.

lt_f4-fieldname = 'WUNIT'.

lt_f4-register = 'X'.

append lt_f4.

See this link

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a41...

<b>Kindly Reward points if you found the reply usefull</b>.

Cheers,

Chaitanya.

former_member199581
Active Participant
0 Kudos
274

Hi Michele,

I think that the best way it's to save a copy of your table before the ALV Display...then re-call back before refreshing.

The only way to access the full content of the table passed to cl_gui_alv_grid is the attribute MT_OUTTAB, but unfotunately this is Protected.

So, twice solution:

- You use method SET_SELECTED_ROWS and select all rows then call GET_SELECTED_ROWS

- You save your table in the program

Try this:


DATA: local_outtab TYPE REF TO DATA.
FIELD-SYMBOLS: <original_table_to_display> TYPE TABLE.

GET REFERENCE OF your_table_to_display INTO local_outtab.

"...call the grid
"...do your things
"...recall back your original table

ASSIGN local_outtab->* TO <original_table_to_display>.

"...compare as you want or refresh using the field-symbol

I hope I understood well.

If not, please try explain again the problem for me...

Former Member
0 Kudos
274

you can do this..

store the values of internal table (referring fieldcatalog) in some other internal table.

then use this method.

if rg is not initial.

call method rg->check_changed data.

endif.

rg is reference to grid.

this time ur internal table contains new values and then u can compare this internal table with the stored internal table.