Data load takes long time due to select statement in endroutine
We have data load from DSO1 to DSO2 having endroutine .The load takes long time (approx. 1.5 hours) for 23000 records delta load.
In end routine there is a select statement .
We have already created sec. index for ACCTYPE but still it takes long time and I feel that this long time is due to the sum statement which does aggregation of values.
Can you please suggest me whether the long run is due to sum statement ? if so,how to optimize the code in easier way.
ACDOCNUM AS ACDOCNUM
ACCTYPE AS ACC_TYPE
POSTINGDATE AS POSTINGDATE
PSAWKEY AS MAT_DOC_YEAR
GLACCT AS GLACCT
/BIC/ZGKON AS ZGKON
SUM( DEB_CR_L1) AS DEB_CR_L1
LOC_CURC1 AS LOC_CURC1
SUM( DEB_CR_L1 ) AS DEB_CR_L1
FROM /BI0/AFIGL_O11400 INTO CORRESPONDING FIELDS OF TABLE
WHERE ACCTYPE = 'M' GROUP BY ACDOCNUM ACCTYPE POSTINGDATE PSM_AWKEY GLACCT
SORT IT_FIGL_O14 BY MAT_DOC_YEAR
there are three calulcations as below in loop statement
-/BIC/ZTOTLK = ( <RESULT_FIELDS>-ISSVALCK +