‎2006 Feb 23 9:59 AM
Hi experts,
In the following code RESULT tab is having 4000 records and ITAB is haing 3,00,000 records.when iam trying to append into FINRESULT, why it is going to dump??
LOOP AT <b>RESULT</b>.
LOOP AT <b>ITAB</b> WHERE MATNR = RESULT-MATNR.
IF SY-SUBRC = 0.
TAMT = RESULT-LBKUM * RESULT-VERPR.
9MTH = RESULT-QTY1 * RESULT-VERPR.
10MTH = RESULT-QTY2 * RESULT-VERPR.
13MTH = RESULT-QTY3 * RESULT-VERPR.
24MTH = RESULT-FBALQTY * RESULT-VERPR.
MOVE-CORRESPONDING: RESULT TO FINRESULT.
MOVE: TAMT TO FINRESULT-FTAMT,
9MTH TO FINRESULT-F9MTH,
10MTH TO FINRESULT-F10MTH,
13MTH TO FINRESULT-F13MTH,
24MTH TO FINRESULT-F24MTH.
APPEND <b>FINRESULT</b>.
* CLEAR FINRESULT.
* COLLECT FINRESULT.
ENDIF.
ENDLOOP.
ENDLOOP.
‎2006 Feb 23 10:10 AM
Hi,
in ST22 we can know the reason of the dump , what was the first statement of the dump, check this.
this is timeout problem , try to change the logic or run the program in background.
Laxman
Message was edited by: Laxmana Kumar
‎2006 Feb 23 10:12 AM
‎2006 Feb 23 10:15 AM
----------------------------------------------------------------------------------------------------
|Error analysis |
| 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 600 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 600 seconds. |
| Hence the maximum runtime of a program is at least twice the value of |
| the system profile parameter "rdisp/max_wprun_time". |
| |
| |
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|How to correct the error |
| 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: |
| |
| ------------------------------------------------------------------------ |
| "TIME_OUT" C |
| "Z_AGERPB1_CHANGE" or "Z_AGERPB1_CHANGE" |
| "START-OF-SELECTION" |
| ------------------------------------------------------------------------ |
| If you cannot solve the problem yourself and you wish to send |
| an error message to SAP, include the following documents: |
| |
| 1. A printout of the problem description (short dump) |
| To obtain this, select in the current display "System->List-> |
| Save->Local File (unconverted)". |
| |
| 2. A suitable printout of the system log |
| To obtain this, call the system log through transaction SM21. |
| Limit the time interval to 10 minutes before and 5 minutes |
| after the short dump. In the display, then select the function |
| "System->List->Save->Local File (unconverted)". |
| |
| 3. If the programs are your own programs or modified SAP programs, |
| supply the source code. |
| To do this, select the Editor function "Further Utilities-> |
| Upload/Download->Download". |
| |
| 4. Details regarding the conditions under which the error occurred |
| or which actions and input led to the error.
‎2006 Feb 23 10:19 AM
The dump is not due to a syntax error, it is because the program 'timed out' during execution. Since you are looping at itab within the Result tab, for each record in the Result tab, the program loops at 3,00,000 entries in itab.
The max runtime set for an ABAP program is usually around 10 mins, and when your program took longer than that to execute, it was terminated.
You might need to re-look at your logic and optimize the performance of your report.
Sudha
Message was edited by: Sudha Mohan
‎2006 Feb 23 10:15 AM
In the ST22, you will see that SAP set a limit of size for internal table. You could try to ask your administrator to modify that limite (maybe with rz10)
I think, the better way, is to change your logic code
OOoops, it's a timeout, your program is too slow.
Rgd
Frédéric
Message was edited by: Frédéric Girod
‎2006 Feb 23 10:19 AM
As mentioned in the log,
The program has exceeded it runtime parameter.
As mentioned earlier you can change the rdisp/max_wprun_time parameter in RZ10 transaction EXTENDED MAINTENANCE.
Regards,
Wenceslaus.
‎2006 Feb 23 10:18 AM
Hi kaki,
1. TIME OUT
time out problem is happening.
2. Since your both itab contain 4000 and 3 lakh records,
the final count is
4000 X 3 lac
and it goes more than 10 minutes (600 seconds)
3. Hence, this error (this error is common)
4. Either increase the time out (by taking
help of basis team)
5. Or reduce the number of records
6. Or do in bunch of records.
regards,
amit m.
‎2006 Feb 23 10:18 AM
sort result by matnr.
delete adjacent duplicates...
loop at itab.
read table result where matnr = itab-matnr.
if sy-subrc = 0.
move-corresponding....
append finaltab.
endif.
endloop.
the above specified code will give better performance and i hope u will not get dump.
Thanks
Eswar
‎2006 Feb 23 10:21 AM
Hi Kaki,
Run Background Job, instead of foreground.
Regards
vijay
‎2006 Feb 23 10:47 AM
Hi Kaki,
1. I agree with Vijay.. run it in background
2. Pl make the following change to the code for some performance improvement.
sort itab by matnr.
LOOP AT RESULT.
read table ITAB with key MATNR = RESULT-MATNR
binary search.
if sy-subrc eq 0.
TAMT = RESULT-LBKUM * RESULT-VERPR.
9MTH = RESULT-QTY1 * RESULT-VERPR.
10MTH = RESULT-QTY2 * RESULT-VERPR.
13MTH = RESULT-QTY3 * RESULT-VERPR.
24MTH = RESULT-FBALQTY * RESULT-VERPR.
MOVE-CORRESPONDING: RESULT TO FINRESULT.
MOVE: TAMT TO FINRESULT-FTAMT,
9MTH TO FINRESULT-F9MTH,
10MTH TO FINRESULT-F10MTH,
13MTH TO FINRESULT-F13MTH,
24MTH TO FINRESULT-F24MTH.
APPEND FINRESULT.
CLEAR FINRESULT.
delete itab where matnr = result-matnr.
ENDIF.
ENDLOOP.
Regards,
Suresh Datti
‎2006 Feb 23 10:56 AM
Hi
You can also try to improve the performance by using sorted table:
DATA: ITAB LIKE SORTED TABLE OF <TYPE_LINE>
WITH NON-UNIQUE KEY MATNR WITH HEADER LINE.
LOOP AT RESULT.
LOOP AT ITAB WHERE MATNR = RESULT-MATNR
Now the reading of itab is faster, it''ll only be slower the uploading of data in ITAB, because while uploading it have to sort them.
Max
‎2006 Feb 23 11:19 AM
Hi Kaki,
I believe you should use "Read" while fetching from second internal table. See the below code:
LOOP AT RESULT.
<b>Read Table ITAB With key MATNR = RESULT-MATNR.</b>
IF SY-SUBRC = 0.
TAMT = RESULT-LBKUM * RESULT-VERPR.
9MTH = RESULT-QTY1 * RESULT-VERPR.
10MTH = RESULT-QTY2 * RESULT-VERPR.
13MTH = RESULT-QTY3 * RESULT-VERPR.
24MTH = RESULT-FBALQTY * RESULT-VERPR.
MOVE-CORRESPONDING: RESULT TO FINRESULT.
MOVE: TAMT TO FINRESULT-FTAMT,
9MTH TO FINRESULT-F9MTH,
10MTH TO FINRESULT-F10MTH,
13MTH TO FINRESULT-F13MTH,
24MTH TO FINRESULT-F24MTH.
APPEND FINRESULT.
CLEAR FINRESULT.
COLLECT FINRESULT.
ENDIF.
ENDLOOP.
I think by this you are removing one whole iteration.
I hope it helps. Reward if it is useful.
Regards,
Jignesh.
‎2006 Feb 23 3:00 PM
I wrote a <a href="/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops on this a couple of weeks ago. Check it out.
Rob
‎2006 Feb 23 4:11 PM
On second thought, why do you loop at ITAB at all? You don't use any of its data.
Rob