2009 Oct 28 11:58 AM
Hello,
We need execute the following query:
select KAWRT, KBERT
from KONV
where
KNUMV=VBAK.KNUMV,
KPOSN=VBAK.POSNR,
KSCHL='ZPDE'
but we have a problem because table KONV is a cluster table.
Does anybody know how can we do this?
Thanks in advance and best Regards,
Néstor.
Hello,
We need execute the following query:
select KAWRT, KBERT
from KONV
where
KNUMV=VBAK.KNUMV,
KPOSN=VBAK.POSNR,
KSCHL='ZPDE'
but we have a problem because table KONV is a cluster table.
Does anybody know how can we do this?
Thanks in advance and best Regards,
Néstor.
2009 Oct 28 12:13 PM
You mean you can't use a JOIN because KONV is a cluster table? Use a two step select, first VBAK then KONV with FOR ALL ENTRIES.
Thomas
2009 Oct 28 12:19 PM
you can use for all entries here. I'll show you with an example
select knumv posnr
from vbak as vbak inner join vbap as vbap on vbakvbeln = vbapvbeln
into corresponding fields of lt_data
where " write what ever condition you like
if lt_data[] is not initial. " this chk is needed as if the lt_vbak is blank it will fetch all the records from konv table
select KAWRT, KBERT
from KONV
for all entries in lt_data
where
KNUMV=lt_data-KNUMV,
KPOSN=lt_data-POSNR,
KSCHL='ZPDE'.
endif.
note that there is no posnr in vbak table. so you need to take it from vbap
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |