on 01-07-2013 8:13 PM
Dear Experts,
When i first click a search button. Based on selection, data get populated in the ALV grid. If i am going to press the search button once again, the new data
gets appended with the old data.
But the new data should overwrite a old data, by clearing the old data.
Can someone help me.
Thanks&Regards,
Santhosh
Hi Santosh,
How are you populating the ALV? If you are using node->bind_table, you can specify set_initial_elements to true to replace the table's existing contents. Setting this parameter to false tells the method to append the new items rather than replace them.
node->bind_table(
new_items = lt_data
set_initial_elements = abap_true ).
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Amy,
Thanks for your response.
The mistake i did was i set the initial elements to abap_false.
node->bind_table(
new_items = lt_data
set_initial_elements = abap_false).
So once i set it to abap_true, the problem is resolved.
But can you help me how to clear a ALV grid completely, using some button action.
Because i have a requirement like, After Populating the ALV grid i should clear it using some button action.
Hi Santhosh,
One option is to bind a table whose rows (if any) are initial...
node->bind_table(
new_items = lt_initial_table
set_initial_elements = abap_true).
Another option is to invalidate the node, causing it to be reinitialized, i.e., its supply function will be called again...
node->invalidate( ).
Cheers,
Amy
Hi Santhosh,
How are you binding data to your node?
Set_initial_elements attribute is by default set to abap_true in all relevant methods.
Have you created static mapping between DATA node of ALV and the node of your component controller?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.