10-15-2008 8:02 AM
Hi Experts,
There are more than 5000 records in an internal table and while looping the internal table,it is needed to call a function module passing the entries from the above workarea.Then it takes lot of time and gives short dump as long time has been taken.
Please suggest me how to loop an internal table having more than 5000 records.
Regards,
Johny
10-15-2008 8:05 AM
10-15-2008 8:06 AM
Hi
Sort the ITAB with fields you want to pass in FM.
then use.
loop at Itab
on change <fields you want to pass>
call FM
end change.
endloop.
Regards
Aditya
10-15-2008 8:07 AM
Hi
If the Fm is a Z Function module then what you can do is pass the entire internal table after it is filled with the values , to the Function module and in the FM you try to manipulate the values .
Regards
Pavan
10-15-2008 8:08 AM
10-15-2008 8:20 AM
Hi,
For making the loop processing time lesser u can use field-symbols instead of work areas.
FIELD-SYMBOLS: <fs_table > TYPE / LIKE int_table.
LOOP AT int_table ASSIGNING <fs_table.>
........
.......
ENDLOOP.
The field symbols clears by itself.
This takes lesser time than usage of work areas.
Hope this helps.
Cheers,
Lakshmi Prasanna Gandham
10-15-2008 8:29 AM
To find out exactly what takes so much time, run a SE30 runtime analysis and sort the resulting list by net time descending. Post the problematic statements here, if you are unsure how to fix them.
Thomas
10-15-2008 9:22 AM
Hi Thomas,
Here are the statements:
LOOP AT it_dimaiobpar INTO wa_dimaiobpar.
CALL FUNCTION 'FKK_ACCOUNT_BALANCE_COMPUTE'
EXPORTING
i_vkont = wa_dimaiobpar-partneracc
i_gpart = wa_dimaiobpar-partner
i_vtref = wa_dimaiobpar-insobject
i_start_date = '00000000'
i_start_time = '000000'
i_end_date = p_date "sy-datum
i_end_time = '000000'
TABLES
t_postab = it_postab2.
IF it_postab2 IS NOT INITIAL.
CLEAR wa_postab2.
LOOP AT it_postab2 INTO wa_postab2 WHERE augst NE '9'.
MOVE-CORRESPONDING wa_postab2 TO wa_postab1.
wa_postab1-lob = wa_dimaiobpar-insobjecttyp.
APPEND wa_postab1 TO it_postab1.
ENDLOOP.
ENDIF.
CLEAR wa_postab1.
Endloop.
The table it_dimaiobpar contains more than 7000 records and that makes an issue here it seems..