Hi Sajid,
Like Vadim said. You have transaction data corresponding to an intersection of different dimension members.
If this is the scenario then :
1) you can pass the base members of SUBTOT from the logic script into your Badi code
2) collect the base dimension members(passed from script) in an internal table in your Badi code.
3) Use it to scope your Master data.
4) retrieve the transaction data based on the scoped master data.
5) get the sum of transaction data on criteria of dimension members [BAS(SUBTOT)] you passed from the script into your Badi code.
Regards,
SHUBHAM