Skip to main content

SAP Sales Doc Search Component

You can extend the SAP Sales Doc 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 Sales Doc Search Component calls BAdI /ENSXSFCI/SD_SALESDOC_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 sales document 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 Sales Doc 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 result and lets you add values in the USER_DEFINED tab. This method is called after all the SAP Sales Doc Search Component logic is executed.

Example Implementation

We provide an example implementation class: /ENSXSFCI/CL_SDOC_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 SD Document Currency keys using the WAERK key in the CUSTOM tab of the Context and filters the results by Currency.

In the ADDITIONAL_FIELDS method, the ERNAM field (Name of Person who Created the Object) is returned in field CUSTOM01 of CT_DATASET.