cancel
Showing results for 
Search instead for 
Did you mean: 

Passing values between two Webdynpro ABAP Components

Former Member
0 Kudos

Hi All,

I have a situation in which one WD component is using another WD component.

Suppose WD Component A is calling WD Component B. Component B is defined under the component usages of Component A.

There is a node, which contains two attributes, under the component controller context of the component A.

When Component A is calling component B, this node, along with its attributes, has to be passed to Component B.

Please help me out to implement this.

Thanks and Regards,

Sayan Ghosh

Accepted Solutions (1)

Accepted Solutions (1)

phanir_mullapudi
Active Participant
0 Kudos

Hi Sayan,

To simplify this, Create a similar Interface Node in Component_B (used component) & then in Component A, declare usage of used controller B in Component Controller A & map the two nodes. so data flows automatically between the node of Comp-A to Component B & vice-versa. This should definitely provide resolution to your issue.

Thanks,

Phani

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all,

I have the same problem discussed in this post, I try to solve it by reading your answer but unfortunately it doesn't work, what I did is:

1. Create an interface controller with the context to share and a method get_node.

2. in comp A e and B I declare the interface controller.

3. In comp A I map the node as Interface node with the ones of Interface controller and implement the method to read it.

4. In Comp B I put following code in orde to read th context:

  DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
  DATA lo_node_detail TYPE REF TO if_wd_context_node.

  lo_cmp_usage =   wd_this->wd_cpuse_cnt_carta( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.

  DATA lo_interfacecontroller TYPE REF TO ziwci_fc_wda_cntcarta .
  lo_interfacecontroller =   wd_this->wd_cpifc_cnt_carta( ).
  lo_interfacecontroller->get_node(
    IMPORTING
      node =   lo_node_detail                         " ref to if_wd_context_node
  ).

Any suggest for me?

Thanks

GN

Former Member
0 Kudos

Hi

Another option could be to store values as an attribute of assistance class.

for both components you can use same assistance class.

This could be the easiest way.

Regards

Manas Dua

Former Member
0 Kudos

Hi Manas,

I understand that we can make use of Assistance Class Attributs making them as STATIC and share this class with both the components.

But then consider the following scenario.

Suppose the possible values of the attribute are 1,2,3.

If one user triggers the parent component and assistance class static attribute gets set as 1. This attribute will be received as 1 from the child component. But if parallely another user sets the assistance class static attribute value to 2, then this will lead to a confusion.

Please correct me if my understanding is wrong.

Thanks and Regards,

Sayan Ghosh

Former Member
0 Kudos

How are you opening this compp B.Are you oepning it in the same as popup or external window..

You can make use of the window parameeters..

Edited by: Lekha on Dec 14, 2009 8:46 PM

Former Member
0 Kudos

Hi Lekha,

Actually Component B has a view, which fetches the results in a tree structure and a ALV output. This output depends on the values passed from Component A. We are displaying these results in a view container UI element in Component A view. This View Container in Comp A view embeds the View(containing the output) of Component B.

I am not using any popup or external window.

I just hope I was able to explain the scenario. Please let me know if you have any questions.

Thanks and Regards,

Sayan Ghosh

Edited by: sayan ghosh on Dec 14, 2009 8:52 PM

Former Member
0 Kudos

Hi Sayan,

You can achieve this by using the interface Controller

Map the Attribute to the interface controller of Component A and from there Map the same attribute to the Component B.

The Attributes interface controller are the only attributes in the component that are visible to the other component. So you can use interface controller for achieving your scenario.

Thanks,

Raju Bonagiri

Former Member
0 Kudos

Hi Raju,

Can you please elaborate this procedure a bit. It would be great if you can provide any pdf or document which shows the stps in details.

Appreciate all the help !!!

Thanks and Regards,

Sayan Ghosh

Former Member
0 Kudos

Hi Sayan,

I can explain the steps.

1.In the interface controller of the component A add the component contoller as the dependency.

2.Map the attribute which you need to pass between component A and Component B

3.In the component B we have added the Component A as child component.

4.Here component A's interface controller is visible.

5.So in the component controller of component B add Interface controller of the Component A and map the Attribute from the Interface controller to the component controller of the Component B.

So the values from the Component A is passed to Component B throug interface controller.

Thanks,

Raju Bonagiri