cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic text based on page number

Former Member
0 Kudos

Hi Everyone,

I'm trying to place a dynamic text on an hrform. The form is displaying wage types and when there are more than 2 pages, the values on the first page need to be summerized into a variable with the text subtotal in front of it. When we are on the last page, the text total with the total of all the wagetypes needs to be displayed. I tried to use the sfsy-page and sfsy-formpages variables to know on which page i am but the strange thing is that when i use in in program lines and i use debugger to look into the variable i get this:

First page:

sfsy-page = 1

sfsy-formpages = 1

Second page:

sfsy-page = 2

sfsy-formpages = 2

But when i place it into a text element to test i get 1 of 2 on page one and 2 of 2 on page two. How is this possible?

Also i want to display a subtotal of the displayed wagetypes per page. Anyone an idea how i can do that?

Thank you!

Lars

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The reason you get 1-1 ,2-2 in debugging is because, the pages are added dynamically,depending on the length of your main window.Which doesnt get captured initially,but can be used in text element.

As far as totalling on every page and at the last page is concerned ,try teh following link:

link: [http://wiki.sdn.sap.com/wiki/display/ABAP/Togetsubtotalsoneachpagein+smartforms]

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

declare a global varibale to store sum of wage types.

inspite of page number do total of printed wage types and store in that global variable.

create a text object to print the subtotal value in output.

for that text object in condition tab.

create condition as sfsy-page = 2.

if the page number is 2 then only your subtotal value get printed

-Sudheer