I continued exploring the new functionality(I always define something as “NEW” if I do not know that topic before, so I would consider this functionality as “NEW” to me 😉 ) and came across the “Search Component(GUIBB SEARCH)”, here is a quick introduction about this topic from FPM Cookbook –
Search Component (GUIBB SEARCH)
A generic design template for displaying a search query which is implemented using the Web Dynpro component FPM_SEARCH_UIBB. You can determine the search query by configuring the Web Dynpro component FPM_SEARCH_UIBB.
The following screenshot details the search component elements:
I would like to demonstrate how to use this “Search Component” functionality. In this blog, I would develop an application which could search employees based on the Employee Number and list the Employee details.
As a part of this development I would perform the following main activities –
- Create a common class which would be used for data storage.
- Create a Feeder class which gets linked to Search GUIBB Component configuration.
- Create WD Application and the respective Application and component configurations.
Step – 1 : Common Class for Data Storage
This class creates the generic data that is shared across components. Like, I would like to create an attribute that stores the search results in the form of table (I have created this class keeping my next blog in mind, If you are displaying results using the Search GUIBB alone[as mentioned in this blog], then we do not require this base class)-
While creating this base class, please uncheck the “Final” attribute since we are going to use this class as a parent class in the steps ahead.
Create the following attributes –
Save and Activate this class.
Step-2 : Feeder class for Search GUIBB
This feeder class would define the “Search” criteria(Selection fields in SAP lingo). We have to implement the interface – IF_FPM_GUIBB_SEARCH to achieve this functionality.
Link the parent class – ZCL_FPM_BASE_CLASS as a superclass to this newly to be created Search GUIBB –
Implement the interface IF_FPM_GUIBB_SEARCH to add the interface methods –
Though it sounds dumb, but I went ahead following SAP’s suggestion –
” If your application does not need a particular method, implement an empty method, otherwise the system will dump.”
Whichever method I didn’t want to use, I went ahead adding a simple “RETURN” statement to make sure that the application doesn’t dump @ runtime.
I went ahead building the selection criteria and result table’s field catalog in the following interface method –
On clicking “SEARCH” button, extract the respective information into the respective attribute in the following method –
I moved the results from the attribute table to the final results table in the following method –
Step – 3 : WD Application and respective Configurations
I went ahead calling the smart “ACT”(Please refer my previous blog to get the latest Application Creation Tool Application details) to create my WD Application and respective application and component configurations in 1 shot –
I went ahead opening my OIF Component configuration and added the “Search GUIBB” to my Subview –
I went ahead creating the component configuration for my Search GUIBB –
Attached my above created feeder class to the freshly created Search GUIBB’s component configuration
Defined my “Selection Criteria” as “PERNR” by clicking on “Add Selection Criteria”. It lists all columns that are added as search criteria in “GET_DEFINITION” method –
Added the result columns to my Configuration by clicking on “Columns of Result list”, It lists all columns that are added to the results field catalog in the GET_DEFINITION Method –
Went ahead testing my WD Application to see the desired results –
In my next blog I shall show the other option of displaying the results using LIST GUIBB with Search GUIBB. So stay tuned to this series.