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: 

How to achieve Dynamic alv data in single docking container?

0 Kudos

hi all,

i am a fresher in abap and i am trying to explore oops alv, now my requirement is i want to display multiple alv grid in a single docking container without using splitter container.

1 ACCEPTED SOLUTION

former_member182550
Active Contributor

You can't. You need a separate container for each Grid. Have a look at the Easy_Splitter class - it's 'easy' to use!

Rich

11 REPLIES 11

former_member182550
Active Contributor

You can't. You need a separate container for each Grid. Have a look at the Easy_Splitter class - it's 'easy' to use!

Rich

0 Kudos

yes this is also a way to achieve this requirement but my question is can i change the alv displayed in docking container dynamically based on user input?

Of course you can!

When you say 'Change' do you mean change the data or change the format and columns displayed ??

The answer to both is 'Yes'.

Rich

Sandra_Rossi
Active Contributor
0 Kudos

Why? Is it because you need to adjust the splitter "SASH" bar depending on the number of lines in the first ALV, or is it just that you don't know how to define a splitter container inside a docking container?

0 Kudos

as i said i am trying to explore. my question is can i modify the alv in docking container based on user input i.e the alv should get replaced with the present one.

Sandra_Rossi
Active Contributor
0 Kudos

yes you can

0 Kudos

but how? how can i switch between 2 alv grids based on user input from main alv?

Sandra_Rossi
Active Contributor
0 Kudos

For instance, just free the main alv, and instantiate a new alv. What did you try?

0 Kudos

thanks for this suggestion, now its working my data is changed dynamically but while switching between 2 alv grids i am getting dump because i am freeing the previous alv so it is not getting the reference object for it.



if grid_inst is not INITIAL.

call method grid_inst->free.

endif.

IF grid_bp is not INITIAL.

call method grid_bp->free.

ENDIF.

Sandra_Rossi
Active Contributor

To switch between 2 alv grids based on user input from main alv, for instance you may free the main alv, and instantiate a new alv.

Remember that if you call the method FREE, the control variable is still instantiated, only the GUI control is freed, so to avoid subsequent CNTL_ERROR short dumps, it's easier to set the control variable to initial (CLEAR/FREE), so that both the control variable and the GUI control are "synchronized", and to check whether the GUI control is present, you may simply test IF control_variable IS BOUND.

If you don't CLEAR/FREE the control variable, another possibility is : if control_variable->is_alive( ) <> cl_gui_control=>state_dead.

thank you..it worked