cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture if any changes are made in the view

Former Member
0 Kudos

Hi All,

I have a view in which i have around 40 input fields,dropdowns and stuff.

Below i have a button "Next" and "Back".

When the user has entered atleast one field or had changed atleast one field and then presses "Back" then a PopUp

should appear asking if hes sure to navigate.

If he hasnt entered or changed anything then the Pop Up shouldnt be coming..

How to achieve this.

Please guide me through this.

Thanks in advance,

Shravan

Accepted Solutions (1)

Accepted Solutions (1)

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

you have two ways to do this..

first one at attribute level and second one at node level.

you will have a method IS_CLIENT_CHANGED in the class, just like we have READ and SET. IS_CLIENT_CHAGED is one more method availble for checking whether the attribute has changed our not

you will similar method availble in the NODE class, just like we have BIND_TABLE, this is used to check whether the complete node has been changed our not.

IF_WD_CONTEXT_NODE=>IS_CHANGED_BY_CLIENT

IF_WD_CONTEXT_ELEMENT=>IS_CHANGED_BY_CLIENT

Edited by: ssm on Jul 15, 2011 7:09 PM

Answers (2)

Answers (2)

Former Member
0 Kudos

can you please tell me where should I write my code

set_changed_by_client and
is_changed_by_client


I have the same requirement as u.
         .

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

you need to carefully work on this one. as and when the data gets binded the value for IS_CHANGED_BY_CLIENT will be abap_true. so whenever you are coming into the view use SET_CHANGED_BY_CLIENT to abap_false. once the view is displayed and when the user tries to navigate check is_changed_by_client, if the user changed any thing it autom atically turns to ABAP_TRUE and then you can raise the message

Former Member
0 Kudos

Hi

Its working fine but i have a small issue.

when the user entered sum value and clicks Back the popup is being displayed.

When he cancels the popup and undo the changes and then hits "Back" then the popup is again being displayed which is not my requirement.

Can anything be done regarding this.

Please help me out...

Thanks,

Shravan

Edited by: Shravan_Varma on Jul 16, 2011 8:17 AM

Former Member
0 Kudos

Hi Shravan,

I think you can put a check with 'IS INITIAL' or 'IS NOT INITIAL' as same above in attribute level or node level.

When the node value / attribute value is not initial then pop up the error message.

Regards,

Monishakar C

saravanan_narayanan
Active Contributor
0 Kudos

Hello,

when the user cancels the popup you can call the RESET_CHANGED_BY_CLIENT on the context_node.

BR, Saravanan