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

scripts

Former Member
0 Likes
1,071

hi

in my script i want to print page no/total no of pages how to print in scripts

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
1,039

hi,

&Page&/&SAPSCRIPT-FORMPAGES&

Hope this helps,.

rgds

Anver

11 REPLIES 11
Read only

Former Member
0 Likes
1,039

In your case where you want to increment the value of the total number of pages always use &SAPSCRIPT-JOBPAGES& and for the individual page &PAGE&.

Since you have to increment the value of the total number of pages, pass the value to a variable increment the variable and then display that variable.

: PERFORM CHECK_PAGE IN PROGRAM Z_SCRIPT

: USING &SAPSCRIPT-JOBPAGES&

: CHANGING &WS_PAGE&

: ENDPERFORM

FORM check_page TABLES p_page STRUCTURE itcsy

p_page1 STRUCTURE itcsy.

READ TABLE p_page INDEX 1.

IF sy-subrc = 0 .

p_page1-value = p_page-value + 1.

MODIFY p_page1 INDEX sy-tabix.

ENDIF.

ENDFORM. "check_page

Now your total number of pages would have been increased by 1 and display this variable in the script. But one point is dont declare the variable WS_PAGE in the driver program. If you declare the value will be reset. It will work believe me it works.

Regards,

Shanmuga

Read only

Former Member
0 Likes
1,039

Use &PAGE& for current page number

&SAPSCRIPT-FORMPAGES& for total no of pages

Regards

Wenceslaus

Read only

0 Likes
1,039

gr888888888888.... job done .kp it up .........thanks

Read only

0 Likes
1,039

Hi,

I have a SAP script in which i need to display the currect page number and copy number of the form. How can this be done ...

eg. Copy 1 of 4 ,copy 2 of 4 like that.

The total no. of copies will come from NAST table , but i don't know where the currect number will come from .. plzz help..

thanks in advance ,

Anil.

Read only

Former Member
0 Likes
1,039

Hi,

you can go to text editor - menu-insert-symbol-system symbol

select these two symbols and write like this

<b>&page& /&formpages&</b>

Regards,

pankaj singh

      • reward if helpful

Read only

Former Member
0 Likes
1,039

Hi ,

You can use the follwing command

&PAGE& / &SAPSCRIPT-FORMPAGES&

Regards

Arun

Read only

Former Member
0 Likes
1,039

Hello,

To print the Pageno:

Command:&PAGE&

TO print total no of pages:

Command:&SAPSCRIPT-FORMPAGES&

So in script u can write like this

&PAGE& /&SAPSCRIPT-FORMPAGES&

Check and let me know if u face any problem.

Regards

Read only

Former Member
0 Likes
1,039

hi srini,

check the below link

may be useful for you

mark the helpful answers

Regards,

GNK

Read only

anversha_s
Active Contributor
0 Likes
1,040

hi,

&Page&/&SAPSCRIPT-FORMPAGES&

Hope this helps,.

rgds

Anver

Read only

Former Member
0 Likes
1,039

hi,

to find the total number of pages check the value of variable NAST-ANZAL.

Read only

Former Member
0 Likes
1,039
L PAGE:&PAGE& / &SAPSCRIPT-FORMPAGES(C)&

here L is ur paragraph format .

maintain this in ur page window .

regards,

vijay