Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Rouitne pool from Form

kesavadas_thekkillath
Active Contributor
0 Likes
533

Hi,

I want to print a custom footer text in every pages like 'CONTD..TO PAGE 2' on page one and contionously till the last second page.

so have done something like this

DEFINE &PRINT& = ' '.

PERFORM GET_PAG IN PROGRAM YSUBPOOL_PAGEFOOTER

USING &PAGE(3ZC)& &SAPSCRIPT-FORMPAGES(3ZC)&

CHANGING &PRINT&

ENDPERFORM

,,,,,,,,,,,,,,,,,,&PRINT&


FORM get_pag TABLES intable STRUCTURE itcsy
                    outtable STRUCTURE itcsy.


  DATA:totpgno TYPE i.
  DATA:txt     TYPE string.

  txt = 'Contd to page:'.

  READ TABLE intable INDEX 1.
  pgno = intable-value.

  READ TABLE intable INDEX 2.
  totpgno = intable-value.

  IF totpgno <> 1 AND pgno <> totpgno.
    pgno = pgno + 1.
    CONCATENATE txt pgno INTO outtable-value.
    CONDENSE outtable-value.
    SHIFT outtable-value LEFT DELETING LEADING space.
  ENDIF.

ENDFORM.                    "get_pag

But here when form is debugged the value of SAPSCRIPT-FORMPAGES(3ZC) is the current page no only.

so its getting failed.

Any ideas ... do help

Keshav

1 ACCEPTED SOLUTION
Read only

former_member585060
Active Contributor
0 Likes
513

Hi,

Declare the pgno aslo in Subroutine, just see the output, if you see in debugger, it will show the current page - 1 value, but in print preview it show currect values.

or

You can do it without Subroutine

Create a Footer window and this code, Main window does not show &NEXTPAGE& value

/: IF &NEXTPAGE& NE 0
P1 Continued in Page : &NEXTPAGE&
/: ENDIF

Regards

Bala Krishna

Edited by: Bala Krishna on Feb 21, 2009 12:05 PM

Hi,

I want to print a custom footer text in every pages like 'CONTD..TO PAGE 2' on page one and contionously till the last second page.

so have done something like this

DEFINE &PRINT& = ' '.

PERFORM GET_PAG IN PROGRAM YSUBPOOL_PAGEFOOTER

USING &PAGE(3ZC)& &SAPSCRIPT-FORMPAGES(3ZC)&

CHANGING &PRINT&

ENDPERFORM

,,,,,,,,,,,,,,,,,,&PRINT&


FORM get_pag TABLES intable STRUCTURE itcsy
                    outtable STRUCTURE itcsy.


  DATA:totpgno TYPE i.
  DATA:txt     TYPE string.

  txt = 'Contd to page:'.

  READ TABLE intable INDEX 1.
  pgno = intable-value.

  READ TABLE intable INDEX 2.
  totpgno = intable-value.

  IF totpgno <> 1 AND pgno <> totpgno.
    pgno = pgno + 1.
    CONCATENATE txt pgno INTO outtable-value.
    CONDENSE outtable-value.
    SHIFT outtable-value LEFT DELETING LEADING space.
  ENDIF.

ENDFORM.                    "get_pag

But here when form is debugged the value of SAPSCRIPT-FORMPAGES(3ZC) is the current page no only.

so its getting failed.

Any ideas ... do help

Keshav

2 REPLIES 2
Read only

former_member585060
Active Contributor
0 Likes
514

Hi,

Declare the pgno aslo in Subroutine, just see the output, if you see in debugger, it will show the current page - 1 value, but in print preview it show currect values.

or

You can do it without Subroutine

Create a Footer window and this code, Main window does not show &NEXTPAGE& value

/: IF &NEXTPAGE& NE 0
P1 Continued in Page : &NEXTPAGE&
/: ENDIF

Regards

Bala Krishna

Edited by: Bala Krishna on Feb 21, 2009 12:05 PM

Read only

0 Likes
513

Cool