Skip to content
NextLytics
Megamenü_2023_Über-uns

Shaping Business Intelligence

Whether clever add-on products for SAP BI, development of meaningful dashboards or implementation of AI-based applications - we shape the future of Business Intelligence together with you. 

Megamenü_2023_Über-uns_1

About us

As a partner with deep process know-how, knowledge of the latest SAP technologies as well as high social competence and many years of project experience, we shape the future of Business Intelligence in your company too.

Megamenü_2023_Methodik

Our Methodology

The mixture of classic waterfall model and agile methodology guarantees our projects a high level of efficiency and satisfaction on both sides. Learn more about our project approach.

Products
Megamenü_2023_NextTables

NextTables

Edit data in SAP BW out of the box: NextTables makes editing tables easier, faster and more intuitive, whether you use SAP BW on HANA, SAP S/4HANA or SAP BW 4/HANA.

Megamenü_2023_Connector

NextLytics Connectors

The increasing automation of processes requires the connectivity of IT systems. NextLytics Connectors allow you to connect your SAP ecosystem with various open-source technologies.

IT-Services
Megamenü_2023_Data-Science

Data Science & Engineering

Ready for the future? As a strong partner, we will support you in the design, implementation and optimization of your AI application.

Megamenü_2023_Planning

SAP Planning

We design new planning applications using SAP BPC Embedded, IP or SAC Planning which create added value for your company.

Megamenü_2023_Dashboarding

Dashboarding

We help you with our expertise to create meaningful dashboards based on Tableau, Power BI, SAP Analytics Cloud or SAP Lumira. 

Megamenü_2023_Data-Warehouse-1

SAP Data Warehouse

Are you planning a migration to SAP HANA? We show you the challenges and which advantages a migration provides.

Business Analytics
Megamenü_2023_Procurement

Procurement Analytics

Transparent and valid figures are important, especially in companies with a decentralized structure. SAP Procurement Analytics allows you to evaluate SAP ERP data in SAP BI.

Megamenü_2023_Reporting

SAP HR Reporting & Analytics

With our standard model for reporting from SAP HCM with SAP BW, you accelerate business activities and make data from various systems available centrally and validly.

Megamenü_2023_Dataquality

Data Quality Management

In times of Big Data and IoT, maintaining high data quality is of the utmost importance. With our Data Quality Management (DQM) solution, you always keep the overview.

Career
Megamenü_2023_Karriere-2b

Working at NextLytics

If you would like to work with pleasure and don't want to miss out on your professional and personal development, we are the right choice for you!

Megamenü_2023_Karriere-1

Senior

Time for a change? Take your next professional step and work with us to shape innovation and growth in an exciting business environment!

Megamenü_2023_Karriere-5

Junior

Enough of grey theory - time to get to know the colourful reality! Start your working life with us and enjoy your work with interesting projects.

Megamenü_2023_Karriere-4-1

Students

You don't just want to study theory, but also want to experience it in practice? Check out theory and practice with us and experience where the differences are made.

Megamenü_2023_Karriere-3

Jobs

You can find all open vacancies here. Look around and submit your application - we look forward to it! If there is no matching position, please send us your unsolicited application.

Blog
NextLytics Newsletter Teaser
Sign up now for our monthly newsletter!
Sign up for newsletter
 

Search BAdI - How to Implement a Search BAdI

◀ Back to Knowledge Base

In this article you will learn how to implement a Search BAdI. You will understand how filters work and get an overview of all methods with respective areas of application.

Our Search BAdI blog series in overview

  1. How to Implement a Search BAdI - general overview
  2. Search BAdI - Meta Method Explained
  3. Search BAdI - Do Search Method Explained
 

Methods

The enhancement spot /NLY/EDITOR contains a BAdI definition /NLY/BADI_SEARCH, which covers all possible search operations. You can use it to change the search style, number of minimum characters to be entered before search will start and even implement your own search logic.

Customer specific logic is deployed in methods of the implementing class. The structure of methods is inherited from the BAdI definition you selected.

Search BAdI Methods

BAdI definition /NLY/BADI_SEARCH contains the following methods:

  • /NLY/IF_SEARCH~SET_META_EXIT -   Exit meta data of search
  • /NLY/IF_SEARCH~DO_SEARCH_EXIT - Exit for custom search logic

I will explain the respective methods in more detail below.

Meta Method

Using the Meta method, you can adjust any meta data of the search. For example, you can change the search bar to dropdown or activate and disable strict search.

search badi- how to implement 1

The dropdown search suites best for short result lists and always loads all values locally first. Then, the search is executed on the locally loaded values. Thus, dropdown is ideal for short lists. On the other hand, the search function is executed for the entered search term only (eventually it is executed multiple times, if you enter the letters quite slowly). Therefore, SEARCH setting suites best for objects with large master data selections.

Do Search Method

In the Do Search method, you can implement your own search including formatting the results for display to the end user.

search badi- how to implement 3

Overview

In the following chart you will find an overview of all search methods.

search badi- how to implement 4

Filter

The filter contains the search type and the search name. For example, if the search is executed on an InfoObject, the search name is the name of the InfoObject.

search badi- how to implement 5

The table or DSO is not part of the filter. It means the BAdI is executed across all DSOs or tables, which contain the same InfoObject. This way, you don’t have to implement a BAdI multiple times for different DSOs.

If you want to implement different searches for DSOs, which contain the same InfoObject, two use cases exist. In one case you want to have different search appearance (meta data) for a specific object. In the other case you want to have different search logic implemented for the same object.

For example, you may want to have different search styles of the same InfoObject for different tables. In a small table you may want to use DROPDOWN and in a big table, with many entries, you may want to use SEARCH. In this case, you can implement a new referenced InfoObject (so that the master data is reused). Moreover, you can also set table specific settings in the Table Column Properties. You can also use the Table Maintenance Meta BAdI to overwrite the settings done in the Search Meta BAdI.

In another example, you want to implement different search logic. In this case, you can use the Table Maintenance Meta method, to change the search mode and thus trigger another DO SEARCH implementation.

For example, if you want to trigger a search logic of another InfoObject, you can change the parameters SEARCHMODE and SEARCHNAME to the respective InfoObject. In the example below you can find the coding of the Table Maintenance Meta Method.

  METHOD /nly/if_editor~set_meta_exit.
FIELD-SYMBOLS: <l_s_fields_info> TYPE /nly/ts_fields_info,
<l_s_f4help> TYPE /nly/ts_search_info.

LOOP AT ch_t_fields_info ASSIGNING <l_s_fields_info>.

CASE <l_s_fields_info>-fname.

WHEN 'CALYEAR'.

LOOP AT <l_s_fields_info>-f4help ASSIGNING <l_s_f4help>.

<l_s_f4help>-searchmode = 'IOBJ'.
<l_s_f4help>-searchname = '0FISCYEAR'.

ENDLOOP.
ENDCASE.
ENDLOOP.
ENDMETHOD.

The filter of the triggered DO SEARCH BAdI must be set up accordingly.

search badi- how to implement 6

You can also replace the search logic completely InfoObject independent using the CUSTOM search type. Please refer to the coding below for an example.

    FIELD-SYMBOLS: <l_s_fields_info> TYPE /nly/ts_fields_info,
<l_s_f4help> TYPE /nly/ts_search_info.

LOOP AT ch_t_fields_info ASSIGNING <l_s_fields_info>.

CASE <l_s_fields_info>-fname.

WHEN 'CALYEAR'.

LOOP AT <l_s_fields_info>-f4help ASSIGNING <l_s_f4help>.

<l_s_f4help>-searchmode = 'CUSTOM'.
<l_s_f4help>-searchname = 'ZCUST'.

ENDLOOP.
ENDCASE.
ENDLOOP.
ENDMETHOD.

Don't forget to setup the filter of the DO SEARCH BAdI accordingly. Choose CUSTOM as STYPE and the name of the logic as SEARCHNAME.

search badi- how to implement 7

 


Which License is needed for this feature Professional | Enterprise


Do you have a question regarding NextTables? Already a customer? Please click here for Support.