on 09-16-2008 8:46 AM
Hi,
I have an assignment where I have to pass employee number to the BAPI and get information regarding employee and display at front end.
There is a input field where User enters emp number and press enter. In the onEnter event I wrote code for executing the model and passing emp number as input to the BAPI.
It is working fine for the first time. When User enters another number in the input field and press enter, then the values are not changing. I use the Invalidate() function for refreshing the node. but ! even though I could not get the result.
see the below my code.
public void onActionimplementGO(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionimplementGO(ServerEvent)
String emp = wdContext.currentContextElement().getEmpNumber();
wdContext.currentZhr_Empdata_Get_InputElement().setPernr(emp);
wdContext.clearSelection();
wdContext.invalidate();
wdThis.wdGetPersonalComponentController().executeZhr_Empdata_Get_Input();
wdComponentAPI.getMessageManager().reportSuccess(wdContext.currentOutputElement().getFname());
//@@end
}
please help
thanks
Jyothi
Hi Jyothi,
It seems that your invalidate () method is not getting called properly.
You need to Invalidate () node before excuting the BAPI, then it will
get refershed after hitting the action button every time.
Regards
Anup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jyothi,
You need to invalidate your model node's Output node only after the RFC call is executed. I'm afraid that your Model object is getting fresh data every time but is not being populated in your Model node because invalidation is not being done properly. Try replacing your code with this.
public void onActionimplementGO(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionimplementGO(ServerEvent)
String emp = wdContext.currentContextElement().getEmpNumber();
wdContext.currentZhr_Empdata_Get_InputElement().setPernr(emp);
wdContext.clearSelection();
wdThis.wdGetPersonalComponentController().executeZhr_Empdata_Get_Input();
wdContext.node{model}_Output.invalidate()
wdComponentAPI.getMessageManager().reportSuccess(wdContext.currentOutputElement().getFname());
//@@end
}
Hope this helps.
Vishwas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
comment out the invalidate() call.
simply set the context to null values or "".
you are invalidating the context i.e. destryoying the context object.
regards,
-amol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i think the wrong with ur code is ur invalidating the whole context.
But you have to invalidate the node in which your getting and all the sub nodes in it.
if you could explain me the context structure i could explain yopu the code more in detail .
Thanks & regards,
Lokesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
go to implementation of executeZhr_Empdata_Get_Input() in the component controller
and compare your code with below one.
observe the underline statement.
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
{
wdContext.currentZhr_Empdata_Get_InputElement().modelObject().execute();
// nodeOutput is node belongs to this rfc only.
wdContext.nodeOutput().invalidate();
}
catch(WDDynamicRFCExecuteException e)
{
manager.reportException(e.getMessage(), false);
}
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jyothi
After executing the Bapi method then set the value of the input field to NULL or else make it NULL in the init() method of that view controller.
String emp = wdContext.currentContextElement().getEmpNumber();
wdContext.currentZhr_Empdata_Get_InputElement().setPernr(emp);
wdThis.wdGetPersonalComponentController().executeZhr_Empdata_Get_Input();
wdContext.currentZhr_Empdata_Get_InputElement().setPernr(NULL);
Try this if any queries then reply the post.
Thanks & Regards,
Yusuf.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jyoti,
After executing RFC [ ie. after .....execute() in executeZhr_Empdata_Get_Input() ], add
wdContext.nodeOutput().invalidate(); (Output is the Output node present in Model node) in executeZhr_Empdata_Get_Input() method.
If it is not working, delete
<Bapi..>_Input input=new <Bapi..>_Input();
wdContext.node<Bapi..>_Input().bind(input);
from init of controller and put it inside executeZhr_Empdata_Get_Input() method
Regards,
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.