Application Development and Automation 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: 
Read only

ALV OO problem

Former Member
0 Likes
950

I'm using cl_alv_gui to produce ALV output. I have setup a hotspot, and two buttons to allow the user to drill into two other alv reports with data specific to the hotspot.

When you clik on the hotspot, then on the details button, the alv produces correct results. When you click back, and another hotspot, then the details button, the alv produces correct results.

With the other button, the first run produces correct results, but clicking back and choosing another hotspot and clicking the button produces the first results (for the wrong hotspot group).

I have identical code in the alv's:

call method go_custom_container->free

exceptions

cntl_error = 1

cntl_system_error = 2.

call method go_grid->free

exceptions

cntl_error = 1

cntl_system_error = 2.

create object go_custom_container exporting container_name = 'ALV_CONTAINER_HIST'.

create object go_grid exporting i_parent = go_custom_container.

Plus,when I look at the internal table to be displayed, it contains the correct data, but this is not the data displayed...

7 REPLIES 7
Read only

Former Member
0 Likes
861

Where do you attach the data to be displayed? Are you using set_table_for_first_display() each times? Give more details please.

Read only

Former Member
0 Likes
861

CALL METHOD go_grid->set_table_for_first_display

EXPORTING

i_save = 'A'

i_default = 'X'

is_layout = ls_layout

CHANGING

it_outtab = t_hist_output

it_fieldcatalog = lt_fieldcat

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

Where t_hist_output contains the values I want displayed, but the grid always displays the first displayed entries.

Read only

0 Likes
861

Try to use refresh_table_display() after values have been changed in the internal table.

Read only

Former Member
0 Likes
861

I tried the refresh_table_display and it didn't work.

Any other ideas?

Read only

0 Likes
861

Hi Michelle,

try this:

I always put an IF sentence, before to create object. I think, if you don´t do it, maybe cause of problem as you said...

IF go_custom_container IS INITIAL.

create object go_custom_container

exporting container_name = 'ALV_CONTAINER_HIST'.

... code ...

ENDIF.

Hope this help you.

Read only

Former Member
0 Likes
861

I don't think this is the problem, because I am freeing both the container and the grid and recreating them before each display...

Read only

Former Member
0 Likes
861

None of these solutions worked, but as soon as I changed the container name, all is well.