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

ABAP Dump - Time out

divya_nayudu
Participant
0 Likes
1,828

I need to work out on a report that is continuously throwing Runtime error of Time Out. After debugging, i realised that its running in a Loop infinitely. And i suppose that would be causing timeout. Could anyone suggest a way to deal with such errors and solve them?

I need to work out on a report that is continuously throwing Runtime error of Time Out. After debugging, i realised that its running in a Loop infinitely. And i suppose that would be causing timeout. Could anyone suggest a way to deal with such errors and solve them?

14 REPLIES 14
Read only

Former Member
0 Likes
1,506

Hi Divya,

Is it a Standard program or Z Program? If it is Z Program, paste the code inside loop.. endloop.

Regards,

Satish

Read only

0 Likes
1,506

Its a Z program...the code inside loop...endloop is as follows:

LOOP AT TCATSPM.

COUNT_TRANS = COUNT_TRANS + 1.

SELECT SINGLE RUECK FROM AFRU INTO AFRU-RUECK

WHERE CATSBELNR = TCATSPM-BELNR

AND STOKZ = TCATSPM-STOKZ. .

IF NOT SY-SUBRC IS INITIAL.

  • does record in error-pool exist ?

SELECT SINGLE * FROM AFRV

WHERE CATSBELNR = TCATSPM-BELNR.

  • Satz ist in Zielapplikation schon vorhanden

IF SY-SUBRC IS INITIAL.

DELETE TCATSPM.

COUNT_EXIST = COUNT_EXIST + 1.

ELSE.

CLEAR TCATSPM-TRANSFER.

MODIFY TCATSPM.

COUNT_UPDAT = COUNT_UPDAT + 1.

ENDIF.

ELSE.

DELETE TCATSPM.

COUNT_EXIST = COUNT_EXIST + 1.

ENDIF.

ENDLOOP.

Read only

0 Likes
1,506

Hi,

Keep Select Queries Outside the loop and use Read Statements inside the loop. Your Problem Will get resolved.

Regards,

Satish

Read only

0 Likes
1,506

As in, remove select query & use read statement instead? Or use select statement to fill a workarea or internal tab and then use read statement in the loop?

Read only

0 Likes
1,506

Hi,

Do like this

data: lv_lines type i.

describe table tcatspm lines lv_lines.

LOOP AT TCATSPM.

COUNT_TRANS = COUNT_TRANS + 1.

SELECT SINGLE RUECK FROM AFRU INTO AFRU-RUECK

WHERE CATSBELNR = TCATSPM-BELNR

AND STOKZ = TCATSPM-STOKZ. .

IF NOT SY-SUBRC IS INITIAL.

does record in error-pool exist ?

SELECT SINGLE * FROM AFRV

WHERE CATSBELNR = TCATSPM-BELNR.

Satz ist in Zielapplikation schon vorhanden

IF SY-SUBRC IS INITIAL.

DELETE TCATSPM.

COUNT_EXIST = COUNT_EXIST + 1.

ELSE.

CLEAR TCATSPM-TRANSFER.

MODIFY TCATSPM.

COUNT_UPDAT = COUNT_UPDAT + 1.

ENDIF.

ELSE.

DELETE TCATSPM.

COUNT_EXIST = COUNT_EXIST + 1.

ENDIF.

If COUNT_TRANS = lv_lines.

exit.

endif.

ENDLOOP.

Read only

0 Likes
1,506

Ok...Breaking the loop once it reaches its end...I shall try this code right away, and get back to you.

Read only

0 Likes
1,506

its still throwin a timeout....pointing at the very first select query in the loop...

Read only

0 Likes
1,506

Then try this

TYPES: BEGIN OF TY_RUECK,

RUECK TYPE AFRU-RUECK,

CATSBELNR TYPE AFRU-CATSBELNR,

STOKZ TYPE AFRU-STOKZ,

END OF TY_RUECK.

DATA: IT_RUECK TYPE TABLE OF TY_RUECK,

WA_RUECK TYPE TY_RUECK,

IT_AFRV TYPE TABLE OF AFRV,

WA_AFRV TYPE AFRV.

SELECT RUECK CATSBELNR STOKZ FROM AFRU INTO TABLE IT_RUECK

FOR ALL ENTRIES IN TCATSPM

WHERE CATSBELNR = TCATSPM-BELNR

AND STOKZ = TCATSPM-STOKZ.

IF SY-SUBRC = 0.

SELECT * FROM AFRV INTO TABLE IT_AFRV

FOR ALL ENTRIES IN TCATSPM

WHERE CATSBELNR = TCATSPM-BELNR.

ENDIF.

SORT IT_RUECK.

LOOP AT TCATSPM.

COUNT_TRANS = COUNT_TRANS + 1.

READ TABLE IT_RUECK INTO WA_RUECK WITH KEY CATSBELNR = TCATSPM-BELNR STOKZ = TCATSPM-STOKZ BINARY SEARCH.

IF NOT SY-SUBRC IS INITIAL.

does record in error-pool exist ?

READ TABLE IT_AFRV INTO WA_AFRV WITH KEY CATSBELNR = TCATSPM-BELNR.

Satz ist in Zielapplikation schon vorhanden

IF SY-SUBRC IS INITIAL.

DELETE TCATSPM.

COUNT_EXIST = COUNT_EXIST + 1.

ELSE.

CLEAR TCATSPM-TRANSFER.

MODIFY TCATSPM.

COUNT_UPDAT = COUNT_UPDAT + 1.

ENDIF.

ELSE.

DELETE TCATSPM.

COUNT_EXIST = COUNT_EXIST + 1.

ENDIF.

Regards,

Satish

Read only

0 Likes
1,506

ok..now you replaced select queries with read statement, the method you suggested earlier...I too coded similar to the code you wrote, with slight changes. Anyways, trying to run the code you gave now.

Read only

0 Likes
1,506

its still giving runtime (time out) on the same query:

SELECT SINGLE RUECK FROM AFRU INTO AFRU-RUECK

WHERE CATSBELNR = TCATSPM-BELNR

AND STOKZ = TCATSPM-STOKZ.

What could be taking time in this?Total entries in afru are around 2.521.450 and the total entries in TCATSPM comes out to 2.445.804... Could it be this huge amount of data access in the code that causes time out? how could this be handled?I think basis wil have to set some memory parameters and increase them.... It also gives msg "low memory..." during execution.

Read only

0 Likes
1,506

Hi Divya,

BTW, within your codes IF SY-SUBRC IS INITIAL.

In my opinion , it's not right.

Read only

0 Likes
1,506

tommy, that code is running fine... And I just checked report again. The report is fine. The problem is with the server. So its solved now. Thanks for the help and time Satish and Tommy!

Read only

Former Member
0 Likes
1,506

Avoid using Select single..

Instead select all relevent data and retrieve first value by read statement..This will shift processing from database layer to your application layer.

Also try creating secondary index with specified field in your select query (this will be secondary index combined on both tables).

Regards,

Mohaiyuddin

Read only

0 Likes
1,506

Thanks to you too Mohaiyuddin.