cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Clear modified cells for ON_DATA_CHECK

Former Member
0 Kudos

Hi experts

Is there a command to clear the changes trapped in modified cells, called by ON_DATA_CHECK?

This will be useful, if users have made some changes in some ALV cells, but then later on decided to cancel those changes.

Appreciate if you anyone could offer advice.

Thks

Rusyinni

Accepted Solutions (0)

Answers (2)

Answers (2)

ramakrishnappa
Active Contributor
0 Kudos

Hi Rusyinni,

If you need to have details of old values and new values for whole application's context. Its a good to make use of the concept: Context Change Log

Please refer the below document

Context Change Log ( Recording User Entries) - Web Dynpro for ABAP

Here, you can use the method GET_CONTEXT_CHANGE_LOG to get the old value and new value of each attribute of a node in the application

Please refer the standaord component: DEMO_CONTEXT_CHANGES

If we have only few tables/few fields data to be reset then it is better to go ahead with Mr. Kiran's suggestion, we need to have a temporary storage of the original data in the component / view level and we can revert back to original values whenever needed.

Hope this helps you.

Regards,

Rama

former_member184578
Active Contributor
0 Kudos

Hi,

Before ON_DATA_CHECK( which gets the modified data and updates back from ALV to local context), the context will not have the modifed data!. So, In this scenario, we cannot use Context Change Log.

Regards,

Kiran

ramakrishnappa
Active Contributor
0 Kudos

Thats true Kiran,

We will not be having the recent data changes in the local context, but as UNDO button is being created, we can make use of it for whole application, not just for ALV alone.

Regards,

Rama

former_member184578
Active Contributor
0 Kudos

Hi,

Seems there is no method to Undo the changes. Try the below work around:

Let say, you are displaying Flight data in ALV, create an attribute (say gt_flight) of table type in the View . In WDDOINIT method after binding the data to context, set the internal table to the attribute

wd_this->gt_flight = lt_flight.

Now, create a button ( say undo changes), then in on action of undo changes, bind the context node to which ALV is mapped with gt_flight( which contains original/old data ). So that your changes will be undone.

Hope this helps u,

Regards,

Kiran