Application Development 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: 

Split Task TO Process

Former Member
0 Kudos

Hi Experts,

I have database more than 3,000,000 records. I want to download data to server. If I select data into internal table

the program will be terminate "No storage space".

How I can separated process.

thanks.

2 REPLIES 2

Former Member
0 Kudos

Hi,

Use a cursor to read sections of the table at a time and then download the data in packets to the file.

Such as...

DATA: cur TYPE cursor. 


OPEN CURSOR vur FOR 
  SELECT * 
         FROM spfli 
         ORDER BY carrid. 

DO. 
  FETCH NEXT CURSOR cur 
    INTO TABLE spfli_tab PACKAGE SIZE 100. 
  IF sy-subrc <> 0. 
    EXIT. 
  else.
*   Download to the server......
  ENDIF. 
ENDDO. 

CLOSE CURSOR: cur.

Regards,

Darren

Former Member
0 Kudos

Hi, Guru

Thank You for reply but I use

OPEN CURSOR cursr FOR SELECT * FROM ZTABLE.

DO.

FETCH NEXT CURSOR cursr INTO wa_ztable.

IF sy-subrc <> 0. CLOSE CURSOR cursr. EXIT. ENDIF.

APPEND wa_ztable TO ITAB.

ADD 1 TO records.

IF records EQ 100000.

CALL FUNCTION 'Z_SPLIT' STARTING NEW TASK

.....

......

CLEAR records.

ENDIF.

ENDDO.

The Process has work only first task next task has error

"DBIF_RSQL_INVALID_CURSOR"

Thanks,