Skip to Content
0
Former Member
Dec 15, 2006 at 03:04 PM

Performance question.

24 Views

Hi people!

I'm confuse here! I need to compute the balance of some months in a program for the GL module. I use the table faglflext to make that, but I need good performance and I don't know if I make the code correct or I need to change it to take a better performance. Some one can check that! Thanks!

Code:

  LOOP AT t_itab1 INTO wa_itab WHERE racct  NE ''.

    itab_kslvt = itab_kslvt + wa_itab-kslvt. 
    itab_ksl01 = itab_ksl01 + wa_itab-ksl01. 
    itab_ksl02 = itab_ksl02 + wa_itab-ksl02.
    itab_ksl03 = itab_ksl03 + wa_itab-ksl03. 
    itab_ksl04 = itab_ksl04 + wa_itab-ksl04.
    itab_ksl05 = itab_ksl05 + wa_itab-ksl05. 
    itab_ksl06 = itab_ksl06 + wa_itab-ksl06.
    itab_ksl07 = itab_ksl07 + wa_itab-ksl07. 
    itab_ksl08 = itab_ksl08 + wa_itab-ksl08.
    itab_ksl09 = itab_ksl09 + wa_itab-ksl09. 
    itab_ksl10 = itab_ksl10 + wa_itab-ksl10.
    itab_ksl11 = itab_ksl11 + wa_itab-ksl11. 
    itab_ksl12 = itab_ksl12 + wa_itab-ksl12.

        IF p_date+4(2) >= '01'.

          COMPUTE: balance_month_01 =   itab_bal00 + itab_bal01.

        ENDIF.

        IF p_date+4(2) >= '02'.

          COMPUTE: balance_month_02 = itab_bal00 + itab_bal01 + itab_bal02.

        ENDIF.

        IF p_date+4(2) >= '03'.

          COMPUTE: balance_month_03 = itab_bal00 + itab_bal01 + itab_bal02 + 
                                                           itab_bal03.

        ENDIF.

        IF p_date+4(2) >= '04'.

          COMPUTE: balance_month_04 = itab_bal00 + itab_bal01 + itab_bal02 + 
                                                           itab_bal03 + itab_bal04.

        ENDIF.

        IF p_date+4(2) >= '05'.

          COMPUTE: balance_month_05 = itab_bal00 + itab_bal01 + itab_bal02 + 
                                                           itab_bal03 + itab_bal04 + itab_bal05.

        ENDIF.

        IF p_date+4(2) >= '06'.

          COMPUTE: balance_month_06 =  itab_bal00 + itab_bal01 + itab_bal02 + 
                                                            itab_bal03 + itab_bal04 + itab_bal05 + 
                                                            itab_bal06.

        ENDIF.

        IF p_date+4(2) >= '07'.

          COMPUTE: balance_month_07 =  itab_bal00 + itab_bal01 + itab_bal02 + 
                                                            itab_bal03 + itab_bal04 + itab_bal05 + 
                                                            itab_bal06 + itab_bal07.

        ENDIF.

        IF p_date+4(2) >= '08'.

          COMPUTE: balance_month_08 =  itab_bal00 + itab_bal01 + itab_bal02 + 
                                                            itab_bal03 + itab_bal04 + itab_bal05 + 
                                                            itab_bal06 + itab_bal07 + itab_bal08.

        ENDIF.

        IF p_date+4(2) >= '09'.

          COMPUTE: balance_month_09 =  itab_bal00 + itab_bal01 + itab_bal02 + 
                                                            itab_bal03 + itab_bal04 + itab_bal05 +   
                                                            itab_bal06 + itab_bal07 + itab_bal08 + 
                                                            itab_bal09.

        ENDIF.

        IF p_date+4(2) >= '10'.

          COMPUTE: balance_month_10 =  itab_bal00 + itab_bal01 + itab_bal02 + 
                                                            itab_bal03 + itab_bal04 + itab_bal05 + 
                                                            itab_bal06 + itab_bal07 + itab_bal08 + 
                                                            itab_bal09 + itab_bal10.

        ENDIF.

        IF p_date+4(2) >= '11'.

          COMPUTE: balance_month_11 = itab_bal00 + itab_bal01 + itab_bal02 + 
                                                           itab_bal03 + itab_bal04 + itab_bal05 + 
                                                           itab_bal06 + itab_bal07 + itab_bal08 + 
                                                           itab_bal09 + itab_bal10 + itab_bal11.

        ENDIF.

        IF p_date+4(2) >= '12'.

          COMPUTE: balance_month_12 =  itab_bal00 + itab_bal01 + itab_bal02 + 
                                                            itab_bal03 + itab_bal04 + itab_bal05 + 
                                                            itab_bal06 + itab_bal07 + itab_bal08 + 
                                                            itab_bal09 + itab_bal10 + itab_bal11 + 
                                                            itab_bal12.

        ENDIF.

endloop.