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

select querry

Former Member
0 Likes
934

hi experts.

SELECT * INTO CORRESPONDING FIELDS OF TABLE it_sym FROM ismp

JOIN ismitop ON ( ismpismnr = ismitopismnr )

JOIN ismitpr ON ( ismpismnr = ismitprismnr )

WHERE ismp~ismnr IN s_sympt.

i am using this select querry but when the ismnr is not mensioned in any of ismitop or ismitpr but is ther e in ismp. the table it_sym is null.

i want full join. how should i write.

plz suggest the code.

with regards

ajay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
890

specify the table name against the fieldsto be picked from

Eg: select ismp~ismnr

ismp~< >

ismp~< >

from ........

9 REPLIES 9
Read only

Former Member
0 Likes
890

Try using left join instead of join.

Read only

0 Likes
890

but when i used the left join the internal table doesnot have ismnr field value. why it is so ?

Read only

Former Member
0 Likes
890

Remove INTO CORRESPONDING FIELDS OF it hampers the performance of the table.

Split the select query into two select queries .

SELECT * INTO CORRESPONDING FIELDS OF TABLE it_sym FROM ismp

LEFT OUTER JOIN ismitop ON ( ismpismnr = ismitopismnr )

WHERE ismp~ismnr IN s_sympt.

OR:

SELECT * INTO CORRESPONDING FIELDS OF TABLE it_sym FROM ismp

JOIN ismitop ON ( ismpismnr = ismitopismnr )

WHERE ismp~ismnr IN s_sympt.

THEN

Use:For All entries in IT_SYM For last join JOIN ismitpr ON ( ismpismnr = ismitprismnr )

Regards,

Gurpreet

Read only

0 Likes
890

For All entries in IT_SYM For last join JOIN ismitpr ON ( ismpismnr = ismitprismnr )

creating syntex error.

Read only

0 Likes
890

hi gurpreet

has u told me to write this one.

SELECT * INTO CORRESPONDING FIELDS OF TABLE it_sym FROM ismp

LEFT OUTER JOIN ismitop ON ( ismpismnr = ismitopismnr )

WHERE ismp~ismnr IN s_sympt.

use: For All entries in IT_SYM For last join JOIN ismitpr ON ( ismpismnr = ismitprismnr ).

use is not a valid key word.. it is saying like that.

plz help me.

ajay

Read only

Former Member
0 Likes
890

hello,

use LEFT OUTER JOIN

With regards

Ajantha R

Read only

Former Member
0 Likes
890

Because left join brings the join only when it exists, but preserves the left part even if the right part is absent.

Read only

Former Member
0 Likes
891

specify the table name against the fieldsto be picked from

Eg: select ismp~ismnr

ismp~< >

ismp~< >

from ........

Read only

0 Likes
890

select ismp~ismnr

ismp~ismtp

ismp~ismart

ismp~objnr

ismp~valdtfrm

ismp~valdtto

ismitop~opgrp

ismitop~opcod

ismitpr~prgrp

ismitpr~prcod

from ( ismp LEFT JOIN ismitop ON ( ismpismnr = ismitopismnr )

LEFT JOIN ismitpr ON ( ismpismnr = ismitprismnr ) )

into corresponding fields of table IT_SYM

WHERE ismp~ismnr IN s_sympt.

even after writing this the record has not been fetched if the data is not mainsioned in any table of corresponding ismnr.

please help..

ajay