Application Development 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: 

Totals in smartform

Former Member
0 Kudos

Hi,

I have developed a smartform with 3 pages. Page 1 calls Page 2 as next page and page 2 calls itself (page 2) as next page, recursively. Page 3 has terms and conditions.

Now the problem is that I want to have the total of the Purchase Order on the last page (page before terms and conditions). How do I accomplish this?

Thanks and Regards,

Mick

12 REPLIES 12

Former Member
0 Kudos

Hi

I suppose you have a table or loop node to print all item data, so you can insert the event (see the EVENTS tab) for the FOOTER.

This section is triggered at the end of the loop, so you can insert a text element to print the total.

Max

Former Member
0 Kudos

I agree with Max.

In the events tab, you can specify which field to be selected for what operation and also mention the target field. Then use the target field coule be used to print the totals.

However, this feature I think is from 4.7 only. If you are 4.6C you will have to calcualte the totals manually.

Regards,

Ravi

Note :Please mark the helpful answers

0 Kudos

Thanks Ravi and Max.

I have a main window in which I have a table which has a footer. The footer does not have any event tab. Please guide!!!!

Regards,

Mick

0 Kudos

Hi Mick

Do a doubleclick on table node: now you see the tabs on your right, the first one is DATA, the second one is EVENTS.

Choose EVENTS and set the flag of FOOTER checkbox.

Now a FOOTER node is opened into the TABLE NODE (at the end of the table) and so you can insert a text for the total in the FOOTER.

I don't know your release so perhaps you have to create a program node to calculate the total.

Max

0 Kudos

Thanks Max,

But from what I can see the tabs on the table node are Table, Data, Calculations, Ouput Options and Conditions.

In the Conditions tab, I can see some check boxes for additional events like

Only on first page

Not on first page

Only after end of main window

Only before end of main window

Only on Page.

Please guide.

Regards,

Mick

0 Kudos

Hi

Ok you're using 4.7 (or greater rel.) so the EVENT tabs was deleted.

Go to CALCULATIONS TAB:

Insert a row like this:

Operation : SUM TOTAL

Field name: the field with value you want to calculate the total;

Target : the name of variable where total has to be stored;

Time : A After looping

In this way the system automatically calculate the total.

In the footer section insert a text node where the variable of TARGET is printed

Max

0 Kudos

Thanks Max.

But I already have the total in Initialization (Global Definitions-Initialization tab).

What I tried is I put a program node before the text node in the footer. In the program node, I put the following code:

If SFSY-PAGE = SFSY-FORMPAGES.

var = 'X'.

Endif.

And then in the text node condition tab put the condition var = 'X'.

But this doesnt work as in debug mode I observed that (strangely)sfsy-page is always equal to sfsy-formpages.

Help!!!

Regards,

Mick

0 Kudos

Hi

You don't need to do that control because the FOOTER section'll works at the end, so it's the last section system'll do.

In this way all text elements inserted in the FOOTER will be printed in the last page automatically.

Max

0 Kudos

Didnt get you Max. If you could please explain in more detail, on what should I do now?

Thanks and Regards,

Mick

0 Kudos

I think you only insert your text element of total in the FOOTER section and .... print your document.

You should see the total in last page.

It's easy

Max

0 Kudos

Thanks Max.

We are printing Purchase Orders in the smartform.

I have inserted the variable for the totals in the footer of a table in the main window. But before the footer I have a program node, in which i have written logic that if the the GUID of the cuurrent line item is equal to the GUID of the last line item in the internal table, then I am setting a flag. I have put this flag in the condition of the text element of the footer.

Now what is happening is that whenever the last line item of the PO is split over 2 pages, the totals are printed both on the 2nd last page and the last page. Also if I put a page break, I still have the same problem ie if the last line item of the PO is displayed on a new page as due to the page break, the total is displayed both on the 2nd last page and the last page. We want the totals only on the last page.

Thanks,

Mick

0 Kudos

Hi Mick

On the node of your total text , as you know there is a conditions tab . on that tab there is a checkbox for " only after end of main window" if you click that i think your last problem will be solved.

Hope this helps