‎2007 Oct 19 11:33 AM
Hi Experts ,
Following routine taking long time, it takes around 1 hour for 34,000 records.
IT_ANLA is sorted and no duplicate entries in the table.
Is there any way to improve performance for this ?
FORM GET_FIAA_ANLC_VALUES_GET.
DATA : LV_GJAHR LIKE ANLC-GJAHR.
LV_GJAHR = S_GJAHR-LOW.
LOOP AT IT_ANLA.
REFRESH LT_ANLC.
CALL FUNCTION 'FIAA_ANLC_VALUES_GET'
EXPORTING
I_ANLN1 = IT_ANLA-ANLN1
I_ANLN2 = IT_ANLA-ANLN2
I_BUKRS = IT_ANLA-BUKRS
I_GJAHR = LV_GJAHR
TABLES
T_ANLC = LT_ANLC[]
EXCEPTIONS
NOT_FOUND = 1
ERR_IN_DEPR_REC = 2
OTHERS = 3.
IF SY-SUBRC = 0.
APPEND LINES OF LT_ANLC TO LT_ANLC_FINAL.
ENDIF.
ENDLOOP.
ENDFORM.
‎2007 Oct 19 12:30 PM
what do you want to know?
This function is in the loop, CALL FUNCTION 'FIAA_ANLC_VALUES_GET',
what is it doing?
The only thing I can say, if the fuinction could process the whole table IT_ANLA
then it would be faster.
Siegfried
‎2007 Oct 19 4:02 PM
There is very little you can do to remedy your situation. I believe that the performance degradation is taking place in the SAP function module. On your part there is very little you can do. I have modified you program a little. Have a look at it.
FORM get_fiaa_anlc_values_get.
DATA : lv_gjahr LIKE anlc-gjahr.
* MARK START OF INSERTION
DATA: it_anla_tmp LIKE TABLE OF it_anla.
it_anla_tmp[] = it_anla[].
SORT it_anla BY anln1 anln2 bukrs.
DELETE ADJACENT DUPLICATES FROM it_anla COMPARING anln1 anln2 bukrs.
* MARK END OF INSERTION
lv_gjahr = s_gjahr-low.
LOOP AT it_anla.
REFRESH lt_anlc.
CALL FUNCTION 'FIAA_ANLC_VALUES_GET'
EXPORTING
i_anln1 = it_anla-anln1
i_anln2 = it_anla-anln2
i_bukrs = it_anla-bukrs
i_gjahr = lv_gjahr
TABLES
t_anlc = lt_anlc[]
EXCEPTIONS
not_found = 1
err_in_depr_rec = 2
OTHERS = 3.
IF sy-subrc = 0.
APPEND LINES OF lt_anlc TO lt_anlc_final.
ENDIF.
ENDLOOP.
* MARK START OF INSERTION
it_anla[] = it_anla_tmp[].
* MARK END OF INSERTION
ENDFORM. "GET_FIAA_ANLC_VALUES_GET