Message type: E = Error
Message class:  MDG_BS_CUST_BOLUI - MDG: messages for Cusomer UI related issues 
Message number: 040
Message text: You cannot delete mandatory function &1 of customer &2 in sales area &3.
Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of messages in the SAP system have a message text, however this is frequently insufficient to comprehend or resolve the problem.
To make things easier, more detailed information is frequently added to describe the issue, how to fix it, and the necessary steps or configuration modifications.
Unfortunately, there isn't any extra information in this error notice.
First, use our AnswerBot below to get a possible cause and solution (requires a premium subscription).
Also, review the in-depth Common Questions & Answers listed below; you could discover a solution there or be able to connect with others who have faced similar challenges.
You can also try searching the SAP support portal (support.sap.com) but you need a special user ID to access it. It is possible that an SAP support note exists that provides additional details about the mistake or even steps for fixing it.
The SAP error message MDG_BS_CUST_BOLUI040 indicates that you are trying to delete a mandatory function for a customer in a specific sales area. This error typically arises in the context of Master Data Governance (MDG) for Customer data, where certain functions or attributes are required for the customer record to be valid.
Cause: The error occurs because: The function you are attempting to delete is marked as mandatory in the system configuration. The customer record in question is linked to a sales area that requires this function to be present for proper processing.
Solution: To resolve this error, you can take the following steps: Review Mandatory Functions: Check the configuration settings for the customer master data in the relevant sales area. Identify which functions are marked as mandatory and why. Modify the Customer Data: If you need to delete a function, you must first ensure that it is not mandatory. This may involve: Changing the configuration to make the
 Get instant SAP help. Sign up for our Free Essentials Plan.
Get instant SAP help. Sign up for our Free Essentials Plan. 
MDG_BS_CUST_BOLUI039 You cannot delete sales area &1 of customer &2. It has active data.
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
MDG_BS_CUST_BOLUI038 Sales area &1 is not assigned to customer &3 (business partner &2).
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
MDG_BS_CUST_BOLUI041 Partner function &1 is unique and already assigned to sales area &2.
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
MDG_BS_CUST_BOLUI042 Original document is missing.
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
Click on this link to search all SAP messages.