Skip to Content
May 05, 2010 at 02:29 PM

ON_DATA_CHECK event for data validation in ALV


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?


Tom Peng