we had a transformation on 0euipment(masterdata) from infosource we had a performance issue.. because we had a field routine in place the field was for infoobject user status ZUSRST## ........and the data is being pulled from a DSO(/BIC/AZDSTAT**)
the old code in the filed routine was
SELECT SINGLE /BIC/ZOBJSTAT
INTO W_RESULT
FROM /BIC/AZDSTAT** WHERE
EQUIPMENT = SOURCE_FIELDS-EQUIPMENT AND
/BIC/ZSTATOBJ = 'E' AND
/BIC/ZOBJTYPE = 'IE' AND
RF_DEL_IND NE 'X'.
IF W_RESULT IS NOT INITIAL.
IF SOURCE_FIELDS-PMPLANGRP EQ '030'.
CONCATENATE 'WR' W_RESULT INTO RESULT.
ELSE.
CONCATENATE 'WE' W_RESULT INTO RESULT.
ENDIF.
ENDIF.
The above code was working on single record since it is in a field routine so it took time.... so we have decided to go for a start routine.... store thedata in the internal table.... and then in the filed routine do a read on the internal table to populate the filed ZUSRST##
The new code included in the start routine was
DATA : it_result TYPE STANDARD TABLE OF ty_result.
TYPES : BEGIN OF ty_result,
EQUIPMENT TYPE /BI0/OIEQUIPMENT,
/BIC/ZOBJSTAT TYPE /BIC/OIZOBJSTAT,
END OF ty_result.
SELECT EQUIPMENT /BIC/ZOBJSTAT
INTO TABLE it_RESULT(internaltable)
FROM /BIC/AZDSTAT**
FOR ALL ENTRIES IN SOURCE_PACKAGE
WHERE EQUIPMENT = SOURCE_PACKAGE-EQUIPMENT AND
/BIC/ZSTATOBJ = 'E' AND
/BIC/ZOBJTYPE = 'IE' AND
RF_DEL_IND NE 'X'.
SORT it_result by EQUIPMENT ASCENDING.
After the above code we did a read from internal table in the field routine and below is the code
DATA: W_RESULT TYPE ty_result.
READ TABLE it_result INTO w_result
WITH KEY EQUIPMENT = SOURCE_FIELDS-EQUIPMENt BINARY
SEARCH.
IF sy-subrc IS INITIAL.
IF SOURCE_FIELDS-PMPLANGRP EQ '030'.
CONCATENATE 'WR' W_RESULT-/BIC/ZOBJSTAT INTO RESULT.
ELSE.
CONCATENATE 'WE' W_RESULT-/BIC/ZOBJSTAT INTO RESULT.
ENDIF.
ENDIF.
From the above start routine and reading nternal table from filed routine there was a performance improvement by 30 mins....and we are not really happy ...
My question is .... is there a way where i can directly include the complete code in the start routine that is the start routine code and the reading the internal table in field routine code..........(instead of reading the internal table in field routine... and i think thats causing the peformance issue)
can i avoid reading internal table in the field routine will it improve performance?
if it improves performance how to i get the result into the.... user status ZUSRST##/
Thanks
Ravi