cancel
Showing results for 
Search instead for 
Did you mean: 

OVS Value help for multiple elements

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Rajeev,

No, it is much simpler then this.

When attaching OVS helper just enumerate attributes as IWDAttributeInfo[] argument.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Rajeev,

Also change the code inside applyInputValues,applyResult and onQuery accordingly if the data entered inside the other text fields should be considered when filling the model.

Regards,

Nagaraju Donikena.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Rajeev,

Refer Bertram's for this problem.

Bala

Former Member
0 Kudos

Bala,

actually thats what I want. but if we implement IWDAttributeInfo[] for each element, one question remains, whats the use of IWDAttributeInfo[] as an array if for multiple elements it is required to create IWDAttributeInfo[]

Thanks for redirecting me to proper thread.

Regards

Rajeev

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

Former Member
0 Kudos

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.