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

Using inner join on buffered table

Former Member
0 Likes
8,141

Shouldn't inner joins be used on buffered table? and if so why is it so ? Using a buffered table in an inner join gives a warning in Code inspector. What should be done?

7 REPLIES 7
Read only

Former Member
0 Likes
3,082

try using BY PASSING BUFFER option in SELECT


SELECT * 
INTO CORRESPONDING FIELDS OF TABLE lt_obj_links 
BYPASSING BUFFER 
FROM rpm_obj_link AS p 
INNER JOIN 
rpm_obl_obtyp AS f
ON f~object_type = p~object_type
WHERE p~project_guid = lv_item_guid
AND f~application = i_application
AND f~logsys = i_system.

null

Read only

Former Member
0 Likes
3,082

Hi Manisha,

inner joins can be used on buffered tables. infact that improves the performance. the warning will be to caution us to make sure that the buffered tables data is not changed frequently.

Regards,

Vidya.

Read only

0 Likes
3,082

Hello Vidya,

the ABAP documentation (TA ABAPHELP) gives different information (see below), using a join bypasses the SAP buffering. So CI is right in its warning and it maybe worth a try to evalutate 2 (or more subsequents) Open SQL commands to retrieve each table contents seperately, this is usually done with FOR ALL ENTRIES with the result of the prior query statement as input for the next one.

Best Regards,

Klaus


SAP Buffering 
When accessing database tables using Open SQL, SAP buffering is effective as standard if it is activated for the corresponding database table. It can be explicitly deactivated using the addition BYPASSING BUFFER of the statement SELECT. 

In addition to the explicit specification of BYPASSING BUFFER, SAP buffering can also be bypassed implicitly by some variants of the Open SQL statements, as the corresponding operation can only be executed in the database and not in the SAP buffer. 

The following Open SQL statements implicitly bypass the SAP buffer and access the database tables directly: 

SELECT with the addition FOR UPDATE, 
SELECT with the addition DISTINCT, 
SELECT with aggregate expressions, 
Access to a table with single record buffering without linked equality conditions specified for all key fields of the primary key in theWHERE condition withAND,Open SQL statement with the addition CLIENT SPECIFIED, without specification of the client ID in a WHERE condition, 
SELECT with JOIN expressions 
Access to a generically buffered area without full specification in a WHERE condition 
Open SQL statements with IS [NOT] NULL in the additions WHERE and HAVING, 
Use of a subquery in a WHERE condition, 
SELECT with the addition GROUP BY, 
SELECT with the addition ORDER BY, whereby the sort key is not the primary key. 

Read only

Former Member
0 Likes
3,082

Hi Manisha,

the two prior postings already answers parts of your question (from my point of view). But may be an other perspective is helpful.

The answer to your first question is no. You may use inner joins on buffered tables. Therefore the second question is irrelevant.

The reason for the warning in the code inspector is that the access to the buffered table is not buffered any more if you join the table. This happens because the database interface is neither able to join tables within buffer nor tables in buffer with tables in the database. Therefore the option bypassing buffer could remove the warning.

Regards

Ralph

Read only

Former Member
0 Likes
3,082

type this code beside select statement

"#EC CI_BUFFJOIN

Error will be solved in code inspector

Read only

0 Likes
3,082

Please look at the original date of the question before replying, usually it is meaningless to add another reply after six years, especially since the question was answered already.

Also, these "#EC comments do not solve anything, they just suppress the corresponding message.

Thomas

Read only

3,082

hi thomas

my way of thinking is if anyone search these type of errors they will see replies also.may be my reply will be useful to that person so that's why i posted. i solved this error in my program.