cancel
Showing results for 
Search instead for 
Did you mean: 

multiple form printing

Former Member
0 Kudos

Hi

I am new in sapscript, and I would like to know, if is it possible to make more output for more data. If for example I have in printing report an internal table with three element, and I want to trigger distinct print for each element, how can I do it?

I tried to open / write / close form in loop analizing table, but doesn't work .. how can I solve it?

thanks

gabriele

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

could you plz ellaborate litte with an example..

Rgds,

Pavan

Former Member
0 Kudos

Hi

what I should do is this: I have internal table for example made by two field

TYPE and VALUE and internal table is ordered by type. Suppose internal table contains this values:

T1 VAL1

T1 VAL2

T1 VAL3

T2 VAL1

T2 VAL2

T3 VAL1

T3 VAL2

T3 VAL3

T3 VAL4

What I need is while looping internal table is this: if type change, create a new page with the same form, so that I have the report, printing 3 page:

the first contains

T1 VAL1

T1 VAL2

T1 VAL3

the second

T2 VAL1

T2 VAL2

the third

T3 VAL1

T3 VAL2

T3 VAL3

T3 VAL4

So what I don't know is while looping how to say to form "stop printing this page and start print another page"

thanks

Gabriele

Former Member
0 Kudos

Hi,

Make use of control break statements.

at new type issue new-page.

call open_form.

loop at itab into fs.

call write_form.

at new fs-type.

call control_form.( new-page).

endat.

endloop.

call close_form.

Former Member
0 Kudos

Hi,

wht u can do is, use the Function Module 'CONTROL_FORM' to trigger a new page for every new type.

data : wa like line of itab.

sort itab by TYPE.

LOOP AT itab.

wa = itab.

at new wa-type.

call function 'CONTROL_FORM'

command = 'NEW-PAGE'.

endat.

ENDLOOP.

Hope it works!!

Rgds,

Pavan

Answers (1)

Answers (1)

Former Member
0 Kudos

thanks