cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms SFSY-FORMPAGES initialize

Former Member
0 Kudos

Hi Gurus

I have following request:

The design of the page looks like this.

Page 1.

Loop at header table which contains vendor number

Loop at vendor information where vendord number = header-vendor number

print vendor information.

if vendor changes, go to new page.

what i did was i created on page 1, I had the mode = 'initialize counter',

and i copied page 1 and created a page 2, and had the mode = 'increase counter'.

the problem i now have is, for example, i have 3 diff vendors the page numbering is '1 of 1', '2 of 1' and '3 of 1'. It means that my sfsy-formpages is always 1.

I want for each unique vendor a dependant numbering

so vendor 1 page 1 /2

vendor 1 page 2 /2

vendor 2 page 1 / 1

vendor 3 page 1 / 3

page 2 / 3

page 3 / 3

Does anyone has a solution for obtaining this?

Edited by: Kristof De Bruecker on Mar 17, 2010 10:44 AM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I closed this tread. No solution was provided to reset the formpages myself somewhere.

What I did as solution, is creating a new button on my ALV grid to print out the form, but this will call the smartform each time there is a new vendor. this run fully in background, so formpages are re-setted automaticly

MarcinPciak
Active Contributor
0 Kudos

I used this snippet in program lines node at entry to determine similar (number of page per EE, for you it will be per vendor)


IF sfsy-jobpages = 1.
  FREE MEMORY ID 'ZCZPY_EE'. "clear at entry
ENDIF.

DATA: pernr TYPE persno.

"get current EE form pages
IMPORT e_pernr = pernr
       e_page_no = g_form_page
       FROM MEMORY ID 'ZCZPY_EE'.

IF pernr = wa_assign-key-peras
  OR pernr IS INITIAL.  "same EE
  ADD 1 TO g_form_page.  "increate number of pages per EE
ELSE.
  g_form_page = 1.  "initialize counter as EE has changed
ENDIF.

EXPORT e_pernr = wa_assign-key-peras
       e_page_no = g_form_page
       TO MEMORY ID 'ZCZPY_EE'.

G_FORM_PAGE is defined as global data object and will hold number of page per EE

i.e.

EE1 - 1, 2, 3

EE2 - 1,2

EE3 - 1,2,3

...

Regards

Marcin

Former Member
0 Kudos

Hi Marcin Pciak

Where do I have to put this program lines??

But your logic program lines will change the page counter?

that works ok at my form... when I call my first page, I have set the initialize counter in the general attributes

my second page has the attribute increase counter...

It's the total of pages that is not correct.

Or it stays at 1 for multiple vendors (formpages) ore when I use the jobpages, I get the total of the pages used, for all different vendors.

Edited by: Kristof De Bruecker on Mar 17, 2010 11:14 AM

MarcinPciak
Active Contributor
0 Kudos

Just create program lines NODE as the first node in the page 1. You don't need to copy page1 to page2. Only use 1 page if has to have same layout. Don't use another page to increase any counter.

Then paste the code in this new NODE, so whenever you enter page1 (also page-break will enter the same page), this code will be executed as the first thing. So you will have corect number of page per vendor at page entry.

Hope it is clear enough.

Marcin

Former Member
0 Kudos

Marcin Pciak

I think your code is just for changing the page number counter, not for having a total lines for each unique vendor...

Kristof

Former Member
0 Kudos

Hi

Try using SFSY-JOBPAGES in place of SFSY-FORMPAGES.

Vishwa.

Former Member
0 Kudos

SFSY-JOBPAGES is the grand total, so this will give me 51 for all vendors

Former Member
0 Kudos

Hi

Create a seperate window,and select the type as "Final Window", and print the page numbers in this window.

Place the window at the position where you want to print the page numbers using Form Painter.

Vishwa.

Former Member
0 Kudos

Hi thanks for your quick answer, but the result is the same.

I have for vendor one, 50 pages

which are shown like this

1/1

2/1

etc

for the second I have one page and shown like this

1/1

so value 1 never changes

Former Member
0 Kudos

Hi

in the attributes of PAGE 1,did you give the next page as PAGE 1 or PAGE 2?? Please give PAGE 2, and try again.

Vishwa.

Former Member
0 Kudos

in the general attributes of page1, it's indicated that the next page is PAGE 2

Former Member
0 Kudos

When my print out contains one vendor, it's printed correctly

1 / 2

2 / 2

when there are more then one vendor involved, i get

1 / 1

2 / 1

1 / 1 (for the new vendor)

I changed the settings of the window to final -> same result