‎2013 Jun 30 2:07 PM
Hi All,
I have a requirement where I need to stop a report from dumping in case internal table memory can't be expanded farther.
Error : TSV_TNEW_PAGE_ALLOC_FAILED
This dump occurs when a particular internal table has huge no of records and can not take farther.
I had two ways in mind to avoid this dump.
1. Handle this exception.
2. Determine memory allocated for this work process (report) and then anticipate memory that will be required for the report.
If that is more than allocated memory, throw a message saying 'Amount of data too big.'
The first way I found is not possible.
Can anyone help me find a way to have the second method??
May be some FM or call to determine the current memory allocation to this report and then somehow I will try to anticipate the memory required
for the report.
Regards,
Saurabh.
‎2013 Jun 30 5:16 PM
Hi Saurabh,
The first one should be possible. Generally you can catch the exception in Try......Enddtry block and call the get_text() method to display the error text. This will prevent the program from dumping.
Sample snippet - >
Assuming TSV_TNEW_PAGE_ALLOC_FAILED is exception class's name
data :
lv_ref TYPE REF TO TSV_TNEW_PAGE_ALLOC_FAILED,
lv_err_txt TYPE string.
TRY.
*-- Your code which can cause exception
CATCH TSV_TNEW_PAGE_ALLOC_FAILED INTO lv_ref.
lv_err_txt = lv_ref->get_text( ).
ENDTRY.
IF lv_err_txt IS NOT INITIAL.
MESSAGE lv_err_txt TYPE 'E'.
ENDIF.
Revert if i didn't understand you correctly.
BR.
‎2013 Jun 30 5:28 PM
‎2013 Jul 22 4:14 PM
‎2013 Jul 22 4:14 PM
Hi All,
I skipped this procedure and went for totally different solution.
Memory management in SAP is a very complex and random process and going after this for a custom program is not advisable from my point of view.
Regards,
Saurabh.
‎2013 Jul 23 12:31 PM
Just for the record:
The class CL_ABAP_MEMORY_UTILITIES and its static methods can help you out (at times).
Especially
CL_ABAP_MEMORY_UTILITIES=>GET_MEMORY_SIZE_OF_OBJECT( )
Regards,
Chris
‎2013 Jul 23 12:40 PM
Hi Saurabh,
If you want to find the amount of memory allocated to individual workprocess proceed as follows:
1) goto tcode ->sm66
2)from the menu bar processlist->display->memoryusage
you can find out memory consumed by all workprocess globally.
Regards,
Arjun Shenoy