Skip to Content
author's profile photo Former Member
Former Member

ALV REPORT:

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,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Dec 04, 2007 at 03:53 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 03:55 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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?.....

  • Posted on Dec 04, 2007 at 03:56 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.