Skip to Content

  I was given a situation in a project to make F4 Search Help through the Object Value Selector. Although it seems to be having the same logic as in case we use a Remote Function Call (RFC) or a Bapi but still after I discover how to do it actually its somehow different in case of  a web service. the difference might be because the structure when we import a adaptive web service model or a Adaptive RFC Model is slightly different .Also the labels and the table headers come automatically from Bapi’s /RFC in case of a Adaptive RFC Model,But in Adaptive Web Service Model we need to manually write some lines of code to fulfil the requirement.

 So in an easy way I will explain you the simple steps in case you need to implement it through a web service.


The problem is to implement OVS value help through a Web service.The whole implementation is done in Web Dynpro for java CE SP03.


I. Create Web Dynpro local development component.

II. Import the Web Service as Adaptive Web Service Model. Make sure you have created the metadata and modeldata destinations in the Net weaver Administrator in the Web Application Server(WAS) where you are going to deploy the whole application.

III. Create Web Dynpro Custom Controller in which the model is added in the using the template.

IV. Create a view with the input field for which the F4 is called.

I have used a web service in which a single method is there whose input is a search term (String) and output as User ID and User Name. The service provides a wild card ‘*’search .The service after importing in the custom controller the following context can be seen:


Where SearchTerm is request or input under the node Request_UserF4Help,

            UserID and UserName are the response attributes present in the Response node under the following hierarchy Response – UserList – UserListChild.

As per Web Dynpro guidelines, we cannot use the model nodes directly to the view. For this reason a value node “User”similar to the model node is made in the custom controller .The context Structure of the same is


Where SearchTerm is for request and UserData is response node.

The same value node is dragged to the view controller context. The input field in view layout where the F4 help is required is binded with the SearchTerm attribute of the User value node.


Now the implementation of Custom Controller

Firstly add the following in the //begin —//others

private IWDOVSContextNotificationListener ovsListener =
        new OVSDemoContextNotificationListener(“searchTerm”);

Now add three methods in the Custom Controller


Add following code in

1. getOVSInputNode():
                         return wdContext.nodeUser();
2. getOVSListener():
                         return ovsListener;
3. getOVSOutputNode( ):
                        return wdContext.nodeUserData();

To implement an OVS Search help we need to implement the IWDOVSContextNotificationListener interface in a class and override three methods namely:

1. public void onQuery(IWDNodeElement queryInputNodeElement, IWDNode queryOutputNode)



2. public void applyResult(IWDNodeElement applicationNodeElement, IWDNodeElement queryOutputNodeElement)
3. public void applyInputValues(
            IWDNodeElement applicationNodeElement,
            IWDNodeElement queryInputNodeElement)

Add the following code in each of the three as follows:

public void onQuery(IWDNodeElement queryInputNodeElement, IWDNode queryOutputNode) {
                  IPublicUserModelController.IUserElement input =  (IPublicUserModelController.IUserElement) queryInputNodeElement;      
            IPublicUserModelController.IUserDataNode output =   (IPublicUserModelController.IUserDataNode) queryOutputNode;
            Request_UserF4Help bapiInput = new Request_UserF4Help(model);
            try {
              usermodel.UserList outputList = bapiInput.getResponse().getUserList();
                          for(int i=0;i<wdContext.nodeUserListChild().size();i++){
                  IPublicUserModelController.IUserListChildElement userListElem = (IPublicUserModelController.IUserListChildElement)wdContext
                  IUserDataElement ul = (IUserDataElement)wdContext.nodeUserData().createElement();
                         } catch (Exception e) {
              IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException(e.getLocalizedMessage(), false);        
                public void applyResult(IWDNodeElement applicationNodeElement, IWDNodeElement queryOutputNodeElement) {
                        IPrivateOvs_erepCompView.IUserElement ovsCallerNodeElement =
                    (IPrivateOvs_erepCompView.IUserElement) applicationNodeElement;
                        IPublicUserModelController.IUserDataElement output = (IPublicUserModelController.IUserDataElement)queryOutputNodeElement;
          public void applyInputValues(
            IWDNodeElement applicationNodeElement,
            IWDNodeElement queryInputNodeElement) {
            Object initialValue = applicationNodeElement.getAttributeValue(“searchTerm”);
            queryInputNodeElement.setAttributeValue(“searchTerm”, initialValue);

The implementation of custom controller is now done. Finally add the following code in the View controller


IWDAttributeInfo[] ovsStartUpAttributes = {
                    IWDOVSContextNotificationListener listener =

When you run this application you are now able to see the F4 symbol attchaed to the input field,But still you are unable to see a window title and fields labels and column headers in the popup when you click the icon .For this add the following code in the wdInit() of the custom controller:

IWDAttributeInfo info = wdContext.nodeUser()
info.getModifiableSimpleType().setFieldLabel(“User Name”);
IWDAttributeInfo infoout = wdContext.nodeUserData()
IWDAttributeInfo infoout1 = wdContext.nodeUserData()
infoout.getModifiableSimpleType().setColumnLabel(“User ID”);
infoout1.getModifiableSimpleType().setColumnLabel(“User Name”);

After running the applications you are now able to see the F4 symbol attached with the input field and on click of it a popup can be seen.

The running application :!|height=39|alt=Output|width=264|src=|border=0!

which on click will show you a popup


To report this post you need to login first.

1 Comment

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

  1. Former Member

    Thanks for sharing.

    Could you please explain the next line?
    usermodel.UserList outputList = bapiInput.getResponse().getUserList();

    Is usermodel a reference to the Response Node?



Leave a Reply