SAP crashed unexpectedly when opening Add New BP Master Data window. The cause is due to UDF used in FMS query was removed. 


Below are steps to reproduce:

  1. Go to Tools → Customization Tools → User-Defined Fields - Management... and create 2 new User Defined Fields (UDF) on Master Data → Business Partners → Business Partners. Eg. U_IPSBank_Acc, U_IPSBank_Name
  2. Go to Tools → Queries → Query Generator. Create and save a simple SQL query, example: select '1'.
  3. Go to Business Partners → Business Partner Master Data.
  4. Click on the UDFs created in step 1 (i.e. U_IPSBank_Name) and go to Tools → Customization Tools → User-Defined Values - Setup.
  5. Select the option Search in Existing User-Defined Values according to Saved Query, press the Open Saved Query button and choose the query created in step 2.
  6. Select the Auto Refresh When Field Changes checkbox and choose BP Code field.
  7. Select the option Display Saved User-Defined Values and press the Update button.
  8. Go to Tools → Customization Tools → User-Defined Fields - Management... and remove the UDF U_IPSBank_Name with the configured User-Defined Value. Do not remove the other UDF U_IPSBank_Acc created in step 1.
  9. Go to Business Partners → Business Partner Master Data and switch to add mode.
  10. SAP Client will crashed when select Add New in BP Master Data window.


Use below query to detect the affected FMS query and identify the missing UDF. 


Select * from CSHS where "ItemID" like 'U_%' and "Refresh" = 'Y' and not exists (select * from CUFD where "ItemID" = concat('U_', "AliasID"));


For example, UDF U_IPSBank_Name is missing.



Correction:


Option 1 - Create the missing UDF U_IPSBank_Name, find the fields in BP Master and remove the FMS that uses this UDF.


Option 2 - Run below query to fix, with SAP approval.


delete from CSHS where "ItemID" like 'U_%' and "Refresh" = 'Y' and not exists (select * from CUFD where "ItemID" = concat('U_', "AliasID")); 


Reference  

SAP Note : 3377581 - Unexpected application shutdown while switching a marketing document or a master data record to add mode