2007 Aug 10 12:49 PM
Hi,
I have a code to modify for its performance issues.
I found some queries in it containing FOR ALL ENTRIES and INNER JOIN .
Is it ok to blindly change these lines with something or some other reasons are there with the code for performance issues.
If something is to be done with FOR ALL ENTRIES, then please suggest an alternative for the following lines.
SELECT gpart vkont
INTO TABLE t_bpca
FROM fkkvkp
FOR ALL ENTRIES IN t_respart
WHERE gpart = t_respart-partner
AND opbuk NE c_siebel
AND vkpbz = 'AC'.
What is an alternative for INNER JOINS ?
2007 Aug 10 12:50 PM
You can check the below code -
SELECT BUKRS BELNR GJAHR AUGDT
FROM BSEG
INTO TABLE I_BSEG
WHERE BUKRS = ....
SELECT BUKRS BELNR BLART BLDAT
FROM BKPF
INTO TABLE I_BKPF
FOR ALL ENTRIES IN I_BSEG
WHERE BUKRS = I_BSEG-BUKRS
AND BELNR = I_BSEG-BELNR
AND BLDAT IN SO_BLDAT.
*******************************8
look another example
what is the use of FOR ALL ENTRIES
1. INNER JOIN
DBTAB1 <----
> DBTAB2
It is used to JOIN two DATABASE tables
having some COMMON fields.
2. Whereas
For All Entries,
DBTAB1 <----
> ITAB1
is not at all related to two DATABASE tables.
It is related to INTERNAL table.
3. If we want to fetch data
from some DBTABLE1
but we want to fetch
for only some records
which are contained in some internal table,
then we use for alll entries.
*----
1. simple example of for all entries.
2. NOTE THAT
In for all entries,
it is NOT necessary to use TWO DBTABLES.
(as against JOIN)
3. use this program (just copy paste)
it will fetch data
from T001
FOR ONLY TWO COMPANIES (as mentioned in itab)
Hi,
I have a code to modify for its performance issues.
I found some queries in it containing FOR ALL ENTRIES and INNER JOIN .
Is it ok to blindly change these lines with something or some other reasons are there with the code for performance issues.
If something is to be done with FOR ALL ENTRIES, then please suggest an alternative for the following lines.
SELECT gpart vkont
INTO TABLE t_bpca
FROM fkkvkp
FOR ALL ENTRIES IN t_respart
WHERE gpart = t_respart-partner
AND opbuk NE c_siebel
AND vkpbz = 'AC'.
What is an alternative for INNER JOINS ?
2007 Aug 10 12:50 PM
You can check the below code -
SELECT BUKRS BELNR GJAHR AUGDT
FROM BSEG
INTO TABLE I_BSEG
WHERE BUKRS = ....
SELECT BUKRS BELNR BLART BLDAT
FROM BKPF
INTO TABLE I_BKPF
FOR ALL ENTRIES IN I_BSEG
WHERE BUKRS = I_BSEG-BUKRS
AND BELNR = I_BSEG-BELNR
AND BLDAT IN SO_BLDAT.
*******************************8
look another example
what is the use of FOR ALL ENTRIES
1. INNER JOIN
DBTAB1 <----
> DBTAB2
It is used to JOIN two DATABASE tables
having some COMMON fields.
2. Whereas
For All Entries,
DBTAB1 <----
> ITAB1
is not at all related to two DATABASE tables.
It is related to INTERNAL table.
3. If we want to fetch data
from some DBTABLE1
but we want to fetch
for only some records
which are contained in some internal table,
then we use for alll entries.
*----
1. simple example of for all entries.
2. NOTE THAT
In for all entries,
it is NOT necessary to use TWO DBTABLES.
(as against JOIN)
3. use this program (just copy paste)
it will fetch data
from T001
FOR ONLY TWO COMPANIES (as mentioned in itab)
2007 Aug 10 12:51 PM