cancel
Showing results for 
Search instead for 
Did you mean: 

SapScript - Problem with page numbering

Former Member
0 Kudos

Dear experts,

I'm having a problem printing the number of the actual page in my form.

I try

PR &PAGE& of &SAPSCRIPT-FORMPAGE&

then I try

/: &PAGE& of &SAPSCRIPT-FORMPAGE&

I always get

1 of 5

1 of 5

...

I think this just begin to happend after I add a new page to the form.

Any idea why is this happening?

Thanks in advance for any help.

Best regards,

sb.

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

How are you doing the page break? By using START_FORM or CONTROL_FORM or any thing else?

Former Member
0 Kudos

Shiba,

I'm not using any page break.

What is suppose to be?

Former Member
0 Kudos

I was also facing the same problem once. But there I was using START_FORM for page break. In my loop I was checking for 6 line items in a single page. So in loop itself after 6 lines I was calling the START_FORM for breaking the page. At that time my &PAGE& is always contained 1 as the value.

Then I changed the coding in this order..

OPEN_FORM.

START_FORM.

loop at itab.

after each six lines.

CONTROL_FORM with COMMAND = 'NEW-PAGE'.

endloop.

END_FORM.

CLOSE_FORM.

Then it got the correct value in &PAGE& symbol.

Just try to do this flow in your print program it may work.

Former Member
0 Kudos

Hi,

Check for the window type in which you are printing the page number.

It should be VAR.

Moreover, also try with making the page counter mode for the FISRT page also to INC.

Regards,

Ram

Former Member
0 Kudos

Ram,

the window type is VAR and with the page counter mode in the FIRST page to INC, the problem is the same.

However, we decide not to use the total number of pages, but only the page number.

So, thanks for you help!

sb.

Former Member
0 Kudos

Hi Sara,

In the PAGE Set the mode to INC for the first page.

This should solve your issue.

regards

padma

Former Member
0 Kudos

Hi,

Check for the Page Counter mode for each Page wherein for the first page the mode should be START and for the other pages it should be INC.

This increases the current page counter by 1 each time.

Regards,

Ram

Former Member
0 Kudos

Ram,

Now &SAPSCRIPT-FORMPAGES& came 0 in the first page! &PAGE& is correct.

Page counter mode is defined as follows

FIRST Principal NEXT START

NEXT Página nova NEXT INC

Any idea?

Tks,

sb.

former_member585060
Active Contributor
0 Kudos

Hi,

Its &PAGE& of &SAPSCRIPT-FORMPAGES&

U were using &SAPSCRIPT-FORMPAGE&, 'S' missing.

Try it, it worked for me.

Regards,

Krishna

Former Member
0 Kudos

try this if it works...

&NEXTPAGE& = Page no. of next page. Itu2019s value is 0 for last page.

so u put the &NEXTPAGE& in a variable and display that...

var = &NEXTPAGE& - 1...

just try..a hunch i suppose...

Former Member
0 Kudos

Pratik,

the problem with the NEXTPAGE is the same.

Thanks anyway.

sb.

Former Member
0 Kudos

&SAPSCRIPT-FORMPAGES&

U MISSED THE 'S'

As Krishna said........

Edited by: Pratik Mallick on Jul 25, 2008 3:20 PM

Former Member
0 Kudos

Sorry, I'm using &SAPSCRIPT-FORMPAGES&.

The problem is with &PAGE&.

Tks,

sb.

Former Member
0 Kudos

hey sara,

I faced similar problem but i could not get out with an answer

what i would suggest you is please write a sub routine and manually use a variable and increment it.

please make sure that you are writing the perform statement in the footer window or any other window which comes after main window so that you get correct value.

Hope this helps.

<removed_by_moderator>

regards,

RK

Edited by: Julius Bussche on Jul 28, 2008 10:35 AM