Hi all @ SAPforums and thanks for your attention,
the task is quite simple: given a Purchase Requisition number and position (banfn, bnfpo) I have to check if a contract with the same PR as source exists in the EKPO table.
In order to check for it, I simply typed the following select:
SELECT SINGLE * FROM EKPO INTO wa_checkekpo
WHERE bstyp EQ 'K'
AND banfn EQ l_eban-banfn
AND bnfpo EQ l_eban-bnfpo.
This kind of query is quite consuming (more than three seconds in my process) due to the fact that banfn and bnfpo don't belong to a key for the table.
Any idea/workaround that can lead to better performance? Please note I'm not interested in retrieving the contract number (KONNR), it's sufficient to know it exists.