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

Creating 1 spool for every 1000 sapscripts

Former Member
0 Likes
401

Hi Friends ,

I have a program where i am printing W-2 forms (sapscripts) . There are a total of 3000 forms . I need to be able to split them into 3 spools of 1000 each instead of creating 3000 spools . Please advise as to wat parameters need to be set in the beginning and when starting a new set of spool with 1000 forms .

Thanks,

Teresa

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
383

You need to count the records and then for every 1000 you have to make a new SPOOL..

LIke:

LOOP AT ITAB.
CNT = CNT + 1.
ITCPO-TDNEWID = ' '.

IF CNT =  1.
  ITCPO-TDNEWID = 'X'.
ENDIF.

OPEN_FORM
 wtih OPTIONS = ITCPO.

WRITE_FORM

CLOSE_FORM

IF CNT = 1000.
  CLEAR CNT.
ENDIF.

ENDLOOP.

Regards,

Naimesh Patel

Hi Friends ,

I have a program where i am printing W-2 forms (sapscripts) . There are a total of 3000 forms . I need to be able to split them into 3 spools of 1000 each instead of creating 3000 spools . Please advise as to wat parameters need to be set in the beginning and when starting a new set of spool with 1000 forms .

Thanks,

Teresa

1 REPLY 1
Read only

naimesh_patel
Active Contributor
0 Likes
384

You need to count the records and then for every 1000 you have to make a new SPOOL..

LIke:

LOOP AT ITAB.
CNT = CNT + 1.
ITCPO-TDNEWID = ' '.

IF CNT =  1.
  ITCPO-TDNEWID = 'X'.
ENDIF.

OPEN_FORM
 wtih OPTIONS = ITCPO.

WRITE_FORM

CLOSE_FORM

IF CNT = 1000.
  CLEAR CNT.
ENDIF.

ENDLOOP.

Regards,

Naimesh Patel