cancel
Showing results for 
Search instead for 
Did you mean: 

Run time error: Time Out

Former Member
0 Kudos

Hi people,

I have a little doubt, you can help me please ?

The code below is a little part of the program were occurs the Short Dump, and the error occurs in part highlighted by the symbol >>>>

Table internal "t_zlmv001" is large, has millions of data. How I could avoid the "time out", in this case..

YOU CAN HELP-ME PLEASE ?

-


loop at t_zlmv001.

describe table t_zlmv001 lines v_tot.

v_cont = v_cont + 1.

if v_cont = 1.

t_zlmv001_aux = t_zlmv001.

t_zlmv001_aux-lbkum = 0.

t_zlmv001_aux-salk3 = 0.

endif.

        • the error occurs in this part ****

>>>> delete t_zlmv001 where matnr = t_zlmv001-matnr

and bwkey = t_zlmv001-bwkey

and bwtar = t_zlmv001-bwtar

and ( bdatj < t_zlmv001-bdatj

or ( bdatj = t_zlmv001-bdatj

and poper < t_zlmv001-poper ) ).

if t_zlmv001-matnr = t_zlmv001_aux-matnr and

t_zlmv001-bwkey = t_zlmv001_aux-bwkey and

t_zlmv001-bdatj = t_zlmv001_aux-bdatj and

t_zlmv001-poper = t_zlmv001_aux-poper and

t_zlmv001-untper = t_zlmv001_aux-untper and

t_zlmv001-curtp = t_zlmv001_aux-curtp and

t_zlmv001-mtuse = t_zlmv001_aux-mtuse.

t_zlmv001_aux-lbkum = t_zlmv001_aux-lbkum + t_zlmv001-lbkum.

t_zlmv001_aux-salk3 = t_zlmv001_aux-salk3 + t_zlmv001-salk3.

else.

append t_zlmv001_aux.

t_zlmv001_aux-lbkum = t_zlmv001-lbkum.

t_zlmv001_aux-salk3 = t_zlmv001-salk3.

t_zlmv001_aux = t_zlmv001.

endif.

endloop.

-


Accepted Solutions (1)

Accepted Solutions (1)

former_member191735
Active Contributor
0 Kudos

It is better to sort the internal table by matnr and ADJACENT DUPLICATES FROM itab COMPARING matnr. the same will delete duplicate records and you can get less number of records.

Answers (3)

Answers (3)

Former Member
0 Kudos

after sorting table t_zlmv001

use statement

delete adjacent duplicates from t_zlmv001.

Former Member
0 Kudos

The DELETE WHERE inside the loop is in fact a nested loop. With millions of rows in the table, this will take a very long time to do. You must eveluate each record individually and decide if you want to delete it only.

Rob

former_member195698
Active Contributor
0 Kudos

What exactly is the logic in the code that you have sent? You are looping at a table and deleting entries from the same table within the loop based on some criteria....... can you explain in detail

Former Member
0 Kudos

Hi Jolly,

To fill this internal table, I use the field MATNR( Material Number) and P_LFMON (Month or Period), then the program returns me some records with this criteria, with the same MATNR and P_LFMON, then, I have to sort the records "Ascending" to get que last month...

Then after get the last month I delete the others in this Internal Table, resting only one Material in each period. Did you understand ?