Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Select/Join/For all entries statement optimalization

kroslaniec
Explorer
0 Kudos
868

I am new to a SAP OpenSQL syntax and I have a task to do, which I have no idea how to proceed with.My select statement looks like this:

SELECT * INTO CORRESPONDING FIELDS OF TABLE t_t042z
  FROM t042z AS t042z INNER JOIN t001 as t001
  ON t042z~land1 = t001~land1
  FOR ALL ENTRIES IN t_main
  WHERE t001~bukrs = t_main-bukrs

I need to resolve all the warnings from code inspector, and I have two of them here:

Buffered table T001 in a JOIN.
Buffered table T042Z in a JOIN.

From what I understand we wouldn't benefit from buffering in case of T042z because WHERE is not on the key, but how can I transform the selection of data from T001 to optimize this and resolve this warning? I don't want to use the pseudo code if there's another way to do that. Info from SAP about this warning:

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
780

As a rule-of-thumb, let's say data in application server is 100 times faster than getting data from database server, because it's just memory access, no network communication.

It just says that if you read all the lines from T001 first (same company), then from T042Z for each country from T001, it will be very very fast.

Read only

FredericGirod
Active Contributor
0 Kudos
780

I think you have a bypassingbuffer option to force the join