cancel
Showing results for 
Search instead for 
Did you mean: 

Q: How to Passthe data between 2 I view Or Independant WD component s

Former Member
0 Kudos

Hi masters ,

I have the Following requirement ,.

I have one Web dynpro Component 'A' which is embeded in I-view in the Portal . I also have one more Wd Component 'B' which has to display data depending on the actions performed in Component A. The data that is be diplayed on B has to be passed from 'A' . Please let me know how i can pass the data from A to B .

NOTE : Both A & B are positioned on Portal in such a way that both will be diaplayed all the time and Only B values have to change on Some action of A .

Please let me know how can go about passing the data during the run time from A to B /

Thanks in advance

patil

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Try sharing the context node of one component in other..

You can mark the context node as Interface Node, in properties of Context Node.

And then map this node into another components context node. Whenever values are changed in any of the component context, its reflected in all the components...so you can read the context.

Hope it works.

Former Member
0 Kudos

Thanks For the Quick reply . When i make the component Context as interface . Component B dumps as it says no mapping ,.. As Component A & B loaded at the same time on the Portal in 2 diff I-views . When i run the Component B individually .. the component Dumps Saying mapping is Not been Completed.

And depending on the value change in the Component 'A' B' component Context Should get populated ..

I am able to do that with interface method . Some how the view is not getting refreshed to show the values //

Please assist ..

Patil

Former Member
0 Kudos

Hi Patil,

There are multiple ways to communicate between different components. The most simple way is to use Component Usages.

Lets say Component A uses Component B.

1. Set the Component Usage in the Component Controller of Component A.

2. Create a so called 'interface' method (check the Interface checkbox behind the method name!)

You are now able to call the interface method of Component B from Component A using the following Code, or use the wizard.

  data: l_ref_cmp_usage type ref to if_wd_component_usage.
  data: l_ref_interfacecontroller type ref to ziwci__component_b .

  l_ref_cmp_usage = wd_this->wd_cpuse_z_component_b( ).
  if l_ref_cmp_usage->has_active_component( ) is initial.
    l_ref_cmp_usage->create_component( ).
  endif.

  l_ref_interfacecontroller = wd_this->wd_cpifc_z_component_b( ).
  l_ref_interfacecontroller-><method_name>(
    exporting......
  ).

Hope this helps.

Regards.

Former Member
0 Kudos

Dear friend ,

I have used code that you had given me to pass the data to the Component B . it is Excuting correctly. But data that i am passing to the Component "B' is not been reflected . even after binding the data to the component controller Context node .. Is it some thing elase i have to do ..

Kindly assist ...

Thanks in advance

Patil

Former Member
0 Kudos

Hi Folks ,

I was able to solve the above issue with POrtal eventing ..

http://help.sap.com/saphelp_nw70/helpdata/EN/da/f96f4132f15c58e10000000a1550b0/frameset.htm

Thanks &regards

Badari