what is e_t_range where we are storing our result and why it's needed , is it called somewhere
The purpose of the BEx C.Exit is to populate a query variable. The purpose of a query variable is to filter the report. So your C.Exit must somehow (this "somehow" is your logic) derive the values by which the query must be filtered. When the C.Exit derives it, it must place the filter values within the e_t_range table as the query will look at that while filtering the data.
This is a simplified version of events which doesn't fully explain formula variables etc. but for now this explanation should get you going.
l_s_range type RSR_S_RANGESID
Is the work area corresponding to e_t_range. When you need to filter a table, you need to provide SIGN (Include/Exclude), Option (Equals,Greater than etc), Low and High - the same things you do in SE16 or LISTCUBE or any other selection screen in SAP. The l_s_range work area contains those same four fields and these must be filled by the code, and the l_s_range must then be appended to e_t_range.