Skip to Content
0
Former Member
Sep 14, 2011 at 12:41 AM

Data load taking time because of code written in end routine

16 Views

Hi Gurus

I am reading a master data table and populating a field zsetlrun in the cube.

Thae data is coming from DSO to cube and in the transformation END ROUTINE i have written the code to poplulate this field zsetlrun.

As i have 10 Million records in the Master data info object ,Its taking almost 1 hr to load 100 thousand records(in transformation) from DSO to cube.

I am pasting the code. Let me know if it can be optimised.

*Data: wa_i_tab1 type tys_tg_1 .

  • DATA: i_tab TYPE STANDARD TABLE OF tys_tg_1.

  • Data : wa_result_pkg type tys_tg_1,

  • wa_result_pkg1 type tys_tg_1.

*

*

*

*

  • SELECT /BIC/ZSETLRUN AGREEMENT /BIC/ZREB_SDAT /BIC/ZLITEM1 from

  • /BIC/PZREB_SDAT

  • into CORRESPONDING FIELDS OF table i_tab

  • FOR ALL ENTRIES IN RESULT_PACKAGE

  • where

  • /bic/ZREB_SDAT = RESULT_PACKAGE-/BIC/ZREB_SDAT

  • AND

  • AGREEMENT = RESULT_PACKAGE-AGREEMENT

  • AND /BIC/ZLITEM1 = RESULT_PACKAGE-/BIC/ZLITEM1.

*

  • DELETE i_tab WHERE /BIC/ZSETLRUN = ''.

*

*

*

  • sort RESULT_PACKAGE by AGREEMENT /BIC/ZREB_SDAT /BIC/ZLITEM1.

  • sort i_tab by AGREEMENT /BIC/ZREB_SDAT /BIC/ZLITEM1.

  • loop at RESULT_PACKAGE into wa_result_pkg.

*

*

*

  • read TABLE i_tab INTO wa_i_tab1 with key

  • /BIC/ZREB_SDAT =

  • wa_result_pkg-/BIC/ZREB_SDAT

  • AGREEMENT = wa_result_pkg-AGREEMENT

  • /BIC/ZLITEM1 = wa_result_pkg-/BIC/ZLITEM1.

*

  • IF SY-SUBRC = 0.

  • move wa_i_tab1-/BIC/ZSETLRUN to

  • wa_result_pkg-/BIC/ZSETLRUN.

  • wa_result_pkg1-/BIC/ZSETLRUN = wa_result_pkg-/BIC/ZSETLRUN.

  • modify RESULT_PACKAGE from wa_result_pkg1

  • TRANSPORTING /BIC/ZSETLRUN.

*

  • ENDIF.

  • CLEAR: wa_i_tab1,wa_result_pkg1,wa_result_pkg.

  • endloop.