cancel
Showing results for 
Search instead for 
Did you mean: 

Need footer in last page only

Former Member
0 Kudos

Dear Friends,

In SAPScript, i have defined only one page: header, main and footer. In the ouput,there are more than 1 page, suppose 3 pages. so the footer will come in all the 3 pages. how to make the footer appear in only the last page.

Thanx in Advance.

I Promise to reward.

Geetu.

Accepted Solutions (0)

Answers (4)

Answers (4)

dru_marcellana
Participant
0 Kudos

Hi Geeta,

You need to create an element in the MAIN window. You can do it in two ways:

1. In SE71, you can create:

/:E FOOTER

/:BOTTOM

  • Text

/:ENDBOTTOM

In the print program, just call this element.

2. In you print program, populate parameter type = BOTTOM in FM, WRITE_FORM.

Ex.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'FOOTER'

type = 'MAIN'

window = 'BOTTOM'

EXCEPTIONS....

However, if you issue new page having new header data. Thus, new item data. And if it will exceed more than 1 page, the footer will still appear. To solve this, you need to create a new element in MAIN. Ex. INIT_FOOTER. It just contains the following:

/:E INIT_FOOTER

/:BOTTOM

/:ENDBOTTOM

Call this after passing all item data.

Regards,

Dru

Former Member
0 Kudos

Hi,

write this code then the footer will be printed in last page itself

/: IF &NEXTPAGE& EQ 0

whatever footer you want.

/: ENDIF

Former Member
0 Kudos

Hi Geeta,

If u r not interested to change the print program. Then simply insert simple code in the footer wondow.

now insert this code in ur footer window

IF &TTXSY-PAGE& = &SAPSCRIPT-FORMPAGES&.

*all code in footer goes here.

ENDIF.

&TTXSY-PAGE& holds the page number of current page.

&SAPSCRIPT-FORMPAGES& holds total form pages.

This will work.

Add points if usefull.

Thanks,

Sharat.

Former Member
0 Kudos

Hi Geeta

In such senario no need to use a window for footer.

In the<b> Script form:</b>

-> In the Main Window itself after all the main data create an Element.

-> Use BOTTOM and END-BOTTOM; write your footer information between them.

In your <b>Driver Program:</b>

-> After printing all the data (means after passing to form and before closing the form) call one WRITE-FORM with the footer element.

I'm sure it will work.

Regars

Surya.