05-12-2009 2:04 PM
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
05-12-2009 2:06 PM
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.
05-12-2009 2:07 PM
Thanks for your response.How can this issur be resolved?
05-12-2009 2:09 PM
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.
05-12-2009 2:12 PM
Thanks!
but is there any way to set the timeout period to more than 10 mins ?
05-12-2009 2:17 PM
Yes,
This limit is set by the basis team. You can set it as much as you want.
Regards,
Sharath
05-12-2009 2:18 PM
thanks!
Can we set the limit for a specific program only ?
05-12-2009 2:20 PM
05-12-2009 2:21 PM
As micky said this is a system parameter and is applicable for all programs.
Regards,
Sharath
05-12-2009 2:22 PM
Thanks! let me speak to the basis guys
What about writing a commit after every select ...will that help ?
05-12-2009 2:24 PM
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).
05-12-2009 2:27 PM
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
05-12-2009 2:29 PM
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.
05-12-2009 2:35 PM
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.
05-12-2009 2:38 PM
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?
05-12-2009 2:46 PM
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.
05-14-2009 10:27 AM
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.
05-12-2009 2:24 PM
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
05-12-2009 2:57 PM
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.