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: 

Selecting and refreshing individual line in ALV grid report

Former Member
0 Kudos

Hi All

I have ALV grid output and 1 user button (POST) in application toolbar.

I want to know which property I should set in ALV grid so that I am able to select a line and POST it and then that line gets removed from ALV output.

I know how to get the ALV report refreshed but I am not sure of how to identify the line which is highlighted by selection and how can we give accroding effect in the internal table which we are displaying.

Amol

3 REPLIES 3

hymavathi_oruganti
Active Contributor
0 Kudos

there are methods in c_gui_alv_grid LIKE get_selected_row etc. check it out. these methods will help u.

by getting the selected row, u can easily refresh it.

Former Member
0 Kudos

Hi

I hear we can use box_fieldname for this. But on forum not getting exact clue on how to use in my requirement.

I'll be selecting a line and after post it should from output table. And table should get refreshed . rs_selfield-REFRESH = 'X' can be used for refreshing table .. but my issue is selecting and getting that line, before refresh.

Amol

Former Member
0 Kudos

Hi Amol,

for selecting a single row we can declare one variable in our internal table with charecter type and in layout we can give this field name as box type. Check the below code.

  
----Data Declaration
DATA: BEGIN OF it_base_data OCCURS 0,
        mark,
        vbeln LIKE vbak-vbeln,    " SALES DOCU NO
      End of it_base_data.

gs_layout-box_fieldname = 'MARK'.

in ALV User Command loop the Internal table where Marx = 'X' and delete that line. and for refresh as U Know Put ps_selfield-refresh = 'X'.

Hope it is helpful,

Rgds,

Mohan.

@Amol: Plz mark Useful Ans.