By
Published: 31 Jan 2002
Performnace is most influenced by
1) the time for selection
2) handling of data
3) Usage of local internal tables
Here is a simple select code for three tables header, item and schedule.
1) The usuage of package size here reduces the internal loop time for
package size for database selection
2)Using package size with select endselect reduces the extra loop
for the internal tables
3) Index selecting and appending the tables takes away the time
required for otherwise moving and appending( hence better handling).
That gives you an efficient code if there is atleast one header, item
and schedule data to be filtered.
SELECT EBELN FROM EKKO INTO TABLE GIT_EKKO PACKAGE SIZE 1000
WHERE EBELN IN S_EBELN AND
BSART IN S_BSART AND
LIFNR IN S_LIFNR AND
EKORG IN S_EKORG AND
EKGRP IN S_EKGRP AND
BEDAT IN S_BEDAT AND
UNSEZ IN S_UNSEZ.
* selection of all Item Pos for all header POs
SELECT EBELN EBELP FROM EKPO INTO TABLE GIT_EKPO PACKAGE SIZE 1000
FOR ALL ENTRIES IN GIT_EKKO
WHERE EBELN EQ GIT_EKKO-EBELN AND
MATNR IN S_MATNR AND
WERKS IN S_WERKS AND
LGORT IN S_LGORT AND
IDNLF IN S_IDNLF.
* selection of all schedules meeting the above criteria
SELECT EBELN EBELP EINDT ETENR MENGE J_3AELIKZ FROM EKET
APPENDING TABLE GIT_EKET
FOR ALL ENTRIES IN GIT_EKPO
WHERE EBELN EQ GIT_EKPO-EBELN AND
EINDT IN S_EINDT.
ENDSELECT. " EKPO
ENDSELECT. "EKKO
Dig Deeper on SAP security