I would create the entity with two input parameters and a complex type for the output table. (Or you can import the model from RFC)
Unless you have a property in the entity, you cannot use it for filtering it.
Then go to runtime implementation and map the data source for the query method.
You can go through this blog to know more.