on 11-28-2011 2:06 PM
Hi All,
I am currently working on OVS. For this I created context node in Custom controller with cardinality 1...1 and one input node (0..1) and one output node(0..n) cardinality. I have created all the required methods but still not able to get the help window in my view.
Please correct me if i wrote something wrong in my code. Earlier responses would be much appreciated.
View Controller code:
public void wdDoInit()
{
//@@begin wdDoInit()
try {
Z070_Hr_Mss_Ws_Substitute_Input inp1 = new Z070_Hr_Mss_Ws_Substitute_Input();
wdContext.nodeZ070_Hr_Mss_Ws_Substitute_Input().bind(inp1);
wdContext.currentContextElement().setDWS_Visisbility(WDVisibility.NONE);
wdContext.currentContextElement().setWSR_Visisbility(WDVisibility.NONE);
wdContext.currentContextElement().setEmp_Group_Visisbility(WDVisibility.NONE);
//wdContext.currentContextElement().setReadOnly(true);
wdContext.currentZ070_Hr_Mss_Ws_Insert_Wsr_InputElement().setZeity("1");
wdContext.currentZ070_Hr_Mss_Ws_Insert_Wsr_InputElement().setMofid("SE");
wdContext.currentZ070_Hr_Mss_Ws_Insert_Wsr_InputElement().setMosid("23");
IWDAttributeInfo[] ovsStartUpAttributes = { wdContext.nodeZ070_Hr_Mss_Ws_Substitute_Input01().getNodeInfo().getAttribute("Tprog")/,wdContext.nodeIt_T508A_out_search().getNodeInfo().getAttribute("Schkz"),wdContext.nodeIt_Ename_out_search().getNodeInfo().getAttribute("Nachn")/};
IWDOVSContextNotificationListener listener = wdThis.wdGetOVSCustController().getOVSListener();
WDValueServices.addOVSExtension("Tprog", // not used yet "Schkz","Nachn"
// fields bound to startup attributes will be OVS-enabled
ovsStartUpAttributes, wdThis.wdGetOVSCustController().getOVSInputNode(), wdThis.wdGetOVSCustController().getOVSOutputNode(),listener);
}catch(Exception e){
//wdComponentAPI.getMessageManager().reportException("No Records Found", true);
}
//@@end
}
Custom Controller code
public void wdDoInit()
{
//@@begin wdDoInit()
Z070_Hr_Mss_Ws_Substitute_Input inp2 = new Z070_Hr_Mss_Ws_Substitute_Input();
wdContext.nodeZ070_Hr_Mss_Ws_Substitute_Input().bind(inp2);
//@@end
}
public com.sap.tc.webdynpro.progmodel.api.IWDOVSContextNotificationListener getOVSListener( )
{
//@@begin getOVSListener()
return ovsListener;
//@@end
}
public com.sap.tc.webdynpro.progmodel.api.IWDNode getOVSInputNode( )
{
//@@begin getOVSInputNode()
return wdContext.nodeZ070_Hr_Mss_Ws_Substitute_Input01();
//@@end
}
public com.sap.tc.webdynpro.progmodel.api.IWDNode getOVSOutputNode( )
{
//@@begin getOVSOutputNode()
return wdContext.nodeOutputOvs();
//@@end
}
//@@begin others
/* Implement IWDOVSContextNotificationListener as inner class of
custom controller OVSCust. */
private class OVSDemoContextNotificationListener implements IWDOVSContextNotificationListener {
/* @see com.sap.tc.webdynpro.progmodel.api
)
.IWDOVSContextNotificationListener#onQuery(... */
public void onQuery(IWDNodeElement queryInputNodeElement, IWDNode queryOutputNode) {
IPublicOVSCust.IZ070_Hr_Mss_Ws_Substitute_InputElement ovsInput = (IPublicOVSCust.IZ070_Hr_Mss_Ws_Substitute_InputElement) queryInputNodeElement;
IPublicOVSCust.IOutput_perNode ovsOutput = (IPublicOVSCust.IOutput_perNode) queryOutputNode;
try {
ovsInput.modelObject().execute();
// invalidate 'Output' model node via a top-down access
// approach
ovsInput.node().getChildNode("Output",0).invalidate();
} catch (Exception e) {
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException(e.getLocalizedMessage(), false);
}
}
/* @see com.sap.tc.webdynpro.progmodel.api
.IWDOVSContextNotificationListener#applyResult(...)*/
public void applyResult(IWDNodeElement applicationNodeElement, IWDNodeElement queryOutputNodeElement) {
IPrivateCreateView.IIt_T550A_out_searchElement ovsCallerNodeElement = (IPrivateCreateView.IIt_T550A_out_searchElement) applicationNodeElement;
IPublicOVSCust.IOutputOvsElement output = (IPublicOVSCust.IOutputOvsElement) queryOutputNodeElement;
ovsCallerNodeElement.setTprog(output.getTprog());
ovsCallerNodeElement.setTtext(output.getTtext());
ovsCallerNodeElement.setSollz(output.getSollz());
}
/* @see com.sap.tc.webdynpro.progmodel.api
.IWOVSC
DontextNotificationListener#applyInputValues(...) */
public void applyInputValues(IWDNodeElement applicationNodeElement, IWDNodeElement queryInputNodeElement) {
Object initialValue = applicationNodeElement.getAttributeValue("Tprog");
queryInputNodeElement.setAttributeValue("Tprog", initialValue);
}
}
private IWDOVSContextNotificationListener ovsListener = new OVSDemoContextNotificationListener();
//@@end
}
Thanks & Regards
Uday Kanike
Hi Uday,
Try the following document about how to use OVS:
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/cf40cf90-0201-0010-4a85-e5a207b900d8
I have tried it and it is working fine.
Hope this will be helpful.
Regards,
Jithin
Edited by: Jason Lax on Dec 27, 2011 5:20 PM (Updated URL to correct format)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
also i would like to know how could i create a OVS input node with same name as my RFC.
//@@end public void wdDoInit() {
//@@begin wdDoInit()
Bapi_Flight_Getlist_Input bapiInput = new Bapi_Flight_Getlist_Input();
wdContext.nodeBapi_Flight_Getlist_Input().bind(bapiInput);
//@@end
}
In the above code, is it referring to RFC or OVS input node.
I can't even understand this below lines of code as to what it is referring to
IPublicOVSCust.IBapi_Flight_Getlist_InputElement ovsInput =
(IPublicOVSCust.IBapi_Flight_Getlist_InputElement)
queryInputNodeElement;
IPublicOVSCust.IFlight_ListNode ovsOutput = (
I
PublicOVSCust.IFlight_ListNode) queryOutputNode; try {
ovsInput.modelObject().execute();
// invalidate 'Output' model node via a top-down access
// approach
ovsInput.node().getChildNode("Output",0).invalidate();
Please help me understand
Hi All,
I could now be able to enable the input field with OVS and even the table is visible using the following code. but some how the triggering of RFC is not happening coz i am getting empty table.
Can someone help me rectify this issue, Please????
public void onQuery(IWDNodeElement queryInputNodeElement, IWDNode queryOutputNode)
{
IPublicOVSCust.IZ070_Hr_Mss_Ws_Substitute_InputElement ovsInput = (IPublicOVSCust.IZ070_Hr_Mss_Ws_Substitute_InputElement) queryInputNodeElement;
IPublicOVSCust.IIt_T550A_out_searchNode ovsOutput = (IPublicOVSCust.IIt_T550A_out_searchNode) queryOutputNode;
try {
//ovsInput.modelObject().execute();
wdThis.wdGetWSCompController().executeZ070_Hr_Mss_Ws_Substitute_Input();
wdContext.currentOutputOvsElement().setTprog(wdContext.currentIt_T550A_out_searchElement().getTprog());
wdContext.currentOutputOvsElement().setTtext(wdContext.currentIt_T550A_out_searchElement().getTtext());
wdContext.currentOutputOvsElement().setSollz(wdContext.currentIt_T550A_out_searchElement().getSollz());
wdContext.currentOutputOvsElement().setSobeg(wdContext.currentIt_T550A_out_searchElement().getSobeg());
wdContext.currentOutputOvsElement().setSoend(wdContext.currentIt_T550A_out_searchElement().getSoend());
// invalidate 'Output' model node via a top-down access
// approach
//ovsInput.node().getChildNode("Output_search",0).invalidate();
}
public void applyResult(IWDNodeElement applicationNodeElement, IWDNodeElement queryOutputNodeElement)
{
IPrivateCreateView.IContextElement ovsCallerNodeElement = (IPrivateCreateView.IContextElement) applicationNodeElement;
IPublicOVSCust.IOutputOvsElement output = (IPublicOVSCust.IOutputOvsElement) queryOutputNodeElement;
ovsCallerNodeElement.setDWS_Tporg(output.getTprog());
ovsCallerNodeElement.setDWS_Ttext(output.getTtext());
ovsCallerNodeElement.setPlanned_hrs(output.getSollz());
ovsCallerNodeElement.setStart_time(output.getSobeg());
ovsCallerNodeElement.setEnd_time(output.getSoend());
}
public void applyInputValues(IWDNodeElement applicationNodeElement, IWDNodeElement queryInputNodeElement)
{
Object initialValue = applicationNodeElement.getAttributeValue(" ");
queryInputNodeElement.setAttributeValue(" ", initialValue);
}
}
Thanks & Regards
Hi All,
When I wrote the above code, I am getting this below error when i click on "Go" button in the OVS popup, though I could able to see the OVS help enabled to input field.
java.lang.ClassCastException: com.se.abb.workschedule.wdp.IPublicOVSCust$IOutputOvsNode incompatible with com.se.abb.workschedule.wdp.IPublicOVSCust$IIt_T550A_out_searchNode
Please suggest me the causes for this error
Thanks & Regards
Uday Kanike
Hi udhay ,
your on query code is not that clear to me , so please make it much clear if you have diire need u can call me to this number 9845502647 ,
but ill make your doubts clear to the far best of my knowldge
see in on query method
1. u have to just execute the rfc that is call the method in comp controller that is executing the rfc
2. now invalidate the OVS output node and then copy the values from the rfc local node to the OVS output node
and in the apply result method.
assuming you have five input values in the screen.
in the OVS output node also you have Five attributes , therefore obviously in the OVS pop up five columns with corresponding attributes wil be coming.
now if the OVS POP up table is filled with values select any particular row, on selecting that apply result method will be called and in this method just set the values to the corresponding five input values as shown
wdContext.currentChn_I_CreateCall_DetailsElement().setAsc_Code(wdContext.currentServiceReq_OutputElement().getAsc_Code());
wdContext.currentChn_I_CreateCall_DetailsElement().setSreq_Num(wdContext.currentServiceReq_OutputElement().getSreq_Num());
wdContext.currentChn_I_CreateCall_DetailsElement().setModel_Num(wdContext.currentServiceReq_OutputElement().getModel_Num());
wdContext.currentChn_I_CreateCall_DetailsElement().setSerial1(wdContext.currentServiceReq_OutputElement().getSerial1());
wdContext.currentChn_I_CreateCall_DetailsElement().setSerial2(wdContext.currentServiceReq_OutputElement().getSerial2());
here the
ServiceReq_OutputElement
is the ovs output node and
Chn_I_CreateCall_DetailsElement
is the node whose attirbutes are bound to the input feilds in the screen.
hope u under stood.
sorry for late reply
have any further doubts feel free to ASK
Hi govardanraj ,
Thanks for your detailed response. I could actually be able to get that OVS pop up with five columns. But I could not find values being populated. Please find my OVS onquery code where i am executing my RFC and binding the Rfc node values to OVS out put node.
wdThis.wdGetWSCompController().executeZ070_Hr_Mss_Ws_Substitute_Input(); (This is my RFC)
for(int m=0; m<wdContext.nodeIt_T550A_out_search().size();m++)
{
wdContext.currentOutputOvsElement().setTprog(wdContext.nodeIt_T550A_out_search().getElementAt(m).getAttributeValue("Tprog").toString());
wdComponentAPI.getMessageManager().reportSuccess(""+wdContext.nodeIt_T550A_out_search().getElementAt(m).getAttributeValue("Tprog").toString());
wdContext.currentOutputOvsElement().setTtext(wdContext.nodeIt_T550A_out_search().getElementAt(m).getAttributeValue("Ttext").toString());
wdContext.currentOutputOvsElement().setSollz(wdContext.currentIt_T550A_out_searchElement().getSollz());
wdContext.currentOutputOvsElement().setSobeg(wdContext.currentIt_T550A_out_searchElement().getSobeg());
wdContext.currentOutputOvsElement().setSoend(wdContext.currentIt_T550A_out_searchElement().getSoend());
}
Thanks
Uday
Hi All,
I feel myself that the above code is bit cumbersome. All I want to ask is whether I need to create Context node in view controller as well similar to custom controller or I can use the custom controller code refrence in view controller. And when and where I would be calling the Search RFC and in which controller, so that I get my input field populated with values.
Please, someone clarify these doubts.
Thanks
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Uday
for getting OVS in the screen , f
1. create an OVS_INPUT node of cardinality 1..1
2.Create an OVS_OUTPUT node of cardinality 0..n
these two nodes should be in component controller, and now write a OVS class in the component controller under "begin others " section.
i Hope you know the class that is it implement iwdovscontextnotifcationlistner and has three methods which are as follow
1.apply input value(iwd node)
{
in this method set the values to OVS_INPUT node .
}
2.On query(.....)
{
here set the vvalues from OVS_INPUT node to the RFC input nodes .
now execute the RFC and fetech the output vaules
copy the values from the rfc loacal node to the OVS_OUTPUT node.
}
3.Apply Result(..)
{
in this method set the input field for which ovs is done with current value of the OVS_OUTPUT node.
}
after doing all above methods in the comp controller now go to the view and do this following code in the doint section
of the view
IWDAttributeInfo[] Cityinfo = {wdContext.nodeServiceList_Input().getNodeInfo().getAttribute(IPrivateServiceListView.IServiceList_InputElement.I__SREQ__CITY)};
IWDOVSContextNotificationListener citylistner = wdThis.wdGetVcServListCompController().CityF4();
WDValueServices.addOVSExtension("OVS",Cityinfo,wdThis.wdGetVcServListCompController().wdGetContext().nodeCityF4_Input(),wdThis.wdGetVcServListCompController().wdGetContext().nodeCityF4_Output(),citylistner);
hope you can uderstand this code .......if any doubt futher please ask will get back i have just breifly explained the outline to you of how to implement the ovs thinking that u some knowldge about ovs .......
Hi govardanraj,
Thanks for your help. It reply has answered many of my questions.
But in my scenario, my ABAPer has written RFC in such a way that it does not take any import parameters from portal and it can simply be executed to return values in output node. Now tell me in my scenario, how to solve this problem.
In my case, I have to bind input field to return all the values from database in the form of table and when i select a row from it, it will fill other 5 input fiels with values. So, in my case i am not passing any input value.
Early response would be much appreciated.
Thanks & Regards
Uday
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.