cancel
Showing results for 
Search instead for 
Did you mean: 

Pass values between two views without using Inbound and outbound Plugs in webdynpro

Former Member
0 Kudos

Hi everyone,

I have created two views in component .

i want to pass some values b/w these 2 views without using the plugs .

Is it possible to do like that ,and using component controller ?

can anyone.?

Accepted Solutions (0)

Answers (14)

Answers (14)

Former Member
0 Kudos

Hi Vardhan,

Create a node in the component controller and bind the same node with these two views.

Pass the value for that node in View1 and view2 just read that node, you will get that value.

Regards,

Deepak Singh

Former Member
0 Kudos

Hello Vardhan,

Create your context in component controller first. Then map those in two views so you will get the values in second view.

To call other view without using plug:

create your second view in another window.

On first view on some event (e.g. button event) call that window.

Thanks

Bhagyashree

Former Member
0 Kudos

Hello Vardhan,

You can achieve the same using assistance class.PFB the link for your reference.

http://wiki.sdn.sap.com/wiki/display/WDABAP/Passing+Values+between+Views+using+Assistance+class+in+W....

Thanks

Katrice

Saumitra_MT
Explorer
0 Kudos

Hi Vardhan,

You can make a node or attribute in the context controller of that WebDynpro component, and use it to pass value between two views by copying those nodes or attribute( the parameter) to view controller contexts of the two views you want to use.
However if you want to pass a dynamic generated value you have to use plugs and Firing of outbound plug.

For example:

we have a parameter Flag of type WDY_BOOLEAN, you can pass it as a parameter like:-

WD_THIS->FIRE_OUT_PLUG( Flag = 'X' ) .

Hope you have your answer.

Regards

Saumitra

Former Member
0 Kudos

Hi Vardhan,

You can use Context Mapping feature of Web Dynpro. Folloing are the steps.

  1. Create context nodes/attributes in the component controller
  2. Go to First view ->Context tab. Drag the nodes of component controller displayed on the right side and drop to context of view on the left side.
  3. Go to second view ->Context tab. Drag the nodes of component controller displayed on the right side and drop to context of view on the left side.

What ever data now stored to this context nodes/attributes will automatically flow from one view to second and vice-a-versa.

Regards,

Vikrant

nagarjun_kalletla
Participant
0 Kudos

Hi Vardhan ,

You can Create Context at component controller level as mentioned by the others

Also you can create attributes @ Component controller level and Insert value to  it

This is some thing like declaring Global Variables in ABAP program.

Assign value to the global attribute in your own method .

wd_comp_controller=> name  = 'Vardhan K'.

In the next method you can read the value assigned to that variable vice-verse.

lv_name =  wd_comp_controller=>name .

value of lv_name will be 'Vardhan K'.

Hope this will help you .

NagaPrakashT
Contributor
0 Kudos

Hi Vardhan,

You can do that using Component Controller or Custom controller through context mapping.

Thanks,

Naga

Former Member
0 Kudos

Hi vardhan,

Just create a node at component controller level and add an attribute that you want to pass the value.

Then in the view level just drag and drop that node from component controller to view controller.

In the first view, set the value to that attribute.

Automatically the data will be available in the other view.

matteo_montalto
Contributor
0 Kudos

Lots of alternatives, as others before me have explained.

In the "non webdynpro ABAP" solution, there are also custom singleton classes (with setter/getter() methods in order to get an attribute value), Shared Memory Area and ABAP cluster (argh!!!).

All these solutions works but they're not that "clean" solution ( best over all is - imho - a custom singleton class, but it works only inside a single user's session ).

former_member211591
Contributor
0 Kudos

Hi Vardhan,

there are several ways to do that.

You first need to decide if the values you want to pass will have any binding to an UIElement.

if so, you need to pass the values per a context node.

if not, you don't need to create a context node (but you could).

Using context node:

lets say you want to pass attributes attr1 and attr2.

To be able to use same context node in two different views, you have to create a context node with attributes attr1 and attr2 in the componentcontroller (you have access to the comp-controller from everywhere within the component). (Btw... Alternatively you could create a custom control and use it like the component controller). After creating the node in the componentcontrol you have to map it to the context of both views. Thus every change you make in one view is automatically present in the other ones context.

if you don't need the values for your uielements you have following alternatives:

- you can create attributes in component control. and set and read them with attribute wd_comp_control of your current view.

- or you can create an assistance class with this (public) attributes and set and read them with attribute wd_assist of your current view.

As you see there are several alternatives..

BR

ismail

kutjohn
Active Participant
0 Kudos

Hi Vardhan,

Create context node in both the views of same type.Create a context node in the component controller and bind the context nodes of the views to the component controller.

Now if you make any change in any of the context nodes( View1 or view2 or component controller)

, it will be reflected everywhere.

m_aravindan
Active Participant
0 Kudos

Hi Vardhan,

                  You can use component controller to share data between views.

Have a look into the followings links , which will give you a good idea.

http://saptechnical.com/Tutorials/WebDynproABAP/SimpleApplication/SimpleApp1.htm

http://scn.sap.com/thread/3332057

Regards

Aravindan

amolgupta
Active Contributor
0 Kudos

If the two views are in the same component, you can use context binding with the Component controller to pass values between two views.

Former Member
0 Kudos

You can use the same node for those views and it will pass the values