2008 Nov 20 5:00 AM
Hi,
I have a requirement that in qals table i get lot no.s & in qamr table i can get multiple entries for a single lot. I need to get single record from qamr table for all entries in qals table's lot at a single shot.
pl anybody help me how to do.
2008 Nov 20 11:25 AM
Hi,
if you want in singel shot use inner joins.
select l~PRUEFLOS
l~WERK
l~b
l~c
k~VORGLFNR
k~ab
k~bc
k~ca
into corresponding fields of table it_join
from QALS as l inner join QAMR as k on lPRUEFLOS eq kPRUEFLOS
where l~ebeln in s_ebeln AND
k~ab IN s_ab.
where a, b, c, ab, bc, ca are other fields/.
Thsi may full fill ur requirement.
Thanks & regards
2008 Nov 20 5:09 AM
2008 Nov 20 9:03 AM
Hi
Do u mean that for single Lot you shd get single entry instead of multiple entries.
Please Clarify this
Regards
Rasheed
2008 Nov 20 11:25 AM
Hi,
if you want in singel shot use inner joins.
select l~PRUEFLOS
l~WERK
l~b
l~c
k~VORGLFNR
k~ab
k~bc
k~ca
into corresponding fields of table it_join
from QALS as l inner join QAMR as k on lPRUEFLOS eq kPRUEFLOS
where l~ebeln in s_ebeln AND
k~ab IN s_ab.
where a, b, c, ab, bc, ca are other fields/.
Thsi may full fill ur requirement.
Thanks & regards
2008 Nov 20 11:33 AM
select PRUEFLOS .... from QALS into it_qals ..............
if not it_qals[] is initial.
select PRUEFLOS .... from QAMR into it_qamr
for all entries in it_qals
where PRUEFLOS eq it_qals-PRUEFLOS ..............
endif.
sort it_qamr by PRUEFLOS.
delete adjacent duplicates from it_qamr comparing PRUEFLOS.
2008 Nov 22 5:16 AM
Ans to my q's is.................
this is the code i used for it.
select PRUEFLOS
WERK
field1
field2.........
from qals into table itab where <cond>.
if sy-subrc eq 0.
select prueflos
from qamr into table itab2
for all entries in itab
where prueflos eq itab-prueflos
group by prueflos.
endif.
I heard that sap 6 ecc doesn't recommend innerjoins so i used the above 1.