2009 Aug 14 11:36 AM
Hi all,
I doing performance tuning for report .
when i checked in ST05 , the below 2 statements is taking more time eventhough i tried to reduce as much as possible .
SELECT ebeln
EBELP
BEWTP
BWART
budat
MATNR
werks
FROM EKBE INTO TABLE T_EKBE
WHERE BUDAT IN S_EINDT
AND matnr in so_matnr
AND WERKS IN S_WERKS
AND BEWTP EQ 'E'
AND BWART IN ('101','105').
IF NOT t_ekbe[] IS INITIAL.
SELECT ebeln
ebelp
etenr
eindt
menge
wemng
FROM EKET INTO TABLE T_EKET
FOR ALL ENTRIES IN T_EKBE
WHERE EBELN = T_EKBE-EBELN
AND EBELP = T_EKBE-EBELP.
Please suggest how to reduce the time taken.
regards
chetan
2009 Aug 14 1:37 PM
Maybe you can first access EKET (index on EINDT) and then EKBE, if you normally have a small selection range in S_EINDT. Even better, use a JOIN and let the optimizer decide about the best access path.
Thomas
Hi all,
I doing performance tuning for report .
when i checked in ST05 , the below 2 statements is taking more time eventhough i tried to reduce as much as possible .
SELECT ebeln
EBELP
BEWTP
BWART
budat
MATNR
werks
FROM EKBE INTO TABLE T_EKBE
WHERE BUDAT IN S_EINDT
AND matnr in so_matnr
AND WERKS IN S_WERKS
AND BEWTP EQ 'E'
AND BWART IN ('101','105').
IF NOT t_ekbe[] IS INITIAL.
SELECT ebeln
ebelp
etenr
eindt
menge
wemng
FROM EKET INTO TABLE T_EKET
FOR ALL ENTRIES IN T_EKBE
WHERE EBELN = T_EKBE-EBELN
AND EBELP = T_EKBE-EBELP.
Please suggest how to reduce the time taken.
regards
chetan
2009 Aug 14 11:48 AM
Hi
The problem should be in the SELECT of EKBE, here u don't use any key fields, I don't know the logic of your program in order to find out the jey fields value before selecting EKBE data.
So u should consider if it needs to create a secondary index with the fields you're using in the select.
Max
2009 Aug 14 11:51 AM
in addition, keep in mind that EKBE tends to get very big, especially if you are working with framework orders or contracts. to reduce the size, try to move the data to EKBEH using RM06EKBE.
2009 Aug 14 1:37 PM
Maybe you can first access EKET (index on EINDT) and then EKBE, if you normally have a small selection range in S_EINDT. Even better, use a JOIN and let the optimizer decide about the best access path.
Thomas
2009 Aug 14 2:45 PM
1) Create an index on database table EKET on field BUDAT.
2) On the selection screen make field BUDAT mandatory.
2009 Aug 17 8:05 AM
Itu2019s required to create an index to BUDAT and change the query like below.
FROM EKBE INTO TABLE T_EKBE
WHERE BUDAT IN S_EINDT
AND matnr in so_matnr
AND WERKS
AND BEWTP EQ 'E'
AND BWART EQ u2018101u2019 OR u2018105'.
Sunitha.
2009 Aug 17 9:54 AM
Hi,
Use all the primary keys of table EKBE as done in below code.
TABLES: S001.
CONSTANTS: SSOUR_INI LIKE S001-SSOUR VALUE IS INITIAL,
VRSIO_INI LIKE S001-VRSIO VALUE IS INITIAL,
SPMON_INI LIKE S001-SPMON VALUE IS INITIAL,
SPTAG_INI LIKE S001-SPTAG VALUE IS INITIAL,
SPWOC_INI LIKE S001-SPWOC VALUE IS INITIAL,
SPBUP_INI LIKE S001-SPBUP VALUE IS INITIAL.
DATA: TA_S001 TYPE STANDARD TABLE OF S001.
DATA: WA_S001 TYPE S001.
SELECT-OPTIONS:
SO_SPTAG FOR S001-SPTAG OBLIGATORY,
SO_KUNNR FOR S001-KUNNR OBLIGATORY,
SO_VKORG FOR S001-VKORG OBLIGATORY,
SO_VTWEG FOR S001-VTWEG OBLIGATORY,
SO_SPART FOR S001-SPART OBLIGATORY,
SO_MATNR FOR S001-MATNR OBLIGATORY.
START-OF-SELECTION.
SELECT * FROM S001
INTO TABLE TA_S001
WHERE SSOUR GE SSOUR_INI "Greater Equal initial value
AND VRSIO GE VRSIO_INI " idem
AND SPMON GE SPMON_INI " idem
AND SPTAG IN SO_SPTAG
AND SPWOC GE SPWOC_INI " idem
AND SPBUP GE SPBUP_INI " idem
AND KUNNR IN SO_KUNNR
AND VKORG IN SO_VKORG
AND VTWEG IN SO_VTWEG
AND SPART IN SO_SPART
AND MATNR IN SO_MATNR.
You will definately find some improvement...
Thanks,
Krishna
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |