cancel
Showing results for 
Search instead for 
Did you mean: 

MEDRUCK, Page numbering on new Terms & Conditions page

Former Member
0 Kudos

Thanks for a wonderful forum. I have used the seach feature extensively while learning SAPScript.

My question deals with the &PAGE& of &SAPSCRIPT-FORMPAGE&

I have a 2 last pagex with the PO number & date, the "page of pages" and the T&C verbiage.

These pages are printed by placing

call function 'START_FORM' " Start a new page

exporting

startpage = 'LAST'. " Direct access to page Last

call function 'WRITE_FORM'

exporting

window = 'TERMS'. " Final page (T&C)

call function 'END_FORM'

call function 'START_FORM' " Start a new page

exporting

startpage = 'LAST2'. " Direct access to page Last2

call function 'WRITE_FORM'

exporting

window = 'TERMS2'. " Final page (T&C)

call function 'END_FORM'. " End of printing page LAST2

before the call function 'CLOSE_FORM' in my print program

The challenge I am facing is that the &Page& &sapscript-formpages& are reset when I call START_FORM.

If I have a PO that is 4 pages (including the T&C), I need the pages to read

1 of 4

2 of 4

3 of 4

4 of 4

When using the above method, I get

1 of 2

2 of 2

1 of 1

1 of 1

By using &SAPSCRIPT-JOBPAGES&, I can get

1 of 4

2 of 4

1 of 4

1 of 4

How do I manipulate the data to get the proper page count for the final 2 pages of teh PO??

Thanks much!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In order to sort out your issue you may follow the following procedure:-

1) Define all terms & conditions via SO10 with say text name= 'ZPO_TERMS_AND_CONDITIONS', test id = 'ST' & language = 'EN'

2) In the same form define a new element say FOOTER in the main window

3) IF you want to start terms & conditions starting from new page, then in element FOOTER first statement should be /: NEW-PAGE

Second line should be

/: INCLUDE ZPO_TERMS_AND_CONDITIONS OBJECT TEXT ID ST LANGUAGE EN

Just before close_form write this element (FOOTER) by using write_form.

Now since your terms & conditions are part of the same form you won't have any problem using &PAGE& / &SAPSCRIPT-JOBPAGES&

I hope this helps

Regards

Raju Chitale

Former Member
0 Kudos

Raju,

Thank you for the suggestion.

When using this method, how do I format my new text 'ZPO_TERMS_AND_CONDITIONS' ??

The title of my T&C needs to be Centered, Helvetica 10 pt

The body of the T&C needs to be Helvetica, 5 pt that has a Block alignment. I don't see how to do this in SO10.

Former Member
0 Kudos

Hi,

Please use transcation Style ( SE72 ) to define the paragraph formats lets say p1 and character formats lets say C1.

Then, come to SO10 EDIT -> Change Style.

Then use the characater formate you defined in SE72. At paragraph P1 and <C1> at beginnign fo your text and close that with <\>.

Answers (1)

Answers (1)

Former Member
0 Kudos

I am also facing the same problem. If any one can help me pls mail to ferryanand@yahoo.com

Former Member
0 Kudos

We found a solution.

In ZMEDRUCK, create a new page (LAST) with windows defined (we had trmpg & terms).

In TRMPG:

/: DEFINE &TERM_PAGE1& := &SAPSCRIPT-JOBPAGES&

/: PERFORM GET_TERMS_PAGE IN PROGRAM

/: ZP2P_FM06PE03_PO_ADDITIONAL

/: USING &TERM_PAGE1&

/: CHANGING &TERM_PAGE1&

/: ENDPERFORM

then display >&TERM_PAGE1 and >&SAPSCRIPT-JOBPAGES&

In SE80 we created the program ZP2P_FM06PE03_PO_ADDITIONAL that contains various subroutines we needed for ZMEDRUCK.

form get_terms_page tables

in_tab structure itcsy

out_tab structure itcsy.

loop at in_tab.

if sy-tabix = 1.

l_last_page = in_tab-value.

endif.

endloop.

l_page1 = l_last_page + 1.

loop at out_tab.

if sy-tabix = 1.

out_tab-value = l_page1.

shift out_tab-value left deleting leading '0'.

modify out_tab index 1 transporting value.

endif.

endloop.

endform.

So, can I award myself points???