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

TIME_OUT error while executing an ABAP report

Former Member
0 Likes
868

Hi All,

I have an ABAP report in which the code looks like below


LOOP AT pernr_tab . " *Internal table consists of  around 25k records*  
   IF last_run_date IS INITIAL. " Initial Load
      PERFORM fill_data USING pernr_tab-pernr last_run_date CHANGING lv_flag.
      lv_flag = 'x'.
      initial_count = initial_count + 1.
    ELSE.
      PERFORM fill_data USING pernr_tab-pernr last_run_date CHANGING lv_flag.
      IF pernr_tab-status EQ '3' AND pernr_tab-begda GE today. " Future Hire records during delta load
        lv_flag = 'x'.
      ENDIF.
      IF lv_flag EQ 'x'.
        delta_change_count = delta_change_count + 1.
      ENDIF.
    ENDIF.
    IF lv_flag = 'x'. "initial load or changes in some infotype for delta load
      PERFORM append_data.
      CLEAR: p0000_tab[],p0000,p0001_tab[],p0001,p0002_tab[],p0002,p0006_tab[],p0006,p0006_phone,
p0007_tab[],p0007,p0027_tab[],p0027,p0032_tab[],p0032,p0105_tab_usr[],p0041_tab[],p0041.
      CLEAR: p0105_usr,p0105_tab_ven[],p0105_ven,p0105_tab_mgr[],p0105_mgr,p0709_tab[],p0709,pos_id,
functional_title,p0521_tab[],p0521,p2001_tab[],p2001,corporate_band_code,corporate_title_code,wa_pernr_tab.
    ENDIF.
  ENDLOOP.


inside the loop i am fetching data from 10 different infotypes and adding into another internal table.When I execute this program it is giving TIME_OUT error.Is there any way i can resolve this issue(I dont want to run this program in the background)

Thanks

Bala Duvvuri

Edited by: Bala Duvvuri on Jul 13, 2010 8:25 AM

Edited by: Thomas Zloch on Jul 13, 2010 4:58 PM - line width reduced

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
827

25000 sorts in the LOOP can easily kill you, and of cours the Call function coding is still missing

>sort p0000_tab by endda descending.

A code sicussion will not help you, you must analyse the execution! There is definitely nonlinear coding, you must figure out where.

The following 3 blogs can help you:

Nonlinearity: The problem and background

/people/siegfried.boes/blog/2007/02/12/performance-problems-caused-by-nonlinear-coding

Z_SE30_COMPARE

/people/siegfried.boes/blog/2008/01/15/a-tool-to-compare-runtime-measurements-zse30compare

Nonlinearity Check

/people/siegfried.boes/blog/2008/01/24/nonlinearity-check-using-the-zse30compare

You must solve the problem otherwise it will even run in background much too long. Whether it fits in a dialog step depends on what is done and how.

Siegfried

5 REPLIES 5
Read only

Former Member
0 Likes
827

You will have to paste the code from the routines FILL_DATA and APPEND_DATA for analysis.

Read only

0 Likes
827

fill_data

reading 10 infotypes

call function 'HR_READ_INFOTYPE'
  exporting
*     TCLAS                 = 'A'
    pernr                 = p_pernr_tab_pernr
    infty                 = '0000'
   begda                 = '18000101'
   endda                 = '99991231'
*   bypass_buffer         = 'X'
  tables
    infty_tab             = p0000_tab
 exceptions
   infty_not_found       = 1
   others                = 2
          .
  if sy-subrc <> 0.
  endif.
  if p0000_tab[] is not initial.
    sort p0000_tab by endda  descending.
    read table p0000_tab into p0000 index 1.
    if p0000-aedtm ge last_run_date.
      lv_flag = 'X' ." Infotype 0 has been changed
    endif.
  endif.

append_data

assigning 50 different fields from above infotypes to ls_emp_data

ls_emp_data-functional_title = functional_title.
  ls_emp_data-last_update = today.
  if ( p2001-awart = '5006' and p2001-begda <= today and p2001-endda >= today ) or
 ( p0521-atzph = 'AB' AND p0521-begda <= today AND p0521-endda >= today ).
    ls_emp_data-absent = text-007.
  ELSE.
    ls_emp_data-absent = text-008.
  ENDIF.
  ls_emp_data-corporate_band_code = corporate_band_code.
  ls_emp_data-corporate_title_code = corporate_title_code.
  APPEND ls_emp_data TO lt_emp_data.
  CLEAR:ls_emp_data,lv_flag.

Thanks

Bala Duvvuri

Edited by: Thomas Zloch on Jul 14, 2010 2:48 PM - code tags added

Read only

0 Likes
827

That sounds like alot of data to process in the foreground and I don't know much about HR. I would suspect there's a performance limiter in that function call which could be tracked with a trace. If there isn't and you absolutely have to run the thing in the foreground, you can always bypass the TIME_OUT with a strategically placed commit work. Not that I recommend it as a performance workaround; I'm just saying it's an option .

Read only

0 Likes
827

I followed this thread and it got solved

Thanks

Bala Duvvuri

Read only

Former Member
0 Likes
828

25000 sorts in the LOOP can easily kill you, and of cours the Call function coding is still missing

>sort p0000_tab by endda descending.

A code sicussion will not help you, you must analyse the execution! There is definitely nonlinear coding, you must figure out where.

The following 3 blogs can help you:

Nonlinearity: The problem and background

/people/siegfried.boes/blog/2007/02/12/performance-problems-caused-by-nonlinear-coding

Z_SE30_COMPARE

/people/siegfried.boes/blog/2008/01/15/a-tool-to-compare-runtime-measurements-zse30compare

Nonlinearity Check

/people/siegfried.boes/blog/2008/01/24/nonlinearity-check-using-the-zse30compare

You must solve the problem otherwise it will even run in background much too long. Whether it fits in a dialog step depends on what is done and how.

Siegfried