cancel
Showing results for 
Search instead for 
Did you mean: 

ALV list table Contents

former_member82844
Participant
0 Kudos

I am trying to figure out how to get to the actual list used when ALV displays the data in the ALV container.

I need access to this list to determine the order of the records so I can correctly match error messages with the line they apply to. Things get messed up when the user sorts or filters the data and the original context table that contains the data is not affected by these actions.

I have been able to find the table contents in debug mode but they are in a protected attribute and I have not found a method that will return the information. I am sure I saw this done somewhere but I cannot remember where.

If anyone has the sequence of calls to get to this data I would appreciate it .

Glenn

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member82844
Participant
0 Kudos

This still did not work. We have worked around it though ...

frank_ruggaber
Explorer
0 Kudos

Hi Glenn!

Just access the context node you bound to the ALV container and for instance

get the elements via

CALL METHOD node_xxx->get_elements
    RECEIVING
      set = elements_xxxx.

These are sorted the way you sorted them within the ALV grid.

Greetings

Frank

former_member82844
Participant
0 Kudos

Thanks Frank, but I had tried that and put the code in again but the table is still in the original sort order so that does not work.

Back to the drawing board....

frank_ruggaber
Explorer
0 Kudos

Hi Glenn!

In my case it worked like that:

1. i filled a context node for the alv data

2. afterwards i called the ->set_data-method of the alv with the context node

3. then the user sorts the alv data within the GUI

4. after the user selects an action i accessed the context node via


    CALL METHOD node_xxx->get_elements
    RECEIVING
      set = elements_xxx.

5. i put these elements into an internal table:


  LOOP AT elements_xxx INTO element_xxx.
    CALL METHOD element_xxx->get_static_attributes
      IMPORTING
        static_attributes = lf_xxx.
    APPEND lf_xxx TO lt_xxx.
  ENDLOOP.

6. now the internal table lt_xxx contains the sorted data

(as the user sorted it in the GUI) of the alv grid

Greetings

Frank