Application Development and Automation 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: 
Read only

INNER join with dynamic table name ?

Former Member
0 Likes
2,021

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
Read only

JozsefSzikszai
Active Contributor
0 Likes
760

hi Rasmus,

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

ec

Read only

Former Member
0 Likes
760

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.

Read only

alejandro_bindi
Active Contributor
0 Likes
760
" 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

Read only

Former Member
0 Likes
760

This is for no reason an illegal statement.

Solved with an internal table and FOR ALL ENTRIES