Hi Arpita,
I think you are trying to use a Calc view where you should use a Procedure. The Calc view expects output for var_out which is TABLE_TYPE parameter.
I think you can use a procedure and use the internal_id and any output variable as IN and OUT parameters and put your logic in that.
Since you did not specify how do you wish to use this logic, I am not sure if Calc view is what you actually need. So try with a procedure first.
Regards,
Ravi