cancel
Showing results for 
Search instead for 
Did you mean: 

How to judge whether the data in WDA has been edited?

Former Member
0 Kudos

hi~

My request is once the data in WDA have been changed, there will be a message to warn the user when submitting. So how to judge whether the data in tables, inputfields have been edited?

Accepted Solutions (1)

Accepted Solutions (1)

alejandro_bindi
Active Contributor
0 Kudos

You must activate the Context Change Log functionality for that.

Here's SAP help on the subject: http://help.sap.com/saphelp_erp2005/helpdata/en/ae/f95e42ff93c153e10000000a1550b0/content.htm

Basically you call methods wd_context->get_context( ) to get a context (not context node) reference, and using that reference you call enable_context_change_log( ) to activate the logging and later at submitting time you get the changes with get_context_change_log( ).

A search on the subject on this forum will yield a lot of results also.

Come back if you have some more specific doubts.

Regards

Edited by: Alejandro Bindi on Sep 13, 2008 1:36 AM

Made a mistake on the suggested coding.

Answers (1)

Answers (1)

Former Member
0 Kudos

another question:

1. I find that the log have the changes of all the node., but I just want some of them to be logged. How can I control whether the node should be logged?

2. In the case of the node bound to a table, it seems there is no log about the inserting new line or deleting a existing line. And when I selected anthoer line in a table , the log table will have a line data whose old value and new value is something like INITIAL.

alejandro_bindi
Active Contributor
0 Kudos

Unfortunately I'm not able to access the system now to test this, but:

1. I don't think you can do that. I'm not able to test it but I'd say the reference returned by GET_CONTEXT method is the same for any node (so once you enable the logging you do for the whole context). I'm not even sure if you can call it for nodes other than WD_CONTEXT. That said, maybe, instead of calling WD_CONTEXT->GET_CONTEXT( ), you can call this method from any subnodes e.g.:


GR_NODE1 = WD_CONTEXT->GET_CHILD_NODE( 'NODE1' ).
GR_CONTEXT1 = GR_NODE1->GET_CONTEXT( ).
GR_CONTEXT1->ENABLE_CONTEXT_CHANGE_LOG( )
...
GR_NODE2 = WD_CONTEXT->GET_CHILD_NODE( 'NODE2' ).
GR_CONTEXT2 = GR_NODE2->GET_CONTEXT( ).
GR_CONTEXT2->ENABLE_CONTEXT_CHANGE_LOG( )

2. The only cases in which the changes are not logged are the changes done by coding: e.g. changes done using OVS or Freely programmed search helps (in that cases you need to use method ADD_CONTEXT_ATTRIBUTE_CHANGE).

But selection or lead selection changes done by the user over a table should be recorded with no extra coding.

Please read this SAP help:

http://help.sap.com/saphelp_nw04s/helpdata/EN/ae/f95e42ff93c153e10000000a1550b0/content.htm

Also, check the component DEMO_CONTEXT_CHANGES.

Regards