title: JOIN of two tables does not return rows
body: <p>I created three tables <code>Z588B</code>, <code>Z588T</code>, <code>ZFINALTABLE</code> which I want to populate using SQL in function builder.</p>
  <p>First I tried to join these tables I got error</p>
  <blockquote>
  <p>for pooled tables cluster tables and projection views join is not allowed</p>
  </blockquote>
  <p>So I created temp table to store the data from <code>T588B</code>, <code>T588T</code> tables so I can join them using the temp tables into the ZFINALTABLE which the output fields that I need.</p>
  <p>I was able to populate <code>Z588B</code>, <code>Z588T</code>  with the data that I need but the JOIN using these temp tables did not return any data.</p>
  <p>My steps:</p>
  <ol>
  <li><p>Created Function Module <code>Z_BAPI_TESTP_FM</code> using SE37</p>
  </li>
  <li><p>In the Import tab I defined the Parameters.</p>
  <pre><code> MANDT   TYPE    ZTESTPA30-MANDT   Client
   USERG   TYPE    ZTESTPA30-USERG   User group
  </code></pre>
  </li>
  <li><p>Declared temp tables that I had created using se11</p>
  <pre><code>Z588B   LIKE    Z588B   Temp Structure for T588B
  Z588T   LIKE    Z588T   Temp Structure for T588T
  Z582S   LIKE    Z582S   Temp Structure for T582S
  
  ZFINALTABLE LIKE Z588BTEST Temp Structure for ZFINALTABLE
  </code></pre>
  </li>
  <li><p>Entered my sql query in the source code.</p>
  <pre><code>
  FUNCTION Z_BAPI_TEST_FM.
     *&quot;----------------------------------------------------------------------
     *&quot;*&quot;Local Interface:
     *&quot;  IMPORTING
     *&quot;     VALUE(MANDT) TYPE  ZTESTPA30-MANDT
     *&quot;     VALUE(USERG) TYPE  ZTESTPA30-USERG
     *&quot;  EXPORTING
     *&quot;     VALUE(RETRUN) TYPE  BAPIRET2
     *&quot;  TABLES
     *&quot;      ZPA30 STRUCTURE  ZPA30
     *&quot;      Z588B STRUCTURE  Z588B
     *&quot;      Z588T STRUCTURE  Z588T
     *&quot;      Z582S STRUCTURE  Z582S
     *&quot;      Z588BTEST STRUCTURE  Z588BTEST
     *&quot;----------------------------------------------------------------------
  
  TABLES: Z588B, Z588T, ZFINALTABLE.
  
     select MANDT USERG MNTYP MENUE INFTY  INTO CORRESPONDING FIELDS OF TABLE Z588B 
     from T588B CLIENT SPECIFIED
     WHERE MANDT = MANDT AND USERG = USERG AND MNTYP = 'I'.
  
     select MANDT SPRSL MNTYP MENUE DTEXT INTO CORRESPONDING FIELDS OF TABLE Z588T
     from T588T CLIENT SPECIFIED
     WHERE MANDT = MANDT AND MNTYP = 'I' AND SPRSL = 'EN'.
  
     Select a~MANDT AS MANDT  a~USERG AS USERG a~MNTYP AS MNTYP a~MENUE AS MENUE 
     a~INFTY AS INFTY b~SPRSL AS SPRSL b~DTEXT As DTEXT
     INTO CORRESPONDING FIELDS OF TABLE ZFINALTABLE
     FROM Z588B  AS a LEFT JOIN Z588T AS b ON a~MNTYP = b~MNTYP.
  
  ENDFUNCTION.
  </code></pre>
  </li>
  </ol>
  <p>Was able to load the data on Z588B, Z588T for the given parameter but the final sql with the join is not returning the data in ZFINALTABLE table.</p>
  <p>Can you anyone tell why the last sql using JOIN is not returning any data in the ZFINALTABLE ?</p>