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

issue

Former Member
0 Likes
1,270

hi folks,

To display the page numbers in the form like

Page: 1 of 5 in this format, I used &sfsy-page(4Z)& OF &sfsy-formpages(4Z)&

It is displaying correct values for pages less than 10 like 'Page : 1 of 9' but when it reaches two digit numbers

it says Page: 1 of * Where is the error coming here?

There is enough space in the text window in the form too.

Why is it happening?

Thanks in advance.

Vinu

13 REPLIES 13
Read only

Former Member
0 Likes
1,246

Sorry I used

I used &sfsy-page(Z)& OF &sfsy-formpages(Z)& what is the difference out here?

should I be using '4Z' value there and only then it works?

Vinu

Read only

0 Likes
1,246

I think the "4" tells it to display 4 characters of the field. Does it work when you use "(4Z)"? Does it work when you take the "4" away?

Regards,

Rich Heilman

Read only

0 Likes
1,246

I don't remember having seen before that someone had to specify the lenght of the field in order to have the page functionality work correct. But maybe you have to.

Regards,

Rich HEilman

Read only

0 Likes
1,246

Do you mean to say that I do not need to use '4Z'? without using that I had an issue and then it was working but now it is not. I want to understand the logic behind that as to why it occurs like that ?

Vinu

Read only

0 Likes
1,246

Hi,

The smartforms are designed to give the total pages only if the total number of pages is a single character eg:7. But if it exceeds 1 character,eg. 13, it just displays *. For this you need to declare explicitly the number of characters for total number of pages.

eg: &SFSY-FORMPAGES(3ZC)& or &SAPSCRIPT-FORMPAGES(3ZC)&

So in your program you need to declare the way given above.

Hope this helps you.

Vamsi

Read only

0 Likes
1,246

what difference it makes if we declare it as

&SFSY-FORMPAGES(4Z)& or &Sfsy-FORMPAGES(4Z)&

Can anyone explain If this is not right, should we declare it as

&SFSY-FORMPAGES(3ZC)& or &Sfsy-FORMPAGES(3ZC)&

what '3ZC' means?

Thanks

Vinu

Read only

0 Likes
1,246

4Z --> 2 digit output

3ZC --> 3 digit output

Good luck,

Suresh Datti

Read only

0 Likes
1,246

when I give '3ZC' it is not displaying the number of pages

it shows

Page 1 of blank why is it taking that way?

Read only

Former Member
0 Likes
1,246

This is a bug in SMARTFORM.

Define a Global Variable FPAGE TYPE CHAR4.

In the window where you print the page info , make it a "FINAL WINDOW".

Add an ABAP code before your TEXT node

( FPAGE SHOULD BE IN OUTBOUND PARAMMETERS ON ABAP NODE)

WRITE SFSY-FORMPAGES TO FPAGE LEFT-JUSTIFIED .

In the text you may use

&sfsy-page(4Z)& OF &FPAGE4Z)&

You amy also CHECK OSS 588352.

Cheers.

Read only

Former Member
0 Likes
1,246

what difference it makes if we declare it as

&SFSY-FORMPAGES(4Z)& or &Sfsy-FORMPAGES(4Z)&

No Difference

Can anyone explain If this is not right, should we declare it as

&SFSY-FORMPAGES(3ZC)& or &Sfsy-FORMPAGES(3ZC)&

It is right way to declare but will not work if you are on WAS610 or above . Read the OSS I mentioned in the thread earlier.

what '3ZC' means?

3 - No Of Places reserved for Printing the Variable

Z - Omit the leading zeros for numeric field

( SYSY-FORMPAGES in INT4 field . Check in SE11

fro SFSY )

C - Omit the leading spaces for character fields i.e. a

left justified output.

If you dont get the total page number follow the procedure mentioned earlier and also read the OSS.

Cheers.

Read only

0 Likes
1,246

Thanks Sanjay for your explanation. It really helped I have not tried that yet, I shall go ahead and use that piece of code, and will award the points to you.

Vinu.

Read only

0 Likes
1,246

Can you please award points for answers which have helped you. Thanks.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,246

I was able to use this thread in solving the same issue. Setting the window type to "FINAL" got it working properly. Thanks!