cancel
Showing results for 
Search instead for 
Did you mean: 

get_context_change_log retrieves no changes although turned on

Former Member
0 Kudos

Dear all, Thank you for looking into this issue. We have a complex WD ABAP application with many views, embedded views, etc. In most of the views embedded in the main view we're calling in the wddoinit the context method enable_context_change_log to enable logging of the context changes (to determine if the user made any changes) like this: WDDONIT lr_context = wd_context->get_context( ). lr_context->enable_context_change_log Since this is such a complex application we need to react at any user action so in the method wddobeforeaction we're trying to see if there were changes and we want to set the dirty flag of the portal integration (so that when the user moves from the app in the portal, he still has a chance to save) like this: WDDOBEFOREACTION lr_context = wd_context->get_context( ). lt_changes = lr_context->get_context_change_log( ). if lt_changes is not initial ... etc. When making a change in the UI element attached to the context and trying to move to a different view or to exit the app, the lt_changes is always initial in the case of this one view. If we check in debug the class behind the lr_context, we see that the attribute is_context_change_enabled is set to 'X'. So apparently there are no changes - but the context does contain the new value of the text field. -


What I noticed is that even in the views where this works (because it does work in other views), when calling the context method enable_context_change_log we get (in debug) the exception cx_wdr_rr_exception. After checking some OSS notes like 1397754 WDA: Dump because view usage does not exist 20.10.2009 1415096 WDA: The repository handle is no longer valid 04.12.2009 1420019 WDA: Dump in SAPLWDR_RUNTIME_REPOSITORY I'm starting to be afraid that something happened in development that may have cause several WD problems and it may affect our application. Do you have some opinions about this issue? Do you know how I could find out who throws the mentioned exception? With system debugging I couldn't go deep enough to find out who throws it.

Thank you in advance, Ioan Radulescu, Sr. SAP HR Consultant @ Gavdi DE

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

apologies...my reply was repeated due to some issues

Edited by: Radhika Vadher on Feb 18, 2010 4:06 PM

Former Member
0 Kudos

......

Edited by: Radhika Vadher on Feb 18, 2010 4:05 PM

Former Member
0 Kudos

.....

Edited by: Radhika Vadher on Feb 18, 2010 4:06 PM

Former Member
0 Kudos

Hi,

Please follow this approach,

1. Place the following code in the WDDOINIT method of the Component Controller
" this you have already done
* enable context change log
    data: context type ref to if_wd_context.
    context = wd_context->get_context( ).
    context->enable_context_change_log( ).

2. Create a new method 'GET_CHANGE_LOG' in the Component Controller's Methods Tab

" Create a Returning Parameter 'CHANGES'  type WDR_CONTEXT_CHANGE_LIST 
method get_change_log .
    data: context type ref to if_wd_context.
    context = wd_context->get_context( ).
    changes = context->get_context_change_log( ).
endmethod.


3. Call the above method in WDDOBEFOREACTION as follows

DATA: l_ref_componentcontroller TYPE REF TO ig_componentcontroller .
    DATA: l_changes TYPE wdr_context_change_list.
          
    l_ref_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
    l_changes = l_ref_componentcontroller->get_change_log( ).
 
"  l_changes will contain all the details of the changes made.

Hope this solves your issue.

Best Regards,

Radhika Vadher.

Former Member
0 Kudos

Hi Radhika, Thanks for the quick reply. You're telling me to create a method in the component controller. Wouldn't it check only the component controller context? As I said the application has many views and each has an own context - mostly mapped to the component controller context - which has also own local fields. I am not sure that I would be able to read the local changes, if the method is in the component controller. I will try this as you said but feel free to answer my concerns. Kind regards, Ioan.