Friday, November 23, 2007

For all entries in sap abap

The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of
entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the
length of the WHERE clause.

The plus

  • Large amount of data
  • Mixing processing and reading of data
  • Fast internal reprocessing of data
  • Fast
The Minus
  • Difficult to program/understand
  • Memory could be critical (use FREE or PACKAGE size)
Some steps that might make FOR ALL ENTRIES more efficient:
  • Removing duplicates from the the driver table
  • Sorting the driver table

  • If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement:
    FOR ALL ENTRIES IN i_tab
    WHERE mykey >= i_tab-low and
    mykey <= i_tab-high.

Nested selects

The plus:
  • Small amount of data
  • Mixing processing and reading of data
  • Easy to code - and understand
The minus:
  • Large amount of data
  • when mixed processing isn’t needed
  • Performance killer no. 1

No comments:

Blog Archive