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: 

transform 2 select to Join

former_member810309
Participant
0 Kudos

hi all

I'm trying to transform these 2 selects query into a signle query with inner join or join ! (don't know what i should use).

thanks.

SELECT SINGLE reference 
FROM e070a
INTO lv_reference
WHERE trkorr EQ ls_result-trkorr
AND attribute EQ 'lc_scp'.
IF sy-subrc EQ 0.
SELECT SINGLE externalid
FROM ctsproject
INTO ls_result-externalid
WHERE trkorr EQ lv_reference.
IF sy-subrc EQ 0. ENDIF.
ENDIF.
1 ACCEPTED SOLUTION

venkateswaran_k
Active Contributor

Hi

  SELECT SINGLE externalid
   FROM ctsproject as a INNER JOIN e070a as b on a~trkorr EQ b~reference
   INTO ls_result-externalid
   WHERE B~attribute EQ 'lc_scp' AND
         B~TRKORR EQ LS_RESULT-TRKORR.

Regards,

Venkat

4 REPLIES 4

venkateswaran_k
Active Contributor

Hi

  SELECT SINGLE externalid
   FROM ctsproject as a INNER JOIN e070a as b on a~trkorr EQ b~reference
   INTO ls_result-externalid
   WHERE B~attribute EQ 'lc_scp' AND
         B~TRKORR EQ LS_RESULT-TRKORR.

Regards,

Venkat

0 Kudos

THANKS A LOT MR VENKAT

Sandra_Rossi
Active Contributor

If your question is "what is the difference between inner join and join", the answer is none. JOIN is the short form of INNER JOIN, but I think it's best to use INNER JOIN to not confuse with other forms of joins (left (outer) join, right join, cross join).

former_member810309
Participant
0 Kudos

sandra.rossi it wasn't my question but thanks for the explanation.