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

failed to allocate memory

Former Member
0 Likes
1,412

hi everybody

im retrieving all the assets in the system in an internal table and convert it to csv format using the fm SAP_CONVERT_TO_CSV_FORMAT, there are abt 50000 records

when executing the program, im getting an error ' Fails to allocate memory' and the prg is stopped

is there a way i can stop that?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,314

Hi,

as you said 50,000 records.

itab1 contains 50000 records.

itab 2 is intial. ( which contains same strctu of itab1)

pass first 10000 records from itab1 and itab2.

download itab2 records in CSV format.

once download is complted first 10000 records, delete 10000 records from itab 2 as well as itab1.

then pass nest 10000 records from itab1 to itab2.

same thing repeat up to 50 000 records.

hi everybody

im retrieving all the assets in the system in an internal table and convert it to csv format using the fm SAP_CONVERT_TO_CSV_FORMAT, there are abt 50000 records

when executing the program, im getting an error ' Fails to allocate memory' and the prg is stopped

is there a way i can stop that?

10 REPLIES 10
Read only

Former Member
0 Likes
1,314

Hi,

Since, you have huge number of records its better to split them up into jobs and convert then to CSV format...

Read only

0 Likes
1,314

hi sneha

wat u mean by splitting them into jobs?

Read only

Nawanandana
Active Contributor
0 Likes
1,314

hi

you can use this FM for the download as a CVS format.


DATA: m_c_file        TYPE string.

  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = C:\DATA\test.CSV    
      filetype                = 'ASC'
*      write_field_separator   = 'X'
    TABLES
      data_tab                = itab
    EXCEPTIONS
      file_write_error        = 1
      no_batch                = 2
      gui_refuse_filetransfer = 3
      invalid_type            = 4
      no_authority            = 5
      unknown_error           = 6
      header_not_allowed      = 7
      separator_not_allowed   = 8
      filesize_not_allowed    = 9
      header_too_long         = 10
      dp_error_create         = 11
      dp_error_send           = 12
      dp_error_write          = 13
      unknown_dp_error        = 14
      access_denied           = 15
      dp_out_of_memory        = 16
      disk_full               = 17
      dp_timeout              = 18
      file_not_found          = 19
      dataprovider_exception  = 20
      control_flush_error     = 21
      OTHERS                  = 22.

Read only

Former Member
0 Likes
1,315

Hi,

as you said 50,000 records.

itab1 contains 50000 records.

itab 2 is intial. ( which contains same strctu of itab1)

pass first 10000 records from itab1 and itab2.

download itab2 records in CSV format.

once download is complted first 10000 records, delete 10000 records from itab 2 as well as itab1.

then pass nest 10000 records from itab1 to itab2.

same thing repeat up to 50 000 records.

Read only

0 Likes
1,314

rajasekhar

thats what ive been doing

but im still getting that allocation error

Read only

0 Likes
1,314

anjali,

use same what i mentioned.

but u have to increase your buffer size, so whatever the data records you are passing on application server after that just free the memory which was allocated to the records.

FREE: ITAB2[].

Read only

0 Likes
1,314

increase buffer size??

how u do that?

Read only

0 Likes
1,314

This will help you increase buffer size.

Read only

0 Likes
1,314

by using FREE statement we are increasing our buffer size.

after using FREE statement you are facing the same problem, then contact your basis person to increase virtual machine buffer size.

Read only

0 Likes
1,314

ive changed the way of doing it

im concatenating all the fields separated by ';' and transfer it to a dataset, then i use the fm GUI_DOWNLOAD to download the file

Will the data be different from the csv file which I would hav used in the fm 'SAP_CONVERT_TO_TEX_FORMAT'?

Can smbody confirm that with me plz?