Skip to main content

SAP Customer Search Component

You can extend the SAP Customer Search Component by adding up to 10 fields at the end of the search result table. You can also replace the standard search with a custom selection.

The SAP Customer Search Component calls BAdI /ENSXSFCI/SD_CUSTOMER_SEARCH.

The BAdI contains two methods: SEARCH and ADDITIONAL_FIELDS.

The SEARCH method receives the IS_CONTEXT results and the IV_ORDERBY results generated by the paging logic and returns the CT_KEY customer search structure (it contains the Customer Number). The CV_IMPLEMENTED flag should be set if this method is implemented. You can use the CUSTOM tab in the Context to pass extra selection fields from the front-end.

The SAP Customer Search Component logic checks the CV_IMPLEMENTED flag and ignores the standard search if it's set.

Method ADDITIONAL_FIELDS

The ADDITIONAL_FIELDS method receives the CT_DATASET search result table and lets you add values to the CUSTOM01 - CUSTOM10 fields in the table. This method is called after all the SAP Customer Search Component logic is executed.

Example Implementation

We provide an example implementation class: /ENSXSFCI/CL_CUST_SEARCH_BADI. You can copy the example implementation and add/replace it with your own logic and fields.

In the SEARCH method, this class receives the LANGU language key in the CUSTOM tab of the Context and filters the results by language of the Customer.

In the ADDITIONAL_FIELDS method, the STCD1 field (Tax Number 1) is returned in the CUSTOM01 field of CT_DATASET.