How to include saved search results on CRM WebUI Home page
At the moment SAP delivers very few views that can be included on CRM WebUI Home page to monitor users’ day to day work… and most of them are addressing very specific needs and can’t be customized in any way (this is going to be improved a little bit with the last Customer Connection program, but not that much I guess). For example:
- My tasks
- My appointments today
But what if users would like to see their opportunities, their quotations in progress, or newly created service requests assigned to them? Well, they can create saved searches that will be displayed on their home page too, but they’ll need to click on each and every link to navigate to the results (which is somehow cumbersome already because when designing the application we’d like to prevent too many clicks). And the real problem is: if service requests are not assigned to them very often for example, after clicking on the link to get an empty table for the tenth time, they might forget (or choose not to open the link) next time.
So the idea came up to create a new component included on CRM WebUI Home page to display the results of selected saved search. At first, I thought it would be quite easy to “copy” what was already done for widgets that users can create and include on Home pages themselves, but it needed lots of modifications to SAP standard code. So in the end, I started the creation of a new component from scratch that would work like an overview page with dynamic assignment blocks. And I would like to thank Arun Prakash Karuppanan for his document that helped me a lot for the “dynamic” part: WebDynpro ABAP in CRM 2007: Dynamic Context Nodes and Component Usages. Here is the result:
To get there, first I created a component with a MainWindow including a Dashboard viewset. I added one context node “RESULT” in the component controller to store the results to be displayed and added it to the component Interface. I also created component usage “PERSO” to be able to open a personalization popup where each user would choose which saved search he would like to include in his dashboard:
Then in the html code of DashboardVS all we need is to loop through the saved searches that our user decided to put on his home page, and to include them as view areas:
The important part here is LOOP AT controller->mt_pers INTO ls_pers. This MT_PERS variable is filled-in by method BUILD_PAGE which is called during DO_PREPARE_OUTPUT:
We’re almost done. Now we need to tell the system how to call the personalization popup and fill-it with the user’s saved search (for him to choose which one should be displayed in our Dashboard component). So all we have to do is to create two event handlers: EH_ONPERSO and EH_ONPERSO_CLOSED. The WebUI framework team really did a very good job on this one because the popup will take care of everything for us. Here is an extract from the code that can serve as an example:
Et voilà. All the bits and pieces are here to include saved searches on CRM WebUI home page (provided that you add this component in SPRO >> CRM >> UI Framework >> UI Framework definition >> Define additional views for home page). Now there are only 6 steps to perform (with the help of wizards we are talking about a dozen of clicks maximum) for each query object that our Dashboard component should support:
- Create a new window untitled ‘EmbW<name of query object>’. No context node needed
- Create view ‘Emb<name of query object>’ with context node RESULT corresponding to the query result bol entity
- Bind RESULT context node from this view with RESULT component context node
- Create the view configuration
- Add view ‘Emb<name of query object>’ to window ‘EmbW<name of query object>’ inside the component repository
- Add window ‘EmbW<name of query object>’ as component interface
Here is what I created to be able to embed saved searches for activities and opportunities:
I know the creation of new windows for each query object might look a little bit useless so far… but as I was designing this component, I wanted to make it ready for embedding views inside overview pages as well. For example: in the business partner OVP you might want to display an assignment block with opportunities of type xxx and status zzz assigned to yyy. This is something you can easily do if you create a rapid application, etc. etc. but then you need one rapid application for each object type you want to embed (and SAP do not deliver any of them out of the box). So as the result of a saved search or the result of a mapping from a rapid application looked very similar to me, I designed this Dashboard to be able to embed the query object views in any OVP. So in my next blog I’ll explain how we can change the super class of those ‘Emb<query object>’ views that were created by the wizard, to transform this dashboard component into an embeddable views repository (i.e. you won’t have to create rapid applications to insert query results into OVP anymore)…
I would like to make it a bit easier, however don't know how to realize this.
I want to display the search result of a saved incident search.
So what would be enough for me is, to executed the saved search and just display the search result as fullscreen.
We want to display this on a screen as overview.
So just the results should be displayed.