cancel
Showing results for 
Search instead for 
Did you mean: 

Print on the last page of a Sapscript form

odysseas_spyroglou
Participant
0 Kudos

Hi,

Is it possible (and how) to print something (a filed of an internal table) only to the last page of a sapscript form?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

It is possible.

there are several ways to do it. I will describe 2.

1.You must make an item (/E) in the main window with your field in it.

eg.

/E LAST

  • &VAr_last&

In your printprogram just before close_form and end_form you add a write_form with that item.

2. you add a window with the field you wanna print.

In that window you can put a condition like

/: if &PAGE(C)& EQ &SAPSCRIPT-FORMPAGES(C)&

  • &VAR_LAST&

/: endif

Gr., Frank

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

In the driver program

at last.
      call function 'WRITE_FORM'
       exporting
       element                          = 'LAST'
         window                         = 'MAIN'

Regards,

Sravanthi

former_member585865
Contributor
0 Kudos

Hi,

If you want only the contents to printed in the lat page just follow the code in the sap script.

/: IF &PAGE& EQ &SAPSCRIPT-FORMPAGES(Z)&

<Do your Code Here>

/: ENDIF

Former Member
0 Kudos

Hi

if you want to print something at the end of a page....

You can write it as this...

in the main window...

in the data element write it...

/E END_DATA

/: IF &PAGE& EQ &SAPSCRIPT-FORMPAGES&.

  • &W_VALUE&.

/: ENDIF.

SAPSCRIPT-FORMPAGES variable is a system variable which stores the total pages.

PAGE variable stores the current variable accordingly it will check for last page and print it.

Now call it in the driver program .

Regards.