Skip to Content

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:

Pic1.jpg

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 –

  1. Create a common class which would be used for data storage.
  2. Create a Feeder class which gets linked to Search GUIBB Component configuration.
  3. 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.

/wp-content/uploads/2012/12/pic2_164136.jpg

Create the following attributes –

/wp-content/uploads/2012/12/pic3_164137.jpg

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 –

/wp-content/uploads/2012/12/pic4_164144.jpg

Implement the interface IF_FPM_GUIBB_SEARCH to add the interface methods –

PIC5.jpg

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.

PIC6.jpg

I went ahead building the selection criteria and result table’s field catalog in the following interface method –

PIC7.jpg

On clicking “SEARCH” button, extract the respective information into the respective attribute in the following method –

PIC8.jpg

I moved the results from the attribute table to the final results table in the following method –

/wp-content/uploads/2012/12/pic9_164149.jpg

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 –

/wp-content/uploads/2012/12/pic11_164150.jpg

I went ahead opening my OIF Component configuration and added the “Search GUIBB” to my Subview –

/wp-content/uploads/2012/12/pic10_164151.jpg

I went ahead creating the component configuration for my Search GUIBB –

Pic12.jpg

Attached my above created feeder class to the freshly created Search GUIBB’s component configuration

/wp-content/uploads/2012/12/pic13_164153.jpg

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 –

/wp-content/uploads/2012/12/pic14_164154.jpg

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 –

/wp-content/uploads/2012/12/pic15_164155.jpg

Went ahead testing my WD Application to see the desired results –

/wp-content/uploads/2012/12/pic16_164157.jpg

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.

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Former Member

    Hi Raja,

    Thanks for nice blog.

    In case if I delete an entry from search list and try to bind the table with new entries in GET_DATA method, the old search result displays and not the new one.

    do you know how to bind the new search list results ?

    Thanks,

    Mohan Babu

    (0) 
    1. Former Member Post author

      Thanks for the comments Mohan Babu,

      I don’t exactly understand your Q – Are you saying that in case if you change the search criteria the list is not getting refreshed ? Yes, you would have to clear the GT_PA0001 internal table attribute before calling the “Select” query. That would clear the existing results.

      If your Q is something else, please help me understand your Q properly.

      Hope this helps.

      Regards

      Kuncham

      (0) 
  2. Former Member

    Hi Raja,

    Congratulations for your great blog.

    I am trying to construct a prototype of a search component but have some doubts that maybe you could help me to solve 🙂

    – How can I rename the title “no title provided” and also delete the “Save” button. In particular, I don’t want to have this header embedded on my view. I want only the section block starting from “Search criteria”

    Many thanks,

    Javier

    (0) 
  3. Ramya Sama

    Hi Raja,

    I have one doubt regarding search uibb.

    I want to get this search uibb when i click on F4 of one UI filed in FPM application.

    Please let me know the possibilities.

    Thanks in advance

    Ramya

    (0) 
  4. Akshay Rajpurohit

    Hi Raja ,

    Process well described by you, I just want to know if you can help as I want to add Export to Excel Functionality (prefer standard one) in Search UIBB to export result data into Excel.Let me know if you have any idea on that ?

     

    Thanks ,

    Akshay

    (0) 

Leave a Reply