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: 

Spool generated more than 1

Former Member
0 Kudos

Hi Expert,

My functional assigned my program (subroutine entry) and my smartforms to output type in MB1B.

I tried to posted MB1B, and the smartforms display correctly. But when i check in SP02 spool generated more than 1 for the same smartforms.

Seems like the smartforms was called for several times (same with how many spool created) --> i checked in the code the smartforms was called one time only in subroutine entry.

Maybe this information make you guys more idea:

Before i forgot to clear my internal table in the print program (subroutine entry) that called the smartforms and the internal table was append.

This what happened:

1 smartforms = 1 page (itab 1 record)

When i posted MB1B --> 2 spools --> 1 is 1 page (correct), 2 is 2 pages.

1 smartforms = 2 pages (itab 2 records)

When i posted MB1B -> 4 spools --> 1 is 2 pages (correct), 2 is 4 pages, 3 is 6 pages, 4 is 8 pages.

What i try to show is, why the itab also append? Even i forgot to clear the itab should be 1 soubroutine entry called 1 time only every time posted MB1B right? so the itab should not be append.

Now i clear the itab before call the smartforms.

This what happened:

1 smartforms = 1 page (itab 1 record)

When i posted MB1B --> 2 spools --> 1 is 1 page (correct), 2 is 1 page.

1 smartforms = 2 pages (itab 2 records)

When i posted MB1B -> 4 spools --> 1 is 2 pages (correct), 2 is 2 pages, 3 is 2 pages, 4 is 2 pages.

The pages correctly already, but why the spool still generated more than 1 spool?

Any idea for the possibility why this happen?

Best Regards,

Victor.

4 REPLIES 4

former_member223537
Active Contributor
0 Kudos

Hi Victor,

The reason why you are getting multiple spools is as follows:

1. You are looping out the internal table & call the Smartform FM

2. Inside the Smartform FM, you are again looping over the table to display data.

Do not call the Smartform FM in loop. Only pass the table table to Smartform FM.

Best regards,

Prashant

0 Kudos

Hi Prashant,

Thanks for the reply.

As i mentioned below, the smartforms was triggered by output type.

And i only call the smartforms once below then entry subroutine.

Inside the smartform got loop this correct.

I also pass the table to the smartform also.

Kindly suggest!

Best Regards,

Victor.

former_member223537
Active Contributor
0 Kudos

Hi Victor,

Seems there are multiple loops in Smartform.

Please hardcode a BREAK-POINT in SMARTFORM & execute MB1B.

Debug & check why its called multiple times.

That seems to be the only way out.

Thanks,

Best regards,

Prashant

0 Kudos

Hi Prashant,

If let say inside smartforms got multiple loop? is it can cause multiple spool?

I thought only if multiple call on the smartforms (not multiple loop inside the smartforms itself) will create multiple spool?

Btw Prashant,

If you see what happened when i forgot to clear my internal table.

2 records --> become 4 records --> become 6 records --> become 8 records..

What make me confuse is, this smartforms or the entry program that append that itab was called only by output type?

Is it possible the ouput type itself that triggered the smartforms more than 1 time?

Best Regards,

Victor.