cancel
Showing results for 
Search instead for 
Did you mean: 

OVS - How to impliment OVS search help

Former Member
0 Kudos

HI,

I want to impliment OV Ssearch help.I have lot of documents for this OVS,but its very confusing.

Can any one please suggest how to impliment this OVS step-by-step.

Please help me in doing this.

Thanks in advance.

Regards

-Sandip

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sandip,

Check these link:

http://help.sap.com/saphelp_nw04s/helpdata/en/47/9ef8c99b5e3c5ce10000000a421937/frameset.htm

/people/shruti.rathour/blog/2008/05/05/ovs-help-in-web-dynpro-abap

Regards.

Rajat

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sandip ,

OVS helper context: The OVS stores its data (search input data and the query results) in an OVS helper context, which is part of the OVS custom controller. The application developer declares a context node of cardinality 1..1 for storing the search input data and another node of cardinality 0..n for storing the query results. If a suitable RFC function is available, you just have to declare the model binding. The input and output node are then part of the created context structure.

OVS listener: The OVS uses a listener implementation of the interface IWDOVSContextNotificatiionListener. This listener implements three hook methods, which act as event handlers and are called at three separate points in time: When the OVS is required for a field, when the search query is triggered and when the user selects a row in search result table.

OVS extension: The OVS is used for finding objects and copying object values to the context. It is an input help service provided for all context attributes which were programmatically extended with the OVS feature. The webDynpro Programming model API provides the WDValueServices class for adding this OVS extension to context attributes.

https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdjava/valueHelp-ObjectValue+Selector

Hope this will help to some extent.

Thanks,

Tulasi Palnati

Former Member
0 Kudos

Hii,

Am providing u with the code where the search help gets populated with values from the RFC.

Create a value node called Ctx_vn_ProjectsNode and corresponding value attributes Ctx_va_Team,Ctx_va_Description.Bind an input field to the value attribute Ctx_va_Team.

1)the following method is called at wdDoInit() method of View.

public void populateProjects( )

{

//@@begin populateProjects()

wdThis.wdGetTdc_UICustController().fetchProjects();

IPublicTdc_UICust.ICtx_vn_ProjectsNode ProjectsNode = wdThis.wdGetTdc_UICustController()

.wdGetContext().nodeCtx_vn_Projects();

IPublicTdc_UICust.ICtx_vn_ProjectsElement ProjectsElement = null ;

IPrivateTdc_CSIReportView.ICtx_vn_ProjectsNode l_ProjectsNode = wdContext.nodeCtx_vn_Projects();

IPrivateTdc_CSIReportView.ICtx_vn_ProjectsElement l_ProjectsElement = null ;

if(ProjectsNode.size()!=0)

{

for(int i = 0; i<ProjectsNode.size();++i)

{

ProjectsElement = ProjectsNode.getCtx_vn_ProjectsElementAt(i);

l_ProjectsElement = l_ProjectsNode.createCtx_vn_ProjectsElement();

l_ProjectsElement.setCtx_va_Team(ProjectsElement.getCtx_va_Team());

l_ProjectsElement.setCtx_va_Description(ProjectsElement.getCtx_va_Description());

l_ProjectsNode.addElement(l_ProjectsElement);

}

}

wdThis.wdGetTdc_UICustController().attachProjectF4(wdContext.nodeCtx_vn_Projects()

.getNodeInfo().getAttribute(IPrivateTdc_CSIReportView

.ICtx_vn_ProjectsElement.CTX__VA__TEAM));

//@@end

}

2)call this method at UICust

public void fetchProjects( )

{

//@@begin fetchProjects()

String userID = getUserID();

//String userID = "278401";

IPublicTdc_DataCust.IZsm_Fetch_Projects_InputNode InputNode = wdThis.wdGetTdc_DataCustController()

.wdGetContext().nodeZsm_Fetch_Projects_Input();

IPublicTdc_DataCust.IZsm_Fetch_Projects_InputElement InputElement = null ;

IPublicTdc_DataCust.IProjectNode l_ProjectNode= wdThis.wdGetTdc_DataCustController().wdGetContext().nodeProject();

IPublicTdc_DataCust.IProjectElement l_ProjectElement = null ;

IPublicTdc_UICust.ICtx_vn_ProjectsNode ProjectsNode = wdContext.nodeCtx_vn_Projects();

IPublicTdc_UICust.ICtx_vn_ProjectsElement ProjectsElement = null ;

try

{

InputNode.currentZsm_Fetch_Projects_InputElement().setUser_Id(userID);

wdThis.wdGetTdc_DataCustController().executeZsm_Fetch_Projects_Input();

if(l_ProjectNode.size()!=0)

{

for(int i =0;i<l_ProjectNode.size();++i)

{

l_ProjectElement = l_ProjectNode.getProjectElementAt(i);

ProjectsElement = ProjectsNode.createCtx_vn_ProjectsElement();

ProjectsElement.setCtx_va_Team(l_ProjectElement.getProject_Id());

ProjectsElement.setCtx_va_Description(l_ProjectElement.getProject_Name());

ProjectsNode.addElement(ProjectsElement);

}

}

else

{

wdComponentAPI.getMessageManager().reportException("No Projects fetched for UserID:" + userID

+ " System cannot proceed !!" , true);

}

}

catch(Exception e)

{

}

//@@end

}

3)call this method at UICust.

public void attachProjectF4( com.sap.tc.webdynpro.progmodel.api.IWDAttributeInfo p_proj )

{

//@@begin attachProjectF4()

ISimpleTypeModifiable l_simpleType = p_proj.getModifiableSimpleType();

IModifiableSimpleValueSet l_valueSet = l_simpleType.getSVServices().getModifiableSimpleValueSet();

String initialValue = null;

IPublicTdc_UICust.ICtx_vn_ProjectsNode ProjectsNode = wdContext.nodeCtx_vn_Projects();

IPublicTdc_UICust.ICtx_vn_ProjectsElement ProjectsElement = null ;

for(int i=0;i<ProjectsNode.size();++i)

{

ProjectsElement = ProjectsNode.getCtx_vn_ProjectsElementAt(i);

l_valueSet.put(ProjectsElement.getCtx_va_Team(),ProjectsElement.getCtx_va_Description());

}

//@@end

}

Former Member
0 Kudos

HI Parama,

But where I have to impliments those inner classes - IWDOVSContextNotificationListener, and the 3 hook methods like applyInputValues(),onQuery() and apply result().

Thanks in advance.

Regards

-Sandip

Former Member
0 Kudos

Hii,

Whichever methods i have given u, u just follow that u wil get wat is desired.

Thanks

Former Member
0 Kudos

Parama,

I think you have given a solution for SVS and not OVS. But inorder to impliment OVS we need to impliment those inner class and the 3 hook methods.

Can any one please help me on how to impliment OVS inner class and the 3 hook methods.?

Regards

-Sandip

Former Member
0 Kudos

Hi Sandip,

These Methods are defined in the Custom controller.

/docs/DOC-8061#51 [original link is broken]

Download the Advance OVS(.ZIP file) from tutorials and upload to NWDS and you will find out the correct path.

Thanks,

Tulasi

Edited by: Tulasi Palnati on Feb 16, 2009 10:31 AM

Former Member
0 Kudos

HI Tulasi,

Thanks for all those information and sample application.

Points will be given to you.

Thanks a lot.

-Sandip