I'm writing a BSP and according to user-input I have to choose data from different DB tables. These tables have been in different packages. Can you really specify the table I wish to use, according to its path, such as this:

data: path1 type string value 'package1/DbTableName',
      path2 type string value 'package2/OtherDbTableName',
      table_to_use type string.

if some condition
table_to_use = path1.    
elseif some condition
table_to_use = path2.    

select *
from table_to_use



I'm a new comer to ABAP &lifier Open SQL and am aware this may be a simpleOrfoolish question :) Any help whatsoever could be greatly appreciated!

You are able to define the title on the table to use within a flexible, after which make use of the variable within the FROM close of the request :

data tableName type tabname.  
if <some condition>.   
select * from (tableName) where ...

you will find a couple of limitation for this method, because the stable can't consists of fields of type RAWSTRING, STRING or SSTRING.

for the truth that the table have been in different package, i do not think it matters.