I will explain from the snapshot you have shown.
Buy Price = 100, Sell Price = 101, Lot size = 2000
Case 1: Buying and Selling
Turnover > 2 lakhs for buy and Turnover >2 lakhs for sell (more than 2 lakhs is one lot size, fixed by NSE)
Turnover = (Strike price+premium)*lot size for Call options
Turnover = (Strike price - premium) * lotsize for put options
Brokerage = 0.01% or 20% whichever is lower
Anyhow this turover will be more than 4 lakhs in total so brokerage of 20+20 = 40 rupees will be applied, irrespective of whatever option you are buying and selling
STT is 0.017% on Premium on sell side only
Sell side Premium = 101 x 2000 = 202000
STT = 0.017 * 202000 / 100 = 34.34
This is 0.053% on Total Premium for NSE
Buy Premium = 100 x 2000 = 200000
Sell Premium = 202000 (we already know)
Total Premium = 200000+202000=402000
Transaction Charges = 0.053 * 402000 / 100 = 213.06
12% on Brok+Transaction Charges = 12 * (40+213.06) / 100 = 30.37
ESS and HESS, I think you can figure out, 2% and 1% on service tax
Rs.20/crore or 0.0002% on Total Premium = 402000*0.0002/100 = 0.80
Case 2: Only Selling/ Option Writing
Put a zero in buy price.
Since the turnover is now only around 2 lakhs, your brokerage will be only 20 rupees and not 40 rupees
Remaining all values, you just put zero for Buy Premium, you will get the values.