on 10-07-2008 2:18 PM
hi all Performance issue
SELECT VBRP~VBELN
VBRP~POSNR
VBRP~AUBEL
VBRP~AUPOS
VBRP~FKIMG " VBRP
VBRK~FKDAT " VBRK
INTO TABLE T_VBRK
FROM VBRP
INNER JOIN VBRK ON VBRKVBELN = VBRPVBELN
WHERE VBRK~VBELN IN S_VBELN AND -
> this is always BLANK
VBRK~FKART NOT IN R_FKART AND
VBRK~FKDAT IN S_FKDAT AND
VBRK~SPART IN S_SPART AND
VBRP~AUBEL IN S_KDAUF. -
> this is always BLANK
Due to the ABAOVE the below statement is taking many hours to execute
SELECT BUKRS
BELNR
GJAHR
AWKEY
INTO TABLE T_SVBKPF
FROM BKPF
FOR ALL ENTRIES IN T_VBRK
WHERE BUKRS IN S_BUKRS AND
BUDAT = T_VBRK-FKDAT AND
AWKEY = T_VBRK-AWKEY.
-
1) Is S_VBELN needed as we can vet vbeln based on VBRK~FKDAT.
Regards
babu
Hello
Modify following query:
SELECT BUKRS
BELNR
GJAHR
AWKEY
INTO TABLE T_SVBKPF
FROM BKPF
FOR ALL ENTRIES IN T_VBRK
WHERE BUKRS IN S_BUKRS AND
BUDAT = T_VBRK-FKDAT AND
AWKEY = T_VBRK-AWKEY.
To
SELECT BUKRS
BELNR
GJAHR
AWKEY
INTO TABLE T_SVBKPF
FROM BKPF
FOR ALL ENTRIES IN T_VBRK
WHERE AWTYP IN GR_AWTYP AND
AWKEY = T_VBRK-AWKEY AND
AWSYS IN GR_AWSYS AND
BUKRS IN S_BUKRS AND
BUDAT = T_VBRK-FKDAT.
Here AWTYP, AWKEY, AWSYS will use the Index which will make query to run faster.
Thanks
Amol Lohade
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Babu,
You are facing this issue because in table VBRK the only key field is VBELN and in your selection query s_vbeln is always blank. If you want to have better performance then I think you need to create an index on table VBRK. You can include FKART and FKDAT in your index.
Regards,
Sanjay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To access BKPF you should use one of it's secondary indexes. Since you are using budat and awkey, some fields are missing here:
1 - AWTYP for index 4: AWTYP - AWKEY - AWSYS OR
2 - BSTAT for index 2: BUKRS - BSTAT - BUDAT.
If s_vbeln is always blank, you can remove it from select. But, why is it always blank?
Regards,
Valter Oliveira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.