cancel
Showing results for 
Search instead for 
Did you mean: 

&SAPSCRIPT-FORMPAGES& not giving correct number

Former Member
0 Kudos

Hi,

Iam unable to print total number of pages correctly.

Please kindly help me.

I am getting total pages 4 but need to display 3(exclude terms&conditions page) at page 1 of 3 like that.

I tried to decrement page counter by 1 in the below perform, it's working fine but the issue is ....

First time when perform is called system is passing 2 at &SAPSCRIPT-FORMPAGES&, next time getting 3 into &SAPSCRIPT-FORMPAGES&.

PERFORM CHECK_PAGE IN PROGRAM ZZ_RFQ USING &SAPSCRIPT-FORMPAGES&

CHANGING &WS_PAGE&

ENDPERFORM

Page &PAGE(C)& of &WS_PAGE&

Thanks,

Geetha.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

I suuppose the variable SAPSCRIPT-FORMPAGES is calculated at runtime, so the real value can be got at the last page only

Try to set START as MODE in the page with Terms and Condition, in this way the counter should be reset

Max

Former Member
0 Kudos

Thanks for the reply Max. Let me explain more on the issue.

I created a custom field on RFQ for terms & conditions. On th form I have to print terms & conditions on the back of first page when the custom field is checked.

When I check the custom field on RFQ everything is working fine including page numbers.

When the cusotm field is not checked system is caliculating terms and confitions also as a page (In spool I see blank page) but not printing as it is back of the first page. Client is ok with it. but the prob is with page numbers getting 1 of 4, 2 o 4, 3 of 4.

So I tried to call this perform when the field is not checked to reduce the page number. as you said SAPSCRIPT-FORMPAGES is calculated at runtime not able to get right values.

Any alternative to get right value?

Thanks,

Geetha.

Former Member
0 Kudos
When the cusotm field is not checked system is caliculating terms and confitions also as a page (In spool I see blank page) but not printing as it is back of the first page. Client is ok with it. but the prob is with page numbers getting 1 of 4, 2 o 4, 3 of 4.

It's not printed because the page is blank, but you're really printing it: infact you can see the page in the spool.

So I suppose you have to avoid to print that page when it doesn't need it

Max

Former Member
0 Kudos

Yes Max if we can stop printing blank page it's great thing.

I tried many ways to stop the blank page. setting no blank lines in paragrpah, removed space and empty lines. aslo tried with write_form using text elements. no luck with it.

Alternatively I thought if I can control page numbers there will be no issue as the blank page will not print.

Thanks,

Geetha.

Former Member
0 Kudos

It depends on how it's the flow of your pages in the sapscript

Max

Former Member
0 Kudos

Could you please elaborate more on this Max?

Does anybody has any other suggestions. <removed by moderator> please help.

Thanks,

Geetha.

Edited by: Thomas Zloch on Oct 13, 2011 8:33 PM

Former Member
0 Kudos

The thirst thing I need to know how your sapscript is arranged:

How many pages (FIRST, NEXT,.....) are there?

How do you link them?

Max

Former Member
0 Kudos

Script has 3 pages.

First, BACK and NEXT

FIRST -> BACK -> NEXT

Mode has duplex for the First page.

In first page main window

I wrote conditions like IF EKKO-TERMS&CONDTNS NE 'X' NEW-PAGE BACK ENDIF.

Former Member
0 Kudos

So

that means the next page of the FIRST is always BACK

Try this flow:

FIRST->NEXT

BACK->NEXT

And keep your condition:

IF &EKKO-TERMS& NE 'X' NEW-PAGE BACK ENDIF.

In this way the page BACK should be called only if your condition is valid

Max

Former Member
0 Kudos

Hi Max,

I resolved this issue by creating new form without terms & conds page. Calling new form when condition is not matched and calling old form with T&C page when condition is matched.

Thanks for your qucik replies, they were helpful. I will reward points.

Thanks,

Gettha.