cancel
Showing results for 
Search instead for 
Did you mean: 

SAPscript: Total number of pages at Runtime -

Former Member
0 Kudos

Hi All,

In my PO form, I have two pages of terms&conditions at the end. I need to print TOTAL on the PO before these T&C pages, but after all PO lines are printed. If I can find the total number of pages at the runtime, I can print TOTAL on a page which is two less than the total number of pages. But SAPCRIPT-FORMPAGES stores only the current page number at runtime, not the total number of pages.

Is there any way to identify the total number of pages in a form while runtime?

Or is there any way to identify whether the last PO line in a PO has been printed or not during runtime? We are using Z-copy of PO form but print program is standard (SAPLMEDRUCK)

Thanking you in anticipation.

Mark

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi!

Unfortunately there's no way to get the total pages number in SAPScript, and even in Smartforms it is NOT possible.

Maybe you can use the &PAGE& and the &NEXTPAGE& variables in your SAPScript, and using them, you can tell, is there a next page or not...

OR you can define exactly f.e. 5 pages (FIRST, SECOND, THIRD, FOURTH, FIFTH). YOu can set the next page to SECOND in your FIRST and so on... And with this way, you can tell the all pages: there will be always 5 pages.

Regards

Tamá

Former Member
0 Kudos

Hi Tamas,

Thanks for your response.

Depending on the number of line items, my PO pages will vary. Lets say for example, PO have 12 items and span to 3 pages in the form. In addition to these three pages, there will be 2 pages of Terms & conditions also getting printed. So total form pages will come 5.

Now, during runtime at anypage i need to know whether the form is going to end after two pages(last 2 pages are T&C) or not. If at any page i can find that after two pages the form is going to end, I can print the total in the current page.

Is that idea a weired?

Former Member
0 Kudos

Mark,

I dunno if there is a better way,

But here is what we once did.

Since it is a script. W ran the script the first time suppressing the actual print(using a parameter in OPEN_FORM), counted the number of pages

that would print. Stored this number of pages in a variable.

The second time we ran it(enabling print)using the count variable to print the total number of pages on each page.

This is not the best way i know. But it is fool proof.