Hi Venkat,
Your select statement seems to be perfect. You are pulling data from MARC table which has both plant and material as primary key so the problem doesn't lie here.Please share the full start and end routine code so that we can help you out.
Have you checked the DTP load monitor where exactly the load is taking time. You can write the code as mentioned by AL in end routine instead of field level .
If you are trying to populate the /bic/zflg then this can be the sample code.
data: it_plant type standard table of ty_plant,
wa_plant TYPE ty_plant.
IF Result_package is not initial.
select
plant
material
objvers
/bic/zflg
from /bi0/pmat_plant
into table it_plant
for all entries in source_package
where plant = Result_package-plant
and material = Result_package-material
and objvers = 'A'.
if sy-subrc eq 0.
sort it_plant by plant material .
endif.
endif.
Loop at RESULT_package assigning <RESULT_FIELD>.
Read table it_plant into wa_plant with key plant = <Result_field>-plant
material = <Result_field>-material BINARY SEARCH.
if sy-subrc eq 0.
<Result_field>- /bic/zflg = wa-plant-/ bic/zflg.
endif.
endloop.
There might be some syntax errors.