cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Records in WD-ALV Table

Former Member
0 Kudos

Hi,

I have put two buttons (Hide and Show All) on the ALV tool bar to hide certain type of records. I am handling the "Hide" by deleting the unwanted records from the internal table and re-binding the table to the context node. But when i hit "Show All" i am calling the BAPIs again and popultaing the values back to the table. But by doing this i am losing the changes i have made to the records.

Can anyone please advise how to handle this?

Is there is any method to just hide the records from display (but not actually delete from the internal table) and show them back again when required?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi, Aditya Atluri.

This is not difficult.

However, i suggest that, you should load "All" the data FIRST TIME when you execute your WD application using BAPI..

You know, the next time when you execute and call BAPI, it will return complete NEW data, that is why you lose your change data in Context NODE bound to your ALV...

So, every time no matter you HIDE or Show ALL, you need only manipulate the 1st Saved/returned BAPI data(or internal table)..But don't forget: when your hide or show all, you should first apply your CONTEXT NODE's value to this internal table, otherwise you will still lose change..

In addition,

about this requirement, why don't you try to use one Context-attribute which controls the visibility of the record??That means you don't need to Bind the context node when you hide or show all...

Best wishes.

Good luck.

Former Member
0 Kudos

Thanks to both of you for the clue. I could achieve this by having two context nodes one for showall and one for hide.

I have awarded the points.

Former Member
0 Kudos

Aditya,

1) if it is some thing like need to hide some columns on hit of HIDE button and to show all on hit of SHOWALL use visibility options by raising flags.

2) use flags to fliter the fethced data to show or hide based on business requirement instead of going with two contexts which will increase the component load and performance isseus.

place the fetched data into some global internal table and reuse it based on button action which will be very efficient way performance way and best practice way.

good luck!!!!

Regards,

KRanthi.

Former Member
0 Kudos

Aditya,

1) if it is some thing like need to hide some columns on hit of HIDE button and to show all on hit of SHOWALL use visibility options by raising flags.

2) use flags to fliter the fethced data to show or hide based on business requirement instead of going with two contexts which will increase the component load and performance isseus.

place the fetched data into some global internal table and reuse it based on button action which will be very efficient way performance way and best practice way.

good luck!!!!

Regards,

KRanthi.

ChrisPaine
Active Contributor
0 Kudos

Filtering does this sort of behaviour (hides some records but doesn't loose them.)

it does it by having two table - the one displayed and the one with "all" the data.

The problem is you need to modify your "all" table from the changes made to the displayed table.

it isn't really that difficult - especially as you have the context change pointers.

But that's how I'd do it - rather than refresh you data just hold a seperate "all" table which you update with any changes. Potentially you on need to do the update on your "Show All" logic and then repopulate your display table from the all table.