on 12-20-2006 9:35 AM
Hello
I am having a form with multiple input elements. Presently I tried OVS input help for one input field using one custom controller. If I want to create input help for multiple input fields do I need to create multiple inner classes inside controller?
Thanks in advance.
Regards
Rajeev
Rajeev,
No, it is much simpler then this.
When attaching OVS helper just enumerate attributes as IWDAttributeInfo[] argument.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
Thanks for the replies. I can make the changes to applyInputValues,applyResult and onQuery methods to consider additional fields but by that will everytime I click on the elements it would do a round trip to server for fetching those values?
Is there any way to fetch the values from context selectively? e.g. first query would fetch all the Doc_Types,Sales_Org etc. Now if I enter sales_org value as say 10 it should fetch values such as 101,103 etc from the context.
Thanks in advance.
Regards
Rajeev
Valery,
I can attach IWDAttributeInfo[] as argument but in the methods onQuery can I get the attribute name from which I have triggered this help ? If I click for Document Type is there any method such as getAttributeName so that I could use the same in onQuery or applyResult.
e.g. if attributeName = Doc_type
queryOutputNode.bind(resp.getDoc_type())
else if attributeName = Sales_Org
queryOutputNode.bind(resp.getSales_Org())
Regards
Rajeev
Hi,
OnQuery will be called whenever you press F4.So it is we who should write the logic if we want such kind of functionality.
If we are writing the bapi execution code in onQuery then Bapi will be called all the times.
If you feel that getting complete data is not a problem then get that data in onInit() and in onQuery method filter the data we have and place it in the Queryoutput Node.
I hope this helps and I strongly assume that SAP did not give any option for buffering concept in this kind of calls.
Regards,
Nagaraju Donikena.
Nagaraju,
Exactly thats what I want to do, filter the data. I can get entire data in onInit but in onQuery how should I filter? How can I write that condition in onQuery?
e.g. If I click value help of Doc_Type how can I get its name in onQuery method so that I can add the condition.
Thanks in advance.
Regards
Rajeev
Hi Rajeev,
Get the data inside the output node which is filled in onInit().We can get the input values from the input element.Filter the data depending upon the input we have , use for loop for that.For the data which is satisfying the condition place them in to the QueryOutput node.
IPublic<OVSCUST>.I<node>Node nodeObject = wdContext.Node<node>;
IPublic<OVSCUST>.I<node>Element element = nodeObject.createElement();
// Add the data into the element object.Then
nodeObject.addElement(element);
I strongly hope that this will work but I did not try this though.
Regards,
Nagaraju Donikena.
Nagaraju,
Actually I could not find any node method which returns name of the element and hence I am not getting how should I filter the values in method applyInputValues. e.g. my applicationNode is like
Header
doc_type
sales_org
division
I have added OVSExtension by using IWDAttributeInfo[]. In that case how should I differentiate between each events (event click for doc_type input help, event click for sales_org input help etc) ?
Thanks in advance.
Regards
Rajeev
Rajeev,
onQuery has parameter named element.
public void onQuery(IWDNodeElement queryInputNodeElement,
IWDNode queryOutputNode) {
IPublicOVSCust.IBapi_Flight_Getlist_InputElement ovsInput =
(IPublicOVSCust.IBapi_Flight_Getlist_InputElement)
queryInputNodeElement;
....
}
This is the example code given by SAP.
Input parameters can be got from the import parameter queryInputNodeElement.
Go through the standard help given in
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/5dcbe990-0201-0010-2c99-a2bc9e61acfc">sdn</a>.
Regards,
Nagaraju Donikena.
Nagaraju,
actually I configured the scenario looking at that code itself -:). But over there also they have input help for only 1 field Airlineid while I am having input help for many elements.
The queryInputNode returns me input node of the OVSInputController. What I am looking at is the way to differentiate between two F4 events. In short how I will come to know that the onQuery is fired from Doc_Type-F4 or Sales_Org-F4 help button?
Regards
Rajeev
Rajeev,
If I understood your question correctly, you wanted to know the use of IWDAttributeInfo[] as an array.
The addOVSExtension method expects the set of the attributes, that should be marked as startup attributes and to show the fields bound to these attributes with an ovs button. So, you just have to <i><b>enumerate</b></i> the required attributes to the IWDAttribueInfo[] argument.
Bala
Bala,
The thread which you forwarded was helpful for me and the problem was exactly similar which I faced. Also the solution is perfect.
Actually I enumerated to add OVSExtension to multiple fields and it was added successfully. But then I could not pass the value to the constructor of the listener class (which in this case would behave like a generic class) and hence in applyInputValues values it becomes difficult to know from which input help we have called the OVS listener.
Thanks for your help.
Regards
Rajeev
Hi Rajiv,
By now I hope you got the solution.
As per current forum thread OVS for multiple fields can be achieved in two ways by attaching many field using IWDAttributeInfo[] or creating many instances depending up on the field as given in the other link in this thread.
You can achieve your solution using the second option.
As per my knowledge first option will allow us in such a way that same Bapi will be called whenever you click F4 on any of the related field.But we cannot distinguish which field has triggered F4.
Regards,
Nagaraju Donikena.
Hi,
It is possible to reuse the same custom controller for any number of OVS-enabled fields. But you will have to write the OVS notification listener in generic manner.
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
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.