Hello Nikhil,
When you create your entity, you need to set one of our property as ETag.
When you fire the GET operation your response will contain the ETag value.
You need to pass this value inside the If-Match Header along with the payload when you are performing modifying operations.
Please have a look here which will help you accomplishing the same ->
Locking mechanism in SAP Gateway.
Regards,
Ashwin