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 Time limit exceeded Dump

0 Likes
7,290

Hi gurus,

I am getting the dump like this as

The program "Z##########" has exceeded the maximum permitted runtime

without

interruption, and has therefore been terminated.

<b>Error analysis</b>

After a certain length of time, the program is terminated. In the case

of a work area, this means that

- endless loops (DO, WHILE, ...),

- database accesses producing an excessively large result set,

- database accesses without a suitable index (full table scan)

do not block the processing for too long.

The system profile "rdisp/max_wprun_time" contains the maximum runtime of a

program. The

current setting is 3600 seconds. Once this time limit has been exceeded,

the system tries to terminate any SQL statements that are currently

being executed and tells the ABAP processor to terminate the current

program. Then it waits for a maximum of 60 seconds. If the program is

still active, the work process is restarted.

successfully processed, the system gives it another 3600 seconds.

Hence the maximum runtime of a program is at least twice the value of

the system profile parameter "rdisp/max_wprun_time".

<b>How to correct the error</b>

You should usually execute long-running programs as batch jobs.

If this is not possible, increase the system profile parameter

"rdisp/max_wprun_time".

Depending on the cause of the error, you may have to take one of the

following measures:

- Endless loop: Correct program;

- Dataset resulting from database access is too large:

Instead of "SELECT * ... ENDSELECT", use "SELECT * INTO internal table

(for example);

- Database has an unsuitable index: Check index generation.

You may able to find an interim solution to the problem

in the SAP note system. If you have access to the note system yourself,

use the following search criteria:

<b>Source code extract</b>

SELECT BUKRS BELNR GJAHR SKFBT BUDAT XREF1 DMBTR SHKZG INTO CORRESPONDING FIELDS OF

TABLE IT_BSAK

FROM BSAK

WHERE BUKRS = IT_BSIS-BUKRS

AND BELNR NE IT_BSIS-BELNR

AND AUGBL = IT_BSIS-BELNR

AND AUGGJ = IT_BSIS-GJAHR.

SORT IT_BSAK BY BELNR.

LOOP AT IT_BSAK.

-


> SELECT SINGLE GJAHR AWKEY INTO (W_GJAHR, W_AWKEY)

FROM BKPF

WHERE STBLG = IT_BSAK-BELNR

AND bukrs = it_bsak-bukrs

AND gjahr = it_bsak-gjahr.

IF SY-SUBRC = 0.

DELETE IT_BSAK WHERE BELNR = IT_BSAK-BELNR.

ENDIF.

ENDLOOP.

Note:- Dump is coming at marked -


> position.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,284

I would change the second select to select the actual document rather than the reversing document and then use the reversing document form there to do another select.

Rob

Hi gurus,

I am getting the dump like this as

The program "Z##########" has exceeded the maximum permitted runtime

without

interruption, and has therefore been terminated.

<b>Error analysis</b>

After a certain length of time, the program is terminated. In the case

of a work area, this means that

- endless loops (DO, WHILE, ...),

- database accesses producing an excessively large result set,

- database accesses without a suitable index (full table scan)

do not block the processing for too long.

The system profile "rdisp/max_wprun_time" contains the maximum runtime of a

program. The

current setting is 3600 seconds. Once this time limit has been exceeded,

the system tries to terminate any SQL statements that are currently

being executed and tells the ABAP processor to terminate the current

program. Then it waits for a maximum of 60 seconds. If the program is

still active, the work process is restarted.

successfully processed, the system gives it another 3600 seconds.

Hence the maximum runtime of a program is at least twice the value of

the system profile parameter "rdisp/max_wprun_time".

<b>How to correct the error</b>

You should usually execute long-running programs as batch jobs.

If this is not possible, increase the system profile parameter

"rdisp/max_wprun_time".

Depending on the cause of the error, you may have to take one of the

following measures:

- Endless loop: Correct program;

- Dataset resulting from database access is too large:

Instead of "SELECT * ... ENDSELECT", use "SELECT * INTO internal table

(for example);

- Database has an unsuitable index: Check index generation.

You may able to find an interim solution to the problem

in the SAP note system. If you have access to the note system yourself,

use the following search criteria:

<b>Source code extract</b>

SELECT BUKRS BELNR GJAHR SKFBT BUDAT XREF1 DMBTR SHKZG INTO CORRESPONDING FIELDS OF

TABLE IT_BSAK

FROM BSAK

WHERE BUKRS = IT_BSIS-BUKRS

AND BELNR NE IT_BSIS-BELNR

AND AUGBL = IT_BSIS-BELNR

AND AUGGJ = IT_BSIS-GJAHR.

SORT IT_BSAK BY BELNR.

LOOP AT IT_BSAK.

-


> SELECT SINGLE GJAHR AWKEY INTO (W_GJAHR, W_AWKEY)

FROM BKPF

WHERE STBLG = IT_BSAK-BELNR

AND bukrs = it_bsak-bukrs

AND gjahr = it_bsak-gjahr.

IF SY-SUBRC = 0.

DELETE IT_BSAK WHERE BELNR = IT_BSAK-BELNR.

ENDIF.

ENDLOOP.

Note:- Dump is coming at marked -


> position.

4 REPLIES 4
Read only

Former Member
0 Likes
4,284

Hi Robin,

It is a case of select query taking too much time.

You can avoid the select statement inside the loop and use for all entries statement instead. Anyway, this doesn't guarantee the execution within the limit you set(which is i hour as of now). You should better run this program in background. background jobs can run for any long.

SORT IT_BSAK BY BELNR.

SELECT BUKRS GJAHR AWKEY INTO table it_bkpf

FROM BKPF

for all entries in it_bsak

WHERE STBLG = IT_BSAK-BELNR

AND bukrs = it_bsak-bukrs

AND gjahr = it_bsak-gjahr.

LOOP AT IT_BSAK.

read table it_bkpf with key belnr = it_bsak-belnr bukrs = it_bsak-bukrs

gjahr = it_bsak-gjahr.

IF SY-SUBRC = 0.

DELETE IT_BSAK WHERE BELNR = IT_BSAK-BELNR.

ENDIF.

ENDLOOP.

Regards,

ravi

Read only

Former Member
0 Likes
4,284

Hi Robin

You can try the following,

1) if your selection criteria would return a huge amount of data then it is better to schedule such jobs in background as it would take long time ot execute.

2) The SELECT statments might not frames properly and hence it takes long time to execute, say many joins, infinite loops, etc. Try to avoid such statments and

3) Besides you are using select inside a loop, which will kill your performance, please note that

Please go through these tips,

https://wiki.sdn.sap.com/wiki/display/HOME/ABAPPerformanceand+Tuning

Regards

Kathirvel

Read only

Former Member
0 Likes
4,284

hi kapoor,

i think the dump is due to looping of too many records which inturm gets timed out.

instead try out this code.

SELECT BUKRS BELNR GJAHR SKFBT BUDAT XREF1 DMBTR SHKZG INTO CORRESPONDING FIELDS OF

TABLE IT_BSAK

FROM BSAK

WHERE BUKRS = IT_BSIS-BUKRS

AND BELNR NE IT_BSIS-BELNR

AND AUGBL = IT_BSIS-BELNR

AND AUGGJ = IT_BSIS-GJAHR.

create an internal table with two required fields.

SELECT GJAHR AWKEY INTO table it_bkpf.

FROM BKPF

for all entries in IT_BSAK

WHERE STBLG = IT_BSAK-BELNR

AND bukrs = it_bsak-bukrs

AND gjahr = it_bsak-gjahr.

SORT IT_BSAK BY BELNR.

LOOP AT IT_BSAK..

read it_bkpf with key STBLG = IT_BSAK-BELNR

AND bukrs = it_bsak-bukrs

AND gjahr = it_bsak-gjahr.

IF SY-SUBRC = 0.

DELETE IT_BSAK WHERE BELNR = IT_BSAK-BELNR.

ENDIF.

ENDLOOP.

regards,

sateesh.

Read only

Former Member
0 Likes
4,285

I would change the second select to select the actual document rather than the reversing document and then use the reversing document form there to do another select.

Rob