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: 

combine two sapscript outputs into a single spool

Former Member
0 Kudos
990

Hi,

it would be a neat way of solving a print issue if the output (via sapscripts) could be combined from two print programs.

The two print programs in question are z copies of the delivery note print program and the tranfer order print program. I have taken copies of each and now call the copy of TO print program from the delivery note print program. Can anyone advise what determines when a new spool is created?

The 'newid' param from structure ITCPO which is passed when doing an open-form does not seem to make any difference in this scenario.

thanks

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
222

I believe that when you do the OPEN_FORM --> CLOSE_FORM is when the spool is determined. I don't that that you can OPEN it in one program and CLOSE it in another. What you are talking about is possible, but it will probably take a large amount of changes. I'm think instead of having two driver programs, you would have one and the same for the sapscript form. You can control what gets printed from an output type or somthing.

For example,

IF the output type is = 'X', then only print the first form. If the output type is 'Y', then print onlny the second form. If the output type is 'Z', then print both forms.

Regards,

Rich Heilman

10 REPLIES 10

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
223

I believe that when you do the OPEN_FORM --> CLOSE_FORM is when the spool is determined. I don't that that you can OPEN it in one program and CLOSE it in another. What you are talking about is possible, but it will probably take a large amount of changes. I'm think instead of having two driver programs, you would have one and the same for the sapscript form. You can control what gets printed from an output type or somthing.

For example,

IF the output type is = 'X', then only print the first form. If the output type is 'Y', then print onlny the second form. If the output type is 'Z', then print both forms.

Regards,

Rich Heilman

0 Kudos
222

Thanks for that, unfortunately to throw a spanner in the works we cannot change the output types!

If i repeatedly run, say, the print output function from VL02 with print immediately unflagged it will keep create a spool and then keep adding pages to it. The same works if I keep running the TO program.

So..I wonder what drives this and if it might be manipulated to make the output from two different print programs sit on the same spool?

Im presuming I will have to open and close_form for each ouput in its respective print program?

0 Kudos
222

...just seen the 2nd reply - thanks for that. I will try what has been suggested but if anyone can tell me how I can do it without having to copy one program into the other I would be interersted to know...ie avoiding the overhead of having to keep two the print program updated in two places.

0 Kudos
222

Vinod - I have tried changing the ITCPO parameters the same but it doesnt seem to make work.

0 Kudos
222

In the print dialog box for VL02 and TO can you give the same field values. This may help you to have all the outputs in the same spool.

0 Kudos
222

Hi Vinod,

I tried this but unfortunately it didnt work. I will keep working at this.

0 Kudos
222

Hi all,

ive still got a probelm with this. Can anyone tell me if it is possible to do this? It one of those problems where it seems to me there should be a way to do this...Im just not sure what?!

0 Kudos
222

in the end i managed to do this by bringing data back from the called program and doind a start/end form in the calling program. The problem was due to the two layout sets having different page formats. once they were the same this worked okay.

thanks to all those that helped.

Phil.

Former Member
0 Kudos
222

Put both codes into a single program. Now try calling START_FORM instead of OPEN_FORM for the second form.

~Sivaraj.

Vinod_Chandran
Active Contributor
222

Hi Phil,

Please try the following option.

Keep all the fields in ITCPO for both the spool requests same and ITCPO-TDNEWID = SPACE.

If this is not working, as others mentioned follow this step.

OPEN_FORM

..START_FORM "First Form

...WRITE_FORM

...

...

..ENDFORM

..START_FORM "Second Form

...WRITE_FORM

...WRITE_FORM

...

..ENDFORM

..

..

CLOSE_FORM

Thanks

Vinod