CRM and CX Blogs by Members
Find insights on SAP customer relationship management and customer experience products in blog posts from community members. Post your own perspective today!
cancel
Showing results for 
Search instead for 
Did you mean: 
MikeB
Contributor
0 Kudos
Sometimes we need to supply a single value synchronization of specific parameter between different separated components of CRM. Of course, there is a way to implement such task via binding, but if we are talking about synchronization of only one single value, this way may be too complicated. Here is an approach to do that much more easily.

Implementation in WD_USAGE_INITIALIZE( ):

  1. " define implementation class of component, which we want to link

  2. sync_win TYPE REF TO %comp_class_impl%.

  3. usage_ref TYPE REF TO cl_bsp_wd_component_usage.


  4. CASE iv_usage->usage_name.

  5.         " define synchronization only for specific usage

  6.         WHEN '%name%'.

  7.                 usage_ref ?= iv_usage.

  8.                 " define MainWindow of component, which we want to link

  9.                 sync_win ?= usage_ref=>get_interface_view_contr( '%COMP_NAME/Window_Name%' ).


  10. " link specific attribute of current class to specific attribute of desired component class

  11. GET REFERENCE OF me->flag INTO sync_win->flag.



I suggest to use this approach very carefully, because active use of such technique may lead to some side effects, e.g., spaghetti code, where it's very difficult to understand what, when, and where is connected with external components.
1 Comment