cancel
Showing results for 
Search instead for 
Did you mean: 

To Print the same page for Multiple times in SAPSCRIPT

Former Member
0 Kudos

Hi All,

I want to print the custom Invoice SAPSCRIPT to print 4 times with changes only in Header form as 'Original for Buyer', 'Duplicate for transport', Duplicate for Assesse, Triplicate for Central Excise,

how to print in such a way,,where to write the logic.. kindly guide me,

Thanks in Advance

Kesav

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor
0 Kudos

This can be done, by changing the driver program.

Loop it 4 times, between open form and closed form

Example:

DO 4 times.
***OPEN_FORM
***WRITE_FORM
CASE SY-INDEX.
WHEN '1'.
VAR1 = 'Original for Buyer'.
WHEN '2'.
VAR1 = ' 'Duplicate for transport'.
WHEN '3'.
VAR1 = 'Duplicate for Assesse'.
WHEN '4'.
VAR1 = 'Triplicate for Central Excise'.
ENDCASE.
***WRITE_FORM
-----
----
***CLOSE_FROM
ENDDO.

If you want to all forms in one single spool then use start_from with the above logic.

Regards,

SaiRam

former_member874488
Discoverer
0 Kudos

Hi Ram,

How can we print all the forms in a single spool?

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kesava,

If you are using a standard script, serach for 'NAST-ANZAL' keyword (Note: it would be used in a do loop like do nast-anzal times.)

Just instead of passing nast-anzal , try to hardcode 4 and see the result.

Hope this will help you to resolve the issue & close the thread.

BR,

Vinit

Former Member
0 Kudos

You can do that in the following way: use Customizing for example Transaction NACE...

Select your output type and customize a second, third, fourth or fifth processing routine

using the same Progam and Form but another Form Routine.

The Nast-Output loops through up to the 5 form routines and can generate up to 5 printouts in this way .

In the below descibed example will be 3 documents generated with only the VAR1-Info changed....

example:

TA NACE: Your output type -> Processing Routines -> Select "Print Output" -> select Details -> Add Processing2/3/4/5

form routine "entry" for "Processing1"

form routine "entry2" for "Processing2"

form routine "entry3" for "Processing3"

edit your print program:

copy the old form "entry" or similar entry-routine from your print program

to "entry2" and "entry3"

report zprintprog.

DATA VAR1(100) Type C.

form entry using .....
VAR1 = 'Original for Buyer'
.
.
.
endorm.

form entry2 using .....
VAR1 = 'Duplicate for transport'
.
.
.
endorm.

form entry3 using .....
VAR1 = 'Triplicate for Central'
.
.
.
endform.

...you have to use the VAR1-variable in your form

for example in a header-window...