Hello Ravi,
There are few tricks as experts already have adviced.
1. Instead of using standard internal table use Hashed table. Ensure that you use complete keys of DSO for the hash table as it works on unique keys. This type of internal table takes same time to read for any number of records using hash algorithm.
Your syntax in data declaration could look like this:
TYPES : BEGIN OF ty_result,
EQUIPMENT TYPE /BI0/OIEQUIPMENT, "Include all keys of DSO
/BIC/ZOBJSTAT TYPE /BIC/OIZOBJSTAT,
END OF ty_result.
DATA : it_result TYPE HASHED TABLE OF ty_result WITH UNIQUE KEY EQUIPMENT. "Include all keys of DSO
2. Always use End Routine for calculation after performing data selection in start routine. Avoid field routine as far as possible. Best practices are - use start routine for data selection and end routine for data manipulation. Field routine are only used apply any formula required or if you have only one field to update in target given you do selection in start routine only. No selection of data is adviced in field routine.
Your code in end routine could look like below:
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
READ TABLE it_result INTO w_result WITH KEY EQUIPMENT = <result_fields>-EQUIPMENT.
IF sy-subrc EQ 0.
IF <result_fields>-PMPLANGRP = '030'.
CONCATENATE 'WR' W_RESULT-/BIC/ZOBJSTAT INTO RESULT.
ELSE.
CONCATENATE 'WE' W_RESULT-/BIC/ZOBJSTAT INTO RESULT.
ENDIF.
ENDIF.
ENDLOOP.
You may have to refine the code little bit as I did this code in my notepad
Please let me know if you have any doubts.
Regards
Amit