2011 Feb 14 1:41 PM
Hi gurus,
I am creating a report for counting and summing data in tables. But when executing a large table (over 15.000.000 records) it dumps with TSV_TNEW_PAGE_ALLOC_FAILED.
I do not know what is wrong because not one of my internal tables is too large. The error points to the fetch statement.
Do I need to clear a memory allocation or do something with the assigned fieldsymbol?
The code is like this:
* Open cursor for table
OPEN CURSOR WITH HOLD lv_cursor FOR
SELECT *
FROM (lw_table-tabname)
BYPASSING BUFFER
WHERE (lt_where).
DO.
* Set output table and content
lw_output-tabname = lw_table-tabname.
CREATE DATA lw_output-content
TYPE STANDARD TABLE OF (lw_output-tabname).
* Assign content table
ASSIGN lw_output-content->* TO <lfs_data>.
IF <lfs_data> IS NOT ASSIGNED. CONTINUE. ENDIF.
TRY.
* Get table content per 10000 records
FETCH NEXT CURSOR lv_cursor
INTO CORRESPONDING FIELDS OF TABLE <lfs_data>
PACKAGE SIZE 10000.
CATCH cx_root. "#EC CATCH_ALL
* Close the cursor
CLOSE CURSOR lv_cursor.
ENDTRY.
* Append the output structure to the output table
APPEND lw_output TO me->gt_output.
UNASSIGN <lfs_data>.
CLEAR: lw_output.
ENDDO.
Hi gurus,
I am creating a report for counting and summing data in tables. But when executing a large table (over 15.000.000 records) it dumps with TSV_TNEW_PAGE_ALLOC_FAILED.
I do not know what is wrong because not one of my internal tables is too large. The error points to the fetch statement.
Do I need to clear a memory allocation or do something with the assigned fieldsymbol?
The code is like this:
* Open cursor for table
OPEN CURSOR WITH HOLD lv_cursor FOR
SELECT *
FROM (lw_table-tabname)
BYPASSING BUFFER
WHERE (lt_where).
DO.
* Set output table and content
lw_output-tabname = lw_table-tabname.
CREATE DATA lw_output-content
TYPE STANDARD TABLE OF (lw_output-tabname).
* Assign content table
ASSIGN lw_output-content->* TO <lfs_data>.
IF <lfs_data> IS NOT ASSIGNED. CONTINUE. ENDIF.
TRY.
* Get table content per 10000 records
FETCH NEXT CURSOR lv_cursor
INTO CORRESPONDING FIELDS OF TABLE <lfs_data>
PACKAGE SIZE 10000.
CATCH cx_root. "#EC CATCH_ALL
* Close the cursor
CLOSE CURSOR lv_cursor.
ENDTRY.
* Append the output structure to the output table
APPEND lw_output TO me->gt_output.
UNASSIGN <lfs_data>.
CLEAR: lw_output.
ENDDO.
2011 Feb 14 1:51 PM
Hi,
I have faced the same problem in my 64bit server. I have tried with increasing the following parameters in profile:
Ztta/roll_area
Abap/heap_area_total
Abap/heap_area_dia
Abap/heap_area_nondia
This problem may occure due to lack of memory on server or very expensive select query, plz try as above with your basis as it worked 4 me.
Also check Note 552209 addresses the settings for the memory intensive programs for which available address space (memory) is still insufficient even after the parameter change.
Regards,
Umang Mehta
2011 Feb 14 3:03 PM
Sorry, when removing the append and setting the runtime variable to 999999 the program works.
regards Wim
2011 Feb 14 3:14 PM
You use the PACKAGE SIZE option, but you never refresh your internal table. The internal table grows and eventually you get a memory overflow.
Rob
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |