Application Development and Automation 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: 
Read only

Determine memory allocation to the current work process during report execution.

Former Member
0 Likes
1,073

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.


6 REPLIES 6
Read only

Former Member
0 Likes
823

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.

Read only

anilkumar_kalkivai
Active Participant
0 Likes
823

Hi Saurabh,

Please refer below link.

http://scn.sap.com/message/3797832

Regards,

Anil.

Read only

Former Member
0 Likes
823

This message was moderated.

Read only

Former Member
0 Likes
823

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.

Read only

0 Likes
823

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

Read only

Former Member
0 Likes
823

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