Symptom
The DELETE operation on the entity A_AddressPhoneNumber was not working as expected. Despite receiving a successful 204 No content message upon execution, the records were still present when checked via GET operation on the SAP S/4HANA Cloud instance.
Environment
SAP S/4HANA Cloud Public Edition
Cause
The Deletion API is working fine, but you have many phone numbers that are the same. Each time you perform a delete, you remove one telephone number. After using the Get API with the parameter OrdinalNumber='1', you find that the telephone number still appears.
The URL you are using is https://xxxx/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_AddressPhoneNumber(AddressID='202',Person='201',OrdinalNumber='1'). The third parameter, 'OrdinalNumber', is the sequence number, meaning the Get URL will return only the first telephone number. Therefore, you continue to see the phone number when there are multiple telephone numbers. From my testing, you have 31 telephone numbers. Only after executing the GET method more than 31 times will you find that you can't retrieve the telephone number.
Resolution
You can try using the URL /sap/opu/odata/sap/API_BUSINESS_PARTNER/A_AddressPhoneNumber. This will help you find that there are many telephone numbers. You can also validate if the DELETE operation is working correctly based on the number of telephone numbers.
Keywords
A_AddressPhoneNumber, OrdinalNumber, Deletion, telephone numbers , KBA , LO-MD-BP-ODT , OData Service for Business Partner , Problem