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

Regd Select Q

SG141
Active Participant
0 Likes
432

I am writing a select query...


  select l~lgpla
         l~lgnum
         l~lgtyp
         l~lgber
         l~verif
         m~matnr
         into table t_bin
         from lagp as l
         left outer join
         lqua as m
         on l~lgpla = m~lgpla
         where l~lgtyp = p_lgtyp
         and   l~lgnum = p_lgnum
         and   verif < l_date
         and   verif ne ' '.

I want to retrieve all lgpla with has no matnr...(matnr is empty)..

How can i modify the code..

3 REPLIES 3
Read only

Former Member
0 Likes
400

Try like this :

select l~lgpla

l~lgnum

l~lgtyp

l~lgber

l~verif

m~matnr

into table t_bin

from lagp as l

left outer join

lqua as m

on llgpla = mlgpla

where l~lgtyp = p_lgtyp

<b> and m~matnr = ''</b>

and l~lgnum = p_lgnum

and verif < l_date

and verif ne ' '.

Read only

SG141
Active Participant
0 Likes
400

Seshu it's working

I want to write two select queries

first I'll lgpla etc from lagp table.

then using matnr from lqua table.

How to write that query.

Read only

0 Likes
400

declare internal table as you required

select * into table int_table

from lqua as a inner join lagp as b on algnum = blgnum

where b~matnr = ''.

I would suggest always inner join than outer join -> outer join is performance issue.

Thanks

Seshu