cancel
Showing results for 
Search instead for 
Did you mean: 

Print footer sentence.

Former Member
0 Kudos

Hi all,

There are FIRST page and NEXT page in sapscript form. My requirement is to print a sentence at the end of the page. I have created a FOOTER window to display the sentence. It depends how many data is extracted from the user selection. If there is only one page, the sentence will be printed on FIRST page. Whereas, if data extracted more than one page, the sentence will be printed on the NEXT page.

Kindly guide me how should I do this?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi myahsam wong,

In your Footer window do like this

/: IF &NEXT-PAGE& EQ 0.

P1 Print your footer sentence.

/: ENDIF.

This could resolve your problem.

Regards,

Suneel G

Former Member
0 Kudos

Hi Suneel,

The &NEXT-PAGE& is not working, there is no value in the variable.

Former Member
0 Kudos

Hi myahsam wong,

Sorry there is no '-' in between...

/: IF &NEXTPAGE& EQ '0'

P1 Print Footer note.

/: ENDIF.

Regards,

Suneel G

Former Member
0 Kudos

Hi Suneel,

Now it is working perfectly. I think your solution is the easiest and fastest way to resolve my problem.

Thanks to you and the rest...

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

For this put a footer window on First page and Next page with condition If &Next_page& EQ 0.

Former Member
0 Kudos

Hi MR Venkat,

Can I know where is the NEXT_PAGE comes from?

Is this a standard variable from SAP?

Former Member
0 Kudos

hi,

Try like this.

/: if &SAPSCRIPT-FORMPAGES& eq &PAGE&

P1 Write sentence you wanted

/: endif

Former Member
0 Kudos

Hi Jagadeesh,

As I know, the length for both fields are different.

I think it has to be condense it before we compare the fields.

Former Member
0 Kudos

Hi,

do like in Sap Script.

/E TEXT

/: DEFINE &FLAG& = ' '

/: PERFORM FORM_PAGE IN PROGRAM Z07VF0070

/: USING &SAPSCRIPT-FORMPAGES&

/: USING &PAGE&

/: CHANGING &FLAG&

/: ENDPERFORM

/: IF &FLAG& = 'X'

  • for ROBERT BOSCH POWER TOOLS SDN.BHD

/: ENDIF.

define the FORM in program Z07VF0070 like below:

FORM form_page TABLES input_table STRUCTURE itcsy

output_table STRUCTURE itcsy.

DATA:l_f_totpage(4) TYPE c,

l_f_page(4) TYPE c,

l_f_flag TYPE c.

CLEAR:l_f_totpage,l_f_page, l_f_flag.

READ TABLE input_table INDEX 1.

IF sy-subrc = 0.

l_f_page = input_table-value.

CONDENSE:l_f_page.

ENDIF.

READ TABLE input_table INDEX 2.

IF sy-subrc = 0.

l_f_totpage = input_table-value.

CONDENSE:l_f_totpage.

ENDIF.

IF l_f_page = l_f_totpage.

l_f_flag = 'X'.

ENDIF.

READ TABLE output_table INDEX 1. "sy-index.

output_table-value = l_F_flag.

MODIFY output_table INDEX 1.

ENDFORM. "spell_form

now, call the write_form FM and pass the element name 'TEXT' in which window u want to display.

Hope it helps!!

Regards,

Pavan

Former Member
0 Kudos

Hi vishnu Pavan,

Thanks for your input, I think your suggestion would be workable.

Will try that a short while later.

Thanks very much.

Former Member
0 Kudos

Hi myahsam,

In the driver program call the text element..

For example to display the grand total..this displays after all the line items are printed..

at last.
      call function 'WRITE_FORM'
       exporting
       element                          = 'GRAND_TOTAL'
*   FUNCTION                            = 'SET'
*   TYPE                                = 'BODY'
         window                         = 'MAIN'

Regards,

Sravanthi