Hi,
This may help you to create dynamic where clause.
Check this link for Dynamic query
http://****************/Tutorials/ABAP/DynamicSelect/Demo.htm
Use the following function modules to help build your dynamic where clauses for your select statements....
DYNSQL_GENERATE_WHERE_CLAUSE
CONVERT_SELECT_INTO_WHERE
FREE_SELECTIONS_RANGE_2_WHERE
ADSPC_CREATE_WHERE_CLAUSE
Points appreciated...
Thanks & Regards,
Lokesh