2008 Nov 24 6:31 AM
me using these three select
this taking hell lot of time.. any ways to improve these..
for all entries taking more then tht.. so please dont suggest tht.
its critial issue help me out..
SELECT BWERKS AVBELN B~MATNR
AFKDAT ASPART AVTWEG AERDAT A~ERZET
BVGBEL BAUBEL
A~FKART "Added by Arun pandey 08/05/2007
BNETWR BFKIMG B~MWSBP
FROM VBRP AS B
JOIN VBRK AS A ON AVBELN = BVBELN INTO TABLE IT_INV
WHERE A~FKART IN S_FKART
AND ( ASPART IN S_SPART AND ASPART 'ST' )
AND A~FKDAT IN S_FKDAT
AND ( AVTWEG IN S_VTWEG AND AVTWEG 'ST' )
AND A~FKSTO 'X'
AND A~KUNAG IN S_CUST
AND B~WERKS = S_WERKS.
SELECT AVBELN BPOSNR BMATNR BVGBEL AKUNNR AERDAT A~ERZET
ALFDAT BLFIMG
FROM LIKP AS A JOIN LIPS AS B ON AVBELN = BVBELN
INTO TABLE IT_DELV
FOR ALL ENTRIES IN IT_INV
WHERE A~VBELN = IT_INV-VGBEL
AND B~MATNR = IT_INV-MATNR.
SELECT AVBELN ABSTNK AAUART AKUNNR
AVKBUR AVKGRP BNAME1 BORT01
FROM VBAK AS A JOIN KNA1 AS B ON AKUNNR = BKUNNR
INTO TABLE IT_ORDER
FOR ALL ENTRIES IN IT_DELVHEAD
WHERE A~VBELN = IT_DELVHEAD-VGBEL.
2008 Nov 24 6:43 AM
Hi,
For your query,
Try giving as many primary keys in where condition as possible.
IF still not problem solved then try using indexes.
this will help you out.
Thanks & Regards
2008 Nov 24 6:38 AM
hi,
1. try to use as many key fields as possible in select statement.
2. use secondary index for those tables.
also check the statements using different key combinations using se30 or st05 transactions.
2008 Nov 24 6:43 AM
Hi,
For your query,
Try giving as many primary keys in where condition as possible.
IF still not problem solved then try using indexes.
this will help you out.
Thanks & Regards
2008 Nov 24 6:43 AM
Hi,
Before using for all entries :
1. Check whether the table is initial or not.
IF NOT IT_INV[] IS INITIAL.
SELECT A~VBELN B~POSNR B~MATNR B~VGBEL A~KUNNR A~ERDAT A~ERZET
A~LFDAT B~LFIMG
FROM LIKP AS A JOIN LIPS AS B ON A~VBELN = B~VBELN
INTO TABLE IT_DELV
FOR ALL ENTRIES IN IT_INV
WHERE A~VBELN = IT_INV-VGBEL
AND B~MATNR = IT_INV-MATNR.
ENDIF.
Thanks & Regards,
Navneeth K.
2008 Nov 24 6:50 AM
Hi,
before using for all entries
check if not itab[] is intial.
this is mandatory.
Thanks & Regards,
Sudheer
2008 Nov 24 6:51 AM
Hi,
I encounter the performance issues of extracting SD tables, and I solved the puzzle using FOR ALL ENTRIES statement.
E.g.
* Define driver table from VBRK
SELECT VBELN FKSTO ....
INTO TABLE TA_VBRK
FROM VBRK
WHERE VBELN IN SO_VBELN....
IF SY-SUBRC = 0.
* Extract Item entries based on Driver Table
SELECT VBELN POSNR ....
INTO TABLE TA_VBRP
FROM VBRP
FOR ALL ENTRIES IN TA_VBRK
WHERE VBELN = TA_VBRK-VBELN
AND FKIMG GT 0.
ENDIF.
Hope the above helps.
Regards,
Patrick