on 05-05-2010 3:29 PM
We have a web dynpro application that contains an ALV grid. We want to validate data that the user enters into this grid (no new rows or deleted rows, changed cells only).
First, we tried to use WDDOBEFOREACTION in the view. This doesn't work because the changes in the grid haven't been written back to the view context yet, so when you retrieve the view context, all you get are the old entries.
Next, we tried to use the ON_DATA_CHECK event from the used ALV component. This seems like the right place to do the checks, but the issue is that the modified entries only show up in R_PARAM->T_MODIFIED_CELLS the first time the user presses ENTER or CHECK. If the user presses ENTER or CHECK a second time, the system figures the cells didn't change, so T_MODIFIED_CELLS is empty, and our checks (which loop through T_MODIFIED_CELLS) don't work.
At the moment, we are using WDDOMODIFYVIEW in the view. At this point, changes in the grid have been written back to the view context, so we can just retrieve the context and do our checks.
Doing the checks in WDDOMODIFYVIEW "feels wrong" because we are validating data in an event intended for view changes. Has anyone come across this issue and used ON_DATA_CHECK successfully?
Thanks,
Tom Peng
Hi
Instead of getting the modified cells data from the parameteres of the event, try to map the Context Node DATA of the ALV Component to the context element of your controller. And on this event handler, try to loop at each element and call the method is_changed_by_client( ) on each element object.
When this is true, try to add this to the context node that you want to use further or set it as attribute at the view level and reuse that in another methods.
Regards,
Chiranjeevi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are saying that the changed data is already updated in the context node of the calling view by the time you get to ON_DATA_CHECK, right? Yes, that is true, and if we write the checks that way, it's exactly the same as how we are doing it in WDDOMODIFYVIEW. Can you see any advantage to doing the checks in ON_DATA_CHECK instead of WDDOMODIFYVIEW?
Thanks,
Tom
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.