Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

INNER join with dynamic table name ?

Former Member
0 Kudos

Hi,

I have a problem with this statement.

DATA: g_dso_bic_dofr TYPE tabname.

SELECT t1~/bic/ziparomr
       t2~/bic/zifremom
 INTO (wa_rater_paromr-/bic/ziparomr,
       wa_rater_paromr-/bic/zifremom)

*   FROM /bic/azd0bfr5100 AS t1     "equivalent to the dynamic statement below

" this is the  problem
    FROM (g_dso_bic_dofr )AS t1
    INNER JOIN /bic/pzifremom AS t2 
      ON t1~/bic/ziparomr = t2~/bic/ziparomr 
" --- to here 

    WHERE t1~/bic/zikom     =  v_kommune

The compile check doesnt work when i use the variable table name.

I get

"Wrong expression "INNER" in FROM clause. WHERE condition."

Can anyone help me.

Br Rasmus.

4 REPLIES 4

JozsefSzikszai
Active Contributor
0 Kudos

hi Rasmus,

I tried and it looks like that it does not work...

ec

former_member583013
Active Contributor
0 Kudos

Check my weblog...It might help you -;)

<a href="/people/alvaro.tejadagalindo/blog/2006/12/13/dynamic-inner-join-function-module Inner Join Function Module</a>

Greetings,

Blag.

alejandro_bindi
Active Contributor
0 Kudos
" this is the  problem
*    FROM (g_dso_bic_dofr )AS t1   "<<--- check spaces in here
    FROM (g_dso_bic_dofr) AS t1    "<<--- and here
    INNER JOIN /bic/pzifremom AS t2 
      ON t1~/bic/ziparomr = t2~/bic/ziparomr 
" --- to here 

I think there's the problem, the space behind the parenthesis.

Regards

Former Member
0 Kudos

This is for no reason an illegal statement.

Solved with an internal table and FOR ALL ENTRIES