‎2007 Sep 10 10:16 AM
hi all
i buield this rfc to portal and when i run it it takes like 4,206,413 Microseconds
how i can decrease the time of runnig.
thankes
this is all my code
i reward.
CONCATENATE sy-datum(4) '01' INTO l_stperiod.
tmp_stperiod = l_stperiod.
l_enperiod = sy-datum .
bet_period = l_enperiod - l_stperiod.
LOOP AT costcenters ASSIGNING <fs_cost>.
l_stperiod = tmp_stperiod.
DO bet_period TIMES.
CALL FUNCTION 'ZEMP_MISS_DAYS'
EXPORTING
kostl = <fs_cost>-kostl
period = l_stperiod
TABLES
emp_miss_days = emp_miss_days.
l_stperiod = l_stperiod + 1.
ENDDO.
ENDLOOP.
l_stperiod = tmp_stperiod.
SORT emp_miss_days BY kostl period.
LOOP AT emp_miss_days .
MOVE-CORRESPONDING emp_miss_days TO col_miss_tab.
COLLECT col_miss_tab .
ENDLOOP.
*creating the data
IF costcenters[] IS NOT INITIAL.
SELECT kostl period miss_days
INTO TABLE gt_miss_data
FROM zaverageh_data
FOR ALL ENTRIES IN costcenters
WHERE kostl EQ costcenters-kostl
AND period BETWEEN l_stperiod
AND l_enperiod.
ENDIF.
ENDFUNCTION.
‎2007 Sep 10 10:31 AM
hi,
I didnt get the logic (as i donno the reqmt)
1. But check if it is possible to use the FM once and store the data in an internal table (if DBT access is reqd in the FM) and read the internal table inside the LOOP.
2. SELECT kostl period miss_days
INTO TABLE gt_miss_data
FROM zaverageh_data
FOR ALL ENTRIES IN costcenters
WHERE kostl EQ costcenters-kostl
AND period BETWEEN l_stperiod
AND l_enperiod.
In the above query, if any of the fields in the condition is not a key field then create an index for the same and try. This would increase the performance
‎2007 Sep 10 10:31 AM
hi,
I didnt get the logic (as i donno the reqmt)
1. But check if it is possible to use the FM once and store the data in an internal table (if DBT access is reqd in the FM) and read the internal table inside the LOOP.
2. SELECT kostl period miss_days
INTO TABLE gt_miss_data
FROM zaverageh_data
FOR ALL ENTRIES IN costcenters
WHERE kostl EQ costcenters-kostl
AND period BETWEEN l_stperiod
AND l_enperiod.
In the above query, if any of the fields in the condition is not a key field then create an index for the same and try. This would increase the performance