on 04-04-2011 1:28 PM
Dear Experts
I tried to pass a value from one view to another view using plugs i follwed the steps given in the Wiki
but in the second view in the articel it has been specified that i we have to get the value in the event handler handlefromsearch.
I cant understand this, if we get the value here how we will pass it to wddoinit method because in doinit only we can use this variable to show to do processing etc.
Kindly guide me how to get the value in doint method by using the plugs method.
Regards
Kumar
Hi,
In Outbound Plug tab you can see Parameter field in second table, which is in first view. In that Parameter field you can create a Parameter(for example IV_EMP_ID with Associated type as PERNR_D) for this Outbound Plug.
then you should go to second view Inbound Plug Tab and go to corresponding Inbound Plug even handler method. In this even handler Inbound plug method just add same field earlier you added in Outbound plug tab as a importing parameter .
you can pass this value into outbound plug like below code.
wd_this->fire_to_output_plg(
iv_emp_id = '0000001' " pernr_d
).
Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
To pass data from one view to another, better create context in component controller data will move automatically
from one view.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Experts,
Thank You for the replies.
But when i keep debugger it is not coming into handle method where im getting the parameter from first view.
i refered this [wiki|http://wiki.sdn.sap.com/wiki/display/WDABAP/Passingtableparameterfromoneviewtoanotherview+locally]
Kindly guide me in solving this issue.
Thank You
Kumar
Hi,
If you wanna use parameters of the Plugs to pass the value between the views, it can be achieved by below steps.
1. Create the parameters in the outbound plug of the first view. In the outbound plugs tab, at the bottom you will find the place to declare the parameters.
2. while calling the plug, pass the value for the parameter like this. wd_this->fire_sal_plg( sal_det = ls_sal ).
3. In the 2nd view, in the handle method of the inbound plug, create the parameter with same type of which you have created in the outbound plug. Now this parameter will have the value which you passed from the first view.
Hope it helps.
Regards,
Prabhuraj
Hi Kissnas,
Im aware of passing a value or parameter through component controller but i want to pass the value through plugs.
Hi Prabhu,
im geting the variable in Handle event then how can i pass it with in hook methods ie if im passing a employee id 101 from view1 and i need to show the details of the employee 101 in second view for that i will send the value 101 from the first view to second view and in doinit or in modify view i will write query to retrive.
but in handle event how can i do this?
Regards,
Kumar
You can do the same in handler method wtever you are doing in wddoinit ..
whether its writing query or something elese.
if you want to pass it to the wddoinit method.
make an attribute for the view.
attirbute tab will be there. create an attribute say name empid type string.
then you can refer to it by using wd_this->empid.
it will be available as a global variable in all the methods of the view.
thanks
sarbjeet singh
HI,
To make the value passed from the plugs available to hook methods of the second view, create a view attribute of similar type and set the value to this attribute in the Handler..
Somthing like this
wd_this->my_attribute = value_plugs.
This can be then accessed in WDDOMODIFY view hook method..
Thanks,
aditya.
>Im aware of passing a value or parameter through component controller but i want to pass the value through plugs.
I'm curious why. Mapping via component controller is quite efficient. There is only one set of data stored and all mappings are done as data/object references. There really is little to no performance benefit to passing via plugs.
Hi ,
There are three basic ways of passing data from one view to another.
1) Context Mapping -> the simplest way , only one memory location defined for that attribute, so also an efficient way
2) Data passing using Assistance class -> just another way , also an efficient way since only one memory location defined for assistance class attribute
3) Data passing using Plug parameters -> Not the best of ways , since every time you navigate a new temporary variable is created , so wastage of memory.
So as Thomas Suggested , use the first way , Context mapping.
Regards,
Ashish Shah
Hi,
You need to change your approach.
WDDOINIT is a hook method called by framework at only one time during the lifetime of the view.
Plug handlers are called whenever you navigate from outbound to inbound plug.
If your code absolutely need to execute on doinit method then do it on the wddomodifyview method checking the parameter first time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI learner,
You retrieve it in the handler and then you can store it in an attribute of your assist class or in your context depending on for what purpose you want to use it.
Regards,
Mathieu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.