We can do the validations (Data Checking) Before passing into this FM.
We have another BAPI BAPI_CUSTOMER_CREATEFROMDATA1 , BAPI_CUSTOMER_CREATEFROMDATA .
As your requirement is to load search term2 , These BAPIs do not contain search term2.
So validate the data before passing into FM and load it through SD_CUSTOMER_MAINTAIN_ALL .
SD_CUSTOMER_MAINTAIN_ALL is used in standard during the maintenance of a consumer using the standard customer master data transaction XD01 & XD02.
It is not intended to be used out of the transaction and in no case it should be used out of its original context. Due to the specificity of the function module, out of the original context we may face limitations and data inconsistencies.
For the maintenance of customers, there is NO BAPI and NO direct function module.
There are some functions modules like the one above where the name is looking nice. But these should not be used.
Below ECC 2005 (6.00), the only solution was batch input and DEBMAS idocs. See [note 384462|https://service.sap.com/sap/support/notes/384462]
Starting with ECC 2005 (6.00) and above: a synchronisation tool has been introduce. See class CMD_EI_API and VMD_EI_API
Hope this helps