Application Development 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: 

Time limit exceeded for abap program

Former Member
0 Kudos

Hi All,

I am executing a z program which reads data from DB and creats an XLS FIle.I am getting this error.

--> The program "SAPLZM03" has exceeded the maximum permitted runtime without

interruption, and has therefore been terminated.

Everytime the program shows different line of error in the dump analysis st22.

For this dumpm the error is at -->

SELECT EBELN BUKRS LIFNR WAERS WKURS BEDAT KDATE LLIEF INCO1

AEDAT

INCO2 AEDAT

INTO TABLE I_EKKO

FROM EKKO

WHERE ( BSART = 'CROP' OR BSART = 'SAS' )

AND BSTYP = 'K'

AND LOEKZ = ' '.

I am not understanding why a different line is shown at the timeout.How can I resolve this issue ?

Regards,

Shital

18 REPLIES 18

Sm1tje
Active Contributor
0 Kudos

Time out error (about 5 or 10 minutes) will hardly ever be on exactly the same line, since this on several variables. So it will differ from run to run.

Former Member
0 Kudos

Thanks for your response.How can this issur be resolved?

Sm1tje
Active Contributor
0 Kudos

You will have to do a performance analysis first to find out where it really hurts, performance wise.

Based on the code you gave, we can't really say anything at all.

BTW. Read performance tuning forum post first. A lot of useful tips to be found here.

Former Member
0 Kudos

Thanks!

but is there any way to set the timeout period to more than 10 mins ?

Former Member
0 Kudos

Yes,

This limit is set by the basis team. You can set it as much as you want.

Regards,

Sharath

Former Member
0 Kudos

thanks!

Can we set the limit for a specific program only ?

Sm1tje
Active Contributor
0 Kudos

No, this is a SYSTEM (profile) parameter.

Former Member
0 Kudos

As micky said this is a system parameter and is applicable for all programs.

Regards,

Sharath

Former Member
0 Kudos

Thanks! let me speak to the basis guys

What about writing a commit after every select ...will that help ?

Sm1tje
Active Contributor
0 Kudos

No, it won't. Totally different subjects.

Try not to change the time out parameter, change the code. That's were the actual problem lies, probably in the database access(es).

Former Member
0 Kudos

No, COMMIT WORK wont solve the problem.

Use performance Optimizing techniques to optimize your select like using primary keys, creating secondary index etc.

Regards,

Sharath

Former Member
0 Kudos

Hi Shital,

In your query the issue is :

In a SELECT access, the read file could not be placed in the target
field provided.
Either the conversion is not supported for the type of the target field,
the target field is too small to include the value, or the data does not
have the format required for the target field.

Once you make use of the INTO CORRESPONDING FIELDS OF TABLE it will quickly dump all the values into the internal table, enabling lesser time consumption.

Try this, if not please reply back.

Regards,

-Syed.

Sm1tje
Active Contributor
0 Kudos

Syed,

what makes you think this is the problem?

What you are describing is a problem that occurs when using an internal table which does not equal the actual fields from the select resulting in a short dump. In this case, however, a time out error occurs, resulting in a short dump as well, but two totally different issues.

Former Member
0 Kudos

I agree with Micky ,

Time out error (about 5 or 10 minutes) will hardly ever be on exactly the same line, since this on several variables. So it will differ from run to run.

Now I need to optimize the code.

What are the most important things I should look for in a select that will make a quick difference once the query is optimized?

Sm1tje
Active Contributor
0 Kudos

Some pointers (quite general):

1. Do not use SELECT - ENDSELECT.

2. No SELECT within LOOP.

3. User sorted, hashed internal tables with (non)unique key.

4. Use primary/ secondary index for database access.

5. Use Joins.

6. etc. etc.

Again, the code extract you posted looks ok (Use of secondary index BSTYP), but 'we' would need to see the 'whole' code to give you some more specific help. However, since this is a module pool program this will not be easy to do in a way to keep it readable. Especially when you are using OO as well.

Former Member
0 Kudos

At the moment I am running the program in background and that is working.

meanwhile I need to go through the code and optimize it.

Former Member
0 Kudos

Hi Shital,

Please change the code according to this.

DATA: i_ekko TYPE STANDARD TABLE OF ekko,
      i_ekko_wa LIKE LINE OF i_ekko.

START-OF-SELECTION.
  SELECT ebeln bukrs lifnr waers wkurs bedat kdate llief inco1
  aedat
  inco2 aedat
  INTO CORRESPONDING FIELDS OF TABLE i_ekko
  FROM ekko
  WHERE bsart = 'NB' " OR bsart = 'SAS' )
  AND bstyp = 'F'
  AND loekz = ''.

  IF sy-subrc = 0.
    IF NOT i_ekko IS INITIAL.
      SORT i_ekko BY ebeln.
      LOOP AT i_ekko INTO i_ekko_wa.
        READ TABLE i_ekko INTO i_ekko_wa WITH KEY ebeln = i_ekko_wa-ebeln.
        WRITE: AT 10 i_ekko_wa-ebeln, i_ekko_wa-bukrs, i_ekko_wa-lifnr.
        WRITE: AT 20 i_ekko_wa-waers, i_ekko_wa-wkurs, i_ekko_wa-bedat.
      ENDLOOP.
    ENDIF.
  ENDIF.

This will not give you the time out error.

Regards,

-Syed.

Edited by: Matt on May 12, 2009 3:55 PM

matt
Active Contributor
0 Kudos

Moved to the correct forum

And for further tips - do what Micky said:

>BTW. Read performance tuning forum post first. A lot of useful tips to be found here.