cancel
Showing results for 
Search instead for 
Did you mean: 

On_data_check event

Former Member
0 Kudos

Hi,

I have implemented ON_data_check event for inserted, deleted & modified rows. The tables R_PARAM->T_INSERTED_ROWS,

R_PARAM->T_DELETED_ROWS & R_PARAM->T_MODIFIED_ROWS are getting populated. But I don't know how to get the data which user has entered/deleted/modified. Bcoz I could not find the data in the above mentioned tables.

Pls suggest...

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The data is there. It is in the R_VALUE column of the associated parameter. However this column is generically types as TYPE REF TO DATA. Therefore it needs to be cast into a data type with the specific structure of your context node in order to read the values. If you want to see this for yourself, set a breakpoint in the on_data_check event handler and have a look at the values in the debugger. They will show the assocated acutal type.

you will have to an ASSIGN R_PARAM->T_MODIFIED_ROWS -R_VALUE->* to <wa_struc>.

where <wa_struct> is a field system declared like your actual line type. For instance if your ALV was for SFLIGHT:

field-symbols <wa_struct> type SFLIGHT.

This is done generically so that there can be a fixed interface to the event parameter yet still support any data structure in the ALV.

Former Member
0 Kudos

the error is coming,,,

"T_INSERTED_ROWS" is a table without a header line and therefore has no component called "R_VALUE".

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

My bad for just writting pseudo code. You of course would need to loop at the *ROWS table and the field you would then access is R_VALUE. The general logic however remains unchanged.

Former Member
0 Kudos

could you pls help me with code, i'm stuck...

Thanks

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

What exactly are you "stuck" on? I've given you pretty much the complete code to read these objects already.

Former Member
0 Kudos

Ok, now I m getting the values in r_value, but i have two more question. Even if i use 'Insert Rows', then t_modified_cells rows is getting populated. Is this designed like this? Becuase what i assume is t_modified cells should be populated when we change the value in cell. I think it's like the normal MODIFY sql statement. Pls suggest.

One more thing, in t_modified_cells the values which are getting populated in R_value and r_old_value starts with '->'. Is this normal also?

Pls answer both of my questions

Thanks,

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Is this designed like this?

I would assume so. That approach makes sense to me.

>One more thing, in t_modified_cells the values which are getting populated in R_value and r_old_value starts with '->'. Is this normal also?

You mean in the debugger, right? This is done in the debugger to signify that the are field references (the TYPE REF TO DATA that I explained earlier).

Former Member
0 Kudos

Thanks Thomas, My problem is solved....

Answers (0)