Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

performance help

Former Member
0 Likes
310

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
294

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

1 REPLY 1
Read only

Former Member
0 Likes
295

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