You are on page 1of 2

How can I solve dump due to insufficient memory (SELECT)?

I am using a SELECT query on a database table. Since the number of records in the table is very
large,
the program dumps due to insufficient memory. How can I solve this?
In this case you could use the PACKAGE SIZE addition in the SELECT query to process in limited
amount of data,
thus avoiding the memory overloads.
Eg:

SELECT *

FROM <table>

INTO TABLE itab

PACKAGE SIZE <n>.

IF sy-subrc EQ 0.

\*" Process the n records

ENDIF.

ENDSELECT.

tables : mara.
data : it_mara like mara occurs 0 with header line.

select * from mara into table it_mara package size 100000000.


endselect.

loop at it_mara.
write : / sy-tabix, it_mara-matnr.
endloop.

How can I convert numerals into the corresponding text?


Use the Function Module SPELL_AMOUNT to convert the integer into text.

DATA v_int TYPE i VALUE '1000'.

DATA words LIKE SPELL.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = v_int

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = words.
WRITE words-word.
DATA words LIKE SPELL. " SPELL IS A STRUCTURE

CALL FUNCTION 'SPELL_AMOUNT'


EXPORTING
AMOUNT = 1111
* CURRENCY =''
* FILLER =''
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = WORDS
EXCEPTIONS
NOT_FOUND =1
TOO_LARGE =2
OTHERS =3
.
IF sy-subrc = 0.
WRITE : / 'SUCCESFULLY CONVERTED TO WORDS'.
ENDIF.

WRITE : / '1111 IN WORDS IS : ' , WORDS-WORD.

You might also like