Problem solve Get help with specific problems with your technologies, process and projects.

Better performance for selects

Better performance for selects

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

This was last published in January 2002

Dig Deeper on SAP security administration

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close