***The following step is very important***
Now Still the WEB IC only know this is a ordinary view. Now we need to convert this view in to Search View. For that we need to change the super class of the Implementation class. Double click on the implementation class and go to the attribute table of the class module. You will see the super class as ZL_ZSRCMP_SEARCHADV. Now click on the super class you will see the SAP’s inherited class as CL_BSP_WD_VIEW_CONTROLLER. We need to change this class to the SAP’s advance Search controller CL_BSP_WD_ADVSEARCH_CONTROLLER. Now your plain view became as search view. The above is very important. If you didn’t do this then your view is ordinary view only. See the following screen shot.
Once the above implementation class is converted for the search now we need to convert the context nodes to act as search related nodes. We need to change the implementation of the context node to search related node. Only change the node that you want to show up on the search screen. Don’t do this for every node. In this example I have search node and result node. I want the search node show on the screen. So I modify only the search node with this new implementation class. Replace the existing super class CL_BSP_WD_CONTEXT_NODE with CL_BSP_WD_CONTEXT_NODE_ASP.
See the following screen shot.
Please add the following code in the searchadv.htm Please rpleace all the “ to ” when you copy.
<%@page language=”abap” %>
<%@extension name=”htmlb” prefix=”htmlb” %>
<%@extension name=”xhtmlb” prefix=”xhtmlb” %>
<%@extension name=”crm_bsp_ic” prefix=”crmic” %>
<%@extension name=”bsp” prefix=”bsp” %>
<%@extension name=”chtmlb” prefix=”chtmlb” %>
<%@extension name=”thtmlb” prefix=”thtmlb” %>
<thtmlb:advancedSearch id = “advs0”
fieldMetadata = “<%= controller->GET_DQUERY_DEFINITIONS( ) %>”
header = “<%= TestSearch->get_param_struct_name( ) %>”
fieldNames = “<%= controller->GET_POSSIBLE_FIELDS( ) %>”
values = “//TestSearch/PARAMETERS”
maxHits = “//TestSearch/MAX_HITS”
onEnter = “SEARCH”
ajaxDeltaHandling = “false” />
Activate this class and go back to the component editor.
Now click on the configuration on the view you will see a different configuration than the ordinary view configuration. See the following screen shot.
Edit this screen and add all the fields to the right and save the configuration. The screen looks as follow.
This is like the same way you add the new fields.
See some more information in the following link. The detail is explained there.
Now the search view is ready. Let us start building the result view.