cancel
Showing results for 
Search instead for 
Did you mean: 

How to process changes in ALV

0 Kudos

Hello everyone,

I would need to process changes from Web Dynpro ALV in the same way as in SAP GUI ALV. There is a even DATA_CHANGED which has parameter

er_data_change

which has three tables


er_data_change->mt_good_cells is
er_data_change->mt_inserted_rows
er_data_change->mt_deleted_rows

Is there some way how to do this in WD ALV?

The reason why I need that is to get exactly the same values which has the user entered into the ALV. Currently, when user enter value "1" as key figure, the ALV returns the value converted in internal format as "1.00".

Thanks in advance for any input,

Tomas

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can use the on_data_check event of the ALV.

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/c8/6c80dbedfe42d1a93f8e6df1d7244a/frameset.htm

The event has importing parameters to provide you with the changed information:

· T_INSERTED_ROWS

Indexes and contents of the rows inserted

· T_DELETED_ROWS

Indexes and contents of the rows deleted

· T_MODIFIED_CELLS

Position and values of cells after the change has been made

· T_ERROR_CELLS

Cells in which errors have occurred

Answers (1)

Answers (1)

saket_abhyankar
Active Participant
0 Kudos

Hi Thomas,

I think there are not such methods to get inserted or deleted rows. But you can get the changes made by user in the context. To achieve this follow the process:

Enable the context change log in the init method of component controller:

DATA: z_context TYPE REF TO if_wd_context.

z_context = wd_context->get_context( ).

z_context->enable_context_change_log( ).

Then call following method in the component controller to get the context changes:

DATA: lt_changes TYPE wdr_context_change_list.

DATA: z_context TYPE REF TO if_wd_context.

z_context = wd_context->get_context( ).

lt_changes = z_context->get_context_change_log( ).

You will get all context changes in the table lt_changes.

Compare these values with the values before context change.

I hope this will help.

Regards,

Saket.