cancel
Showing results for 
Search instead for 
Did you mean: 

Leading zero's while printing total pages in Smartforms

Former Member
0 Kudos

Hi All,

I have a requirement where i need to print leading zero's when printing the total number of pages in a smartform.

I have used Page &sfsy-page& of &sfsy-formpages(Z3.0)&

But for the above we get the output as Page 1 of 2, Page 2 of 2. and so on...

But my requirement is it shoud come as Page 1 of 002, Page 2 of 002.

The total number of pages will always be less than 999. and we need total of 3 numbers displayed.

Ex: Page 1 of 002 or Page 1 of 010 or Page 1 of 100...

Thanks,

Hari Prasad.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

try this.

Take a variable of type n,length 3.

w_tot(3) type n.

Move sfsy-formpages to w_tot.

Then print this variable .

&sfsy-page& of &w_tot&.

Former Member
0 Kudos

Hi Sudha,

We have tried that too and we get the output as Page 1 of 001. Page 2 of 002.

inside the node sfsy-formpages gives the current page number.

Thanks,

Hari Prasad.

Former Member
0 Kudos

HI

Try this out

Page &sfsy-page& of &sfsy-formpages& will give u 1 of 10 2 of 10 etc..

data: lv_page(3) type n , lv_total(3) type n, .

Move: sfsy-formpages to lv_total, sfsy-page to lv_page.

Page &lv_page& of &lv_total&.

Surya