cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple entries for same select statement observed in SQL trace

0 Kudos

Hi All,

I have the below select statement in my code:

SELECT vbrk~vbeln

         vbrk~kdgrp

         tvfk~numki

         INTO TABLE t_num_range

         FROM vbrk JOIN tvfk

         ON vbrk~fkart EQ tvfk~fkart

         FOR ALL ENTRIES IN t_bkpf

         WHERE vbeln EQ t_bkpf-belnr.

When I see for this select statement in ABAP trace (St12), the number of executions are 1 with net runtime as 849 milli seconds.

But when i navigate to the SQL trace (click on the DB link in the abap trace itself in ST12) , I see 2 entries for this SQL.

The first entry has 1748  executions with runtime 659 milli seconds and the second entry has 1 as number of executions.

The SQL is called from the same code line in both entries and there is no change in the select statement.

I am wondering since this is a JOIN with FOR ALL ENTRIES, i see double entries, if yes please clarify why we have double entries?

Thanks in advance!!

BR,Karun.

Accepted Solutions (0)

Answers (1)

Answers (1)

ACE-SAP
Active Contributor
0 Kudos

Hi

This is the normal effect of SAP DBSL SQL code translation.

You can find a lot of post on SCN that will help you to understand this behavior...

Regards

634263 - Selects with FOR ALL ENTRIES