Skip to Content

OVS is Object Value Selector or an advanced input help.

OVS user interface provides all functionality for entering and executing a search query and copying values of a selected object back to one or more input fields.

There are excellent blogs that have been written on OVS, EVS and SVS for Java Webdynpro.

http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interfacetechnology/wd%20java/wdjava%20archive/web%20dynpro%20valuehelp%20using%20object%20value%20selector.pdf

http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e038cf90-0201-0010-0a9a-ec69262a1564 – By Bertram Ganz

In this blog I would only be showing how OVS is created in Netweaver Mobile 7.1. Please read the above blog for the basics of how the OVS works technically.

The tutorial how to create a mobile application for laptops is available on:

http://help.sap.com/saphelp_nwmobile71/helpdata/en/8F/0B674240449C60E10000000A1550B0/frameset.htm

Example Scenario:

When you create a sales document the information about the customer is copied from the customer master record. Thus in this tutorial an OVS is created on the customer in order to take only those customers present in the customer master.

In order to add an OVS Extension in your application the following needs to be done:

1)      Create mobile application for laptops

2)      Import required models from DOE.

3)      Create queries 

4)      Create a custom controller

5)      Add the OVS extension in the view controller

Assuming you have already done steps 1, 2 and 3.Lets move to the 4th step but before that:

Create queries 

I have created a query called Composite where ZCUSTOMER is the input.

image

I have created a query called SelectQuery where the input is Composite query and the result is CUSTOMER$CUST_ROOT for a particular ZCUSTOMER

image

Create Custom Controller and assign the SelectQuery to the context.

a)     Expand Components Tab=> Right click on Custom Controller=> Choose Create Custom Controller=> Give a name in the box [In this e.g. Ovscust] and choose Finish.

b)     Right Click on the Application name=> choose Data Modeler=> create a link from Model to Custom Controller drag and drop SelectQuery model. Do the same for View to Custom Controller.

c)      Expand Custom Controllers under Components=> Right Click on Ovscust => Open Controller Editor

d)     Click on SelectQuery  and click on the properties tab in the lower panel.

e)     Create a supply function

f)       In the code editor for  supply function write the following code:

SelectQuery q1 = Perfmodel.getInstance().createSelectQuery();

        try

        {

              q1.execute();

              node.invalidate();

        }catch (Exception e)

        {

        }

        node.bind(q1);

g)     Open your view (java editor) where you want the OVS to appear.

In this e.g. I need a customer OVS=>

Write the following code in wdInit

IWDAttributeInfo[] attributes = {wdContext.nodeSAL_ORD$SAL_ORD_ROOT().getNodeInfo().getAttribute(“ZCUSTOMER”)};

IWDOVSContextNotificationListener listener = new IWDOVSContextNotificationListener()

       {

 public void onQuery(IWDNodeElement queryInputNodeElement, IWDNode queryOutputNode) {

                        // TODO Auto-generated method stub           }

                  public void applyResult(IWDNodeElement applicationNodeElement, IWDNodeElement queryOutputNodeElement)

                  {

      applicationNodeElement.setAttributeValue(“ZCUSTOMER”,queryOutputNodeElement.getAttributeValue(“ZCUSTOMER”));  

                  }

 public void applyInputValues(IWDNodeElement applicationNodeElement, IWDNodeElement queryInputNodeElement) {

                        // TODO Auto-generated method stub

                        queryInputNodeElement.setAttributeValue(“ZCUSTOMER”, applicationNodeElement.getAttributeValue(“ZCUSTOMER”));

      }

      };

WDValueServices.addOVSExtension(“OVSTEST”,attributes,wdThis.wdGetOvscustController().wdGetContext().nodeQueryInput(),wdThis.wdGetOvscustController().wdGetContext().nodeQueryResult(),listener); 

The output would look like this:

image

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. praveen maben
    I have read quite a few blogs on OVS but I find this blog very helpful as it explains, step-by-step, how OVS is created in Netweaver Mobile 7.1.

    Expecting more blogs from you on OVS.

    (0) 

Leave a Reply