‎2007 Jun 22 5:50 PM
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..
‎2007 Jun 22 5:58 PM
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 ' '.
‎2007 Jun 22 6:01 PM
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.
‎2007 Jun 22 6:21 PM
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