Transaction Code OBR2 is used to delete a customer master data from SAP or you can use the following path for it;
SPRO > Financial Accounting > Accounts Receivable and Accounts Payable > Customer Accounts > Master records > Delete Customer Master Date
Those customer master data which does not have any transaction data can be deleted through this transaction code. You can not delete customer master record which has transaction data posted in to it.
You can use this transaction code to delete vendor master and general ledger master from SAP system.
We suggest you to run the transaction is test mode first and after successful result you run it with out test mode.
If you don’t want the customer account to have posting and the same master data can not be deleted then the master data can be blocked for posting. After blocking a customer master data system will not allow any further posting to it. The old postings are always being there in SAP.
Same procedure needs to be followed for deleting the vendor master and general ledger master record. If any transaction is posted to these master data then the same can not be deleted in SAP.