title: Specifying a DB table dynamically? Is it possible?
body: <p>I am writing a BSP and based on user-input I need to select data from different DB tables. These tables are in different packages. Is it possible to specify the table I want to use, based on its path, like this:</p>
  
  <pre><code>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.    
  endif.
  
  select *
  from table_to_use
  
       ...
  
  endselect
  </code></pre>
  
  <p>I am new to ABAP &amp; Open SQL and am aware this could be an easy/silly question :) Any help at all would be very much appreciated!</p>