2012 Dec 24 2:32 PM
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.
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.
2012 Dec 25 4:48 PM
MODERATOR's,
Can you please move my post to General ABAP section??
2012 Dec 27 8:53 AM
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
2012 Dec 27 2:22 PM
Hi,
This is a STD query generated in an FM while activating my PWB form.
Any suugestions.
2012 Dec 27 4:26 PM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |