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: 

Editable ALV Grid - Validate Imported Data from file via DATA_CHANGED Event

Former Member
0 Kudos

I guys, I have a problem validating data when I import from a file. What I'm doing is a kind of utility to load a table from a text file, via the ALV grid. I succeed in loading that file into my editable ALV grid (using OO), but loaded data doesn't goes thru the CHANGED_DATA process... Thanks for helping me.

7 REPLIES 7

Former Member
0 Kudos

The button with which you are uploading the data should be there in the application tool bar in order to trigger the event DATA_CHANGED.

This event trigger when PAI trigger. So make sure that your upload button is there in the application tool bar.

Thanks,

Raj

That's incorrect that "this event triggers when PAI trigger", it may trigger even without PAI, e.g. while the user moves out of an editable cell or press Enter. It depends how the code is done.

Former Member
0 Kudos

Yes, there is a button (not a standard but mine) that I use to import the file data into the grid Internal table. This button triggers a subroutine that parse the file, load the grid internal table, and call a REFRESH_TABLE_DISPLAY method of the grid.

But no data is added to the "change log" of the grid (parameters of the DATA_CHANGED event).

Thanks

0 Kudos

You can get the UCOMM value in E_UCOMM of the event. AN dbased on that, compare the old ITAB and New ITAB values.

May be this has some extra process , but i think helpful.

Pass the Data to a temp. internal table. and compare with this table when ever there is a upload process triggers.

- Raj

Former Member
0 Kudos

But I want the grid to validate the data integrity (check table), and DATA_CHANGED Event subroutine to validate the rest (key duplication). I don't need to compare with a temp table, I just want to have the imported data added to the ER_DATA_CHANGED->MT_MOD_CELLS, ER_DATA_CHANGED->MT_DELETED_ROWS and

ER_DATA_CHANGED->MT_INSERTED_ROWS tables of the CL_ALV_CHANGED_DATA_PROTOCOL object like when you change data manually.

0 Kudos

Do you have any solutions now? I'm encountering the same issue.

javier_alonso
Participant
0 Kudos

As far as I know, data_changed event of ALV Grid is only triggered when the ALV is editable and the user moves between cells or enters values.

If you edit the table content via code, the event is not triggered.