Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Data load takes long time due to select statement in endroutine

Hi All,

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.

SELECT

            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

           IT_FIGL_O114

          WHERE ACCTYPE = 'M' GROUP BY ACDOCNUM  ACCTYPE  POSTINGDATE PSM_AWKEY GLACCT

            /BIC/ZGKON LOC_CURRC2.

          SORT IT_FIGL_O14 BY MAT_DOC_YEAR

Also,

there are three calulcations as below in loop statement

-/BIC/ZTOTLK = ( <RESULT_FIELDS>-ISSVALCK +

                                         <RESULT_FIELDS>
-RECVATCK ).

regards

Pradeep


Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question