Application Development 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: 

Inner join timeouts & dumps

ricky_shaw
Contributor
0 Kudos

Hello Experts,

This is a simple select query from STD SAP Function Module  /1PWB/20020120307183419.

This  should actually fail as there are no matching entries between the tables DFKKKO & DFKKOP.

But, code stops here, does not go thru and is taking 2 hrs and finally dumps.

* Select any collective document cleared after the previous invoice and before or during the current collective invoice.


  select  *  appending corresponding fields of table lt_abwbl_docs
    from  dfkkko as h  inner join  dfkkop as l
      on   h~opbel = l~augbl
where  augst = 9
     and  abwtp = ' '
     and  ( vkont = x_cdoc_head-vkont or abwkt = x_cdoc_head-vkont )
     and  ( cpudt > wa_cprev_doch-cpudt  or
( cpudt = wa_cprev_doch-cpudt and cputm > wa_cprev_doch-cputm ) )
     and  ( cpudt < gt_ccurr_doch-cpudt  or
( cpudt = gt_ccurr_doch-cpudt and cputm <= gt_ccurr_doch-cputm ) ).

Please suggest.

4 REPLIES 4

ricky_shaw
Contributor
0 Kudos

MODERATOR's,

Can you please move my post to General ABAP section??

murtuza_chhatariya
Active Participant
0 Kudos

Hi,

I do not think this as simple query.

Look at the where clause, OR < <= > are used and that too with Inner join.

Another thing,  /1PWB/20020120307183419 is basically generated from your application form. You need to find this code in your application form and modify the query.

I suggest to break down the query in small queries, that will reduce the query time.

May be, first query on table DFKKKO based on vkont and then use FOR ALL ENTRIES on table DFKKOP and filter remaining data.

Or vice versa, first query on DFKKOP and then on DFKKKO.

Thanks,

Murtuza

0 Kudos

Hi,

This is a STD query generated in an FM while activating my PWB form.

Any suugestions.

0 Kudos

Hello.

A sql trace with the execution plan would be helpfull for starters.

Since it is christmas, I can not check to which of the tables the columns in the where clause belong, so it would be helpfull, if you could list this information, esp. for

- augst

- abwtp

- vkont

- abwkt

- cpudt

and which of these are already part of any index.

Volker