Technical Articles
Creating a Search Page SAP CRM 7.0 EHP 1
- With the SAP CRM 7.0 EHP1 (Enhancement Pack 1), new wizard for Search Page is available which enable the creation of Search pages in a simpler and standard manner.
- Search Page is a view set that hosts a search query view and result view
1. Creating and Defining a Model
- Open a Component Workbench BSP_WD_CMPWB and enter the component name. e.g. ZSEARCH_PAGE
- Click on Create.
- New Abap objects created one by one needs to assigned and stored in a single package and transport request.
Once you click on Save all the classes are generated automatically.
Window will have its own IMPL class ZL_ZSEARCH__MAINWINDOW_IMPL and controller MainWindow.do
Window Context IMPL class as ZL_ZSEARCH__MAINWINDOW_CTXT .
Component Controller BSPWDComponent.do with its IMPL Class ZL_ZSEARCH__BSPWDCOMPONEN_IMPL
Component Controller context IMPL class ZL_ZSEARCH__BSPWDCOMPONEN_CTXT is created.
2. Add Model
Click to RUNTIME REPOSITORY EDITOR -> Switch to edit mode -> Right click on Model ->
ADD MODEL.
3. Create Custom Controller
- Custom Controller is used to share the data between two views.We will used later
- Step-> Define Name as ZCuCo -> Add Model Node as BuilHeader -> Continue till Last step.
4. Creating a Search Page
- Next Step is Creating a Search Page -> Right Click on View-> Create Search Page as Shown below
- It will create a New Search Page , Window , Search View and Result view, View Set automatically -> Continue .
- As we are creating an Advanced search , Select BOL object for
Search Query node , Once you selected wizard will automatically fetch corresponding Result node.
- You can define options – as Saved Search Creation , Navigation Links , Result View Selections etc.
- Here we are creating a Navigation Link as BP_NUMBER .
- You can define Buttons as well by default.
- So 3 Views are created using that Search View Page
- Search Page as View Set
- SearchQueryView as AdvancedSearchView
- SearchResultView as Display View
- you can can see in Runtime repository how the viewsets , viewarea and views are bounded together.
5.Search Query Config
Click on Configuration tab -> click on edit mode ->Create new Configuration and Accept Default values
– > Show available fields->Drag or Drop on Selected search criteria list.
6. SearchResultConfig
Testing Component
7. Creating Over View Page
- Create Overview Page and Enter a name for overview page->assign a package and save it.
- Custom Controller ,Controller Implementation , Custom Controller, and Context are created.
8. Creating Another Form View name as Display View , Add Model node as BuilHeader and link it to custom controller.
- This binding ensures that data will be shared between views and custom controller and with any other context node bound to the same context node.
9. Assign Display View to OverViewPage.
10. Over View Page Configuration and Display View Configuration.
- Select available assignments blocks list to add them to display assignments blocks.
- Keep Load options enabled so that they are displayed upon load -> Save.
11. Navigation Link
- As BP_NUMBER is a hyperlink in a result view , so we decided to navigate to another view(DisplayView)
- Right Click on CLICK_ON_LINK and Redefine.
- Here Search page creation wizard has taken care of retrieving a BOL entity corresponding to that link on which user clicks.
- Here index of that line is retrieved from event info then get the BOL entity from collections.
- Open Implementation class of SearchResultView ->Navigate_to_link.
- Here for the BP_NUMBER we add a bol event handler to collection and pass collection to outbound plug.
- Redefine outbound plug.
- Here in Navigate method the name of the outbound plug is ‘Navigate’ that we will later define in runtime repository as Navigation Links.
- Right Click on Inbound Plug->IP_RESULT_VIEW as plug name of OverViewPage.
- Here object is sent from result page via inbound plug is received in overviewpage inboundplug and set in context node of custom controller
- Creating a Navigation Link -> Enter the Source and Target View.
- Add Following code to navigate as already discussed in previous slide.
- Add inbound plug of SearchResultViewFromDisplay’.
- Navigation Id as ‘Back’ -> Enter Source View and Target View.
Hi Summet,
Nice document.
Regards,
Zafar
Hi Sumeet,
Nice document.
Thanks,
Faisal
Hi Summet,
Finally, i am seeing a blank screen when i click on a BP Number. I think this should show the Overview page.
10) Over View Page Configuration and Display View Configuration. •Select available assignments blocks list to add them to display assignments blocks.
While doing above step(#10), I am unable to see any fields available in assignment blocks for display purpose. I used 'BUILHEADER' for BOL Entity while creating display view page. What does the display page does here? Can you please tell me where am I wrong?
Hi Sumeet,
Nice document.
Regards,
Amal
Hi Amal, Did you try to implement this? Were you able to see some data on Overview/Display Pages(Step#10) ?
Hi Summit, nice share .
But When we are doing like this, .htm page is not appearing for any of the views like search, result and View set also.
I want to add "Saved Search as" input field to save my custom search . How we add the same into search page .
regards,
rama
Hi Ram,
If you create a search page via 'Create as search page', an .htm page won't be shown in the component workbench. But still you can work with .htm page. Please have a look here.
create a button in search view of the search result page created by Wizard create search page
Thanks,
Faisal
Hi Sumeet,
I did search page follow your step. Then my display view show "BuilHeader not bound".
Could you please suggest me.
Regards,
Hiranya
In step 10, I can't see any value in Overviewpage configuration,
and step Creating a Navigation Link -> Enter the Source and Target View.
can't find the OverViewPage in target view.
Can you help me?
Nice article. Thanks for posting.
I used wizard to create my bespoke component. Search and result views are working fine for the first time. I can select criteria on search page, press search button and result list is correctly displayed. But from there onwards, if I press SEARCH button again, all the fields in result list displays "not bound" message. Although the result list contains BO objects. Just that the fields don't display the information. Any idea what could be missing?