Hi Sastry,
if you only specifc the field REFDOCNO of table /SCDL/DB_REFDOC then no index will be used at all. So a full table scan is done (which will then also explain your runtime).
This is a normal behavior of any database.
To improve the performance either use the key fields (which is I assume not what you want) or use an existing index.
There is for example the index REF of this database table.
There you will see that the index has the following fields:
| DOCCAT | Document Category |
| REFDOCCAT | Reference Document Category |
| REFDOCNO | Reference Document Number |
| REFITEMNO | Reference Item Number |
| REFBSKEY | Key Name of Business System |
So besides REFDOCNO you should specify DOCCAT (if you e.g. want to select PDI= inbound deliveries or PDO= outbound deliveries,...) and REFDOCCAT (so that the system knows that you mean the ERP inbound delivery number, as there are also many other reference document numbers).
For example /SCDL/IF_DL_DOC_C=>SC_DOCCAT_ERP is the constant for the ERP document number.
In general please use the existing views rather then the DB table. Here: /SCDL/V_REFDOC
Some generic information about performance:
ABAP Performance tips - Contributor Corner [Read-only] - SCN Wiki
Best regards
Markus