This website is not affiliated with, sponsored by, or approved by SAP AG.

smartform - balance carried forward

Development SAPscript/ Smartforms

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

smartform - balance carried forward

Postby magoko101 » Wed Oct 20, 2004 11:04 pm

Hello,

We are running 4.6c and we've noticed that there is a problem within the smartform processing.

We are creating a smartform for Invoice List. What I am trying to do is calculate a total for the current page, with the balance carrying forward onto the next page.

I'm using the events at new page for both the footer and header, with some cummulative code in the main table section which calculates the current line plus the existing total.

This all works out fine only that the number of line items read is +2 more than the number of line items displayed. Hence my balance is showing me the balance calculated for the first 20 items, instead of the first 18.

Is there a best approach to use here?
Does SAP offer a solution to this? I've checked in OSS but it appears not.

Thanks in advance,
Mark
magoko101
 
Posts: 7
Joined: Wed Sep 17, 2003 1:18 am

Postby Guest » Tue Oct 26, 2004 1:36 am

Hello,

I've raised this with OSS and this is there reply, it may be of some interest to others who encounter the problem.

Hope it helps...

"The reason is the way how a table is processed internally and therefore the point of time, when the Smartform processes the page break.

Let's say you get a page break in one of the table lines. Then the complete table line including all cells is still processed on the first page. Only during the start of the next table line (more exactly: when the node is started, where the flag 'New line' is set) the page break happens, the footer is processed, the text of the former table line is moved to the next page
(all none MAIN windows are processed) and the next line is started.

So in this case a solution may look like this: Because the current line and the start of the next line are still processed on the current page, the subtotal calculation must be placed at the end of the text nodes of the table line:
Let's say you want to get a subtotal of the field &amount& (I don't know how the field is called which you want to sum) and let's call the subtotal field &sum&. Then a second global field &oldsum& may be defined and you can write into the subtotal calculation node:

oldsum = sum.
sum = sum + amount.

After that you can print &oldsum& e.g. in the table footer. Now you should get the correct subtotal in the footer. "
Guest
 

Postby RosieBrent » Tue Oct 26, 2004 3:58 am

Thank you for posting that information - as you say it's bound to be useful to another member of the forum.

Cheers :D
Kind Regards

Rosie Brent

Please remember to search the forum and check the FAQ before posting questions, thank you.

Tuly Idiot most of the time, part-time Guru Image
RosieBrent
 
Posts: 6197
Joined: Mon Oct 21, 2002 3:04 am
Location: Darlington

Re: smartform - balance carried forward

Postby induchris » Wed Jan 25, 2012 1:26 am

Hi,

Thank u so much for the reply...

Cheers,
Indu
induchris
 
Posts: 1
Joined: Wed Jan 25, 2012 1:24 am


Return to SAPscript/Smartforms

Who is online

Users browsing this forum: No registered users and 3 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.