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: 

ALV REPORT:

Former Member
0 Kudos

Hi Experts,

I got a problem with ALV like this:

I have an ALV grid display. Now, I have to select one row from this grid and

display it through subscreen. My problem is how to read the selected row:

Is there any means:

I am new to ABAP so please tell me simple interactive way, but not in OOPS.

Thanks in advance,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try this

   CALL METHOD grid1->get_current_cell
      IMPORTING
        es_row_id = ws_row_id
        es_col_id = ws_col_id
        es_row_no = lvc_s_roid.

    READ TABLE  <<ITAB>> into <<WORKAREA>> INDEX ws_row_id-index.

Thanks

Pavan

4 REPLIES 4

Former Member
0 Kudos

Try this

   CALL METHOD grid1->get_current_cell
      IMPORTING
        es_row_id = ws_row_id
        es_col_id = ws_col_id
        es_row_no = lvc_s_roid.

    READ TABLE  <<ITAB>> into <<WORKAREA>> INDEX ws_row_id-index.

Thanks

Pavan

Former Member
0 Kudos

I am assuming you are using REUSE_ALV_GRID_DISPLAY. Set a field for selection in the internal table (CBOX for example). In your user_command form you can just do loop at itab where cbox = 'X'.

  • do your stuff

endloop.

If you need more details let me know.

Albert

0 Kudos

Hi Albert,

I have created one field (sel) in my internal table, but the table des not read this

field as marked or 'X'. My internal table has 108 fields and I have created structure

to built fieldcatlog and to populate it. tell me how to read the selected row now?.....

adam_kuziola
Explorer
0 Kudos

Hi,

You should use the method GET_SELECTED_ROWS. This method belongs to object ALV it means you declared (for instance): o_alv type ref to cl_gui_alv_grid

the mathod is called as follow: call method o_alv->GET_SELECTED_ROWS. Use the button "Pretty Printer" then the system put all parameters required to use method.

Regards

Adam