title: Most efficient way to select data set conditional upon each other from multiple tables
body: <p>I have an internal table like:</p>
  
  <pre><code>TYPES: BEGIN OF gty_min_jobs,
              orgeh TYPE zgerpt_rnk_min-orgeh1,
              mnsty TYPE zgerpt_rnk_min-mnsty,
              mshort TYPE zgerpt_rnk_min-mshort,
  
              position TYPE hrp1001-sobid,
              job TYPE hrp1001-sobid,
  
              job_grade TYPE hrp9003-jobgr,
              scheme TYPE hrp9003-pg,
      END OF gty_min_jobs.
  
  DATA: gt_min_jobs TYPE TABLE OF gty_min_jobs,
        gwa_min_jobs TYPE gty_min_jobs.
  </code></pre>
  
  <p>I need to populate this table from 3 different database tables: zgerpt_rnk_min, hrp1001 and hrp9003.</p>
  
  <p>I need to: </p>
  
  <pre><code>SELECT orgeh msty mshort FROM zgerpt_rnk_min INTO gt_table1.
  
  SELECT position FROM hrp1001 INTO gt_table2 
    FOR ALL ENTRIES IN gt_table1 
      WHERE objid = gt_table1-orgeh AND
                 otype = 'O' AND
                 sclas = 'S' AND
                 begda LE p_keydt AND
                 endda GE p_keydt AND
                 plvar ='01' AND
                 istat = '1' AND
         objid IN (pnpobjid).
  
  SELECT job FROM hrp1001 INTO gt_table3 
    FOR ALL ENTRIES IN gt_table2 
      WHERE objid = gt_table2-position AND
               otype = 'S' AND
               sclas = 'C' AND
               begda LE p_keydt AND
               endda GE p_keydt.
  
  SELECT job_grade scheme FROM hrp9003 INTO gt_table4 
    FOR ALL ENTRIES IN gt_table3
       WHERE objid =  gt_table3-job AND
          begda LE p_keydt AND
          endda GE p_keydt.
  </code></pre>
  
  <p>Combining my data into my internal table using various loops. What is the most efficient way to do this? Is it possible to select all the required data in one go using an inner join? If so how would I incorporate all the WHERE conditions? Appreciate any pointers!</p>