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

To write internal table with huge data into spool

venkatasap
Participant
0 Likes
1,106

Hi Sapall.

here i have got a requirement to chage the existing program to write all the contents of ITAB into spool.

the present program is writing all teh data of itab into a local file,as the data is huge it tooks a long time to write into a local file.

so now i want to write the itab data into spool so that it will be a better performance when we talk about teh long data.

so can any body help me in solving this issue.

regards.

Varma

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
572

I am not sure if that is a good Idea. As far as time is concerned I don't think there will be any significant Improvement by writing it to spool instead of file. Also displaying a big spool through the GUI will cause memory issues.

Is your program writing to the file in small packets?? Most of the perfromance issue could be because you have huge amount of data in internal memory at one point of time.

2 REPLIES 2
Read only

Former Member
0 Likes
572

Hi Varma,

hope this helps.

Source ABAPer blogspot

REPORT ztest_program.
DATA: BEGIN OF it_t001 OCCURS 0,
       bukrs TYPE t001-bukrs,
       butxt TYPE t001-butxt,
       ort01 TYPE t001-ort01,
       land1 TYPE t001-land1,
     END OF it_t001.
DATA: it_data TYPE TABLE OF lvc_s_1022,
     wa_data LIKE LINE OF it_data.
DATA:spoolid TYPE rspoid.
DATA:file_length TYPE  int4.

START-OF-SELECTION.
 SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_t001.
 LOOP AT it_t001.
   CONCATENATE it_t001-bukrs
               it_t001-butxt
               it_t001-ort01
               it_t001-land1
             INTO wa_data SEPARATED BY space.
   APPEND wa_data TO it_data.
   CLEAR  wa_data.
 ENDLOOP.
 DESCRIBE TABLE it_data.
 file_length = sy-tfill * 1022.
 CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
   EXPORTING
     i_file_length = file_length
   IMPORTING
     e_spoolid     = spoolid
   TABLES
     it_textdata   = it_data.
 IF sy-subrc EQ 0.
   WRITE spoolid.
 ENDIF.

Regards,

SuryaD.

Read only

Former Member
0 Likes
573

I am not sure if that is a good Idea. As far as time is concerned I don't think there will be any significant Improvement by writing it to spool instead of file. Also displaying a big spool through the GUI will cause memory issues.

Is your program writing to the file in small packets?? Most of the perfromance issue could be because you have huge amount of data in internal memory at one point of time.