cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with 'Transfered' amount between pages

Former Member
0 Kudos

Hello SDN,

i have a Problem with a customers requirement when printing multi page invoices.

They have the requirement to print a "transferred amount" at the end of a page and at the new beginning of next page.

This amount shall incorporate the Sum of the item netprices.

For example we have a invoice with 5 items. To make it easy item 1 has netprice 1, item 2 has 2 and so on until item 5 has 5.

So actually 2 items fit on one page so we got:

1st page with item 1 and item 2.

expected transfered amount at its end is 3.

second page with item 3 and item 4.

at its top a transferred amount of 3.

And at its end a transferred amount of 10.

third page with item 5.

at its top a transferred amount of 10.

The requirement is very easy to understand but the harder to solve.

Problem is that item print gets done three times until SAPSCRIPT notices that the third item wouldnt fit to page, and so trigger a new page. Due to this the netprice of item 3 is already summed into the transferred amount for page one and i really have a hard time to think of anything to come by this problem.

Any Ideas?

Anyway thanks for your time fellow abapers

Accepted Solutions (1)

Accepted Solutions (1)

former_member205763
Active Contributor
0 Kudos

Actually its really very hard to achieve this kind of requirement as the page break gets determined at runtime only, this kind of requirement is much easier to solve in smatrforms as compared to scripts, so in case u dont get any other solution then u hv to weigh your options of generating a new smartform if its worth that effort.

Former Member
0 Kudos

WOOT i think i could help myself after a lil bit of thinking and testing around.

Like it seems the last procedure of the form ITEM_PRINT isnt fully processed when page changing.

This again means that the form ITEM_PRINT isnt fully prosecced as well. So my Statement where i sum this "Transferred amount" which i actually now put UNDER the form ITEM_PRINT isnt reached when page changes and so i got the expected amount in there. WICKED.

Instead the form ITEM_PRICE_PRINT is fully processed even if this line will make it change pages. So having the statement here wont help it.

So far done about 10 test cases, all positive.

Edited by: Florian Kemmer on Apr 7, 2010 2:17 PM

Answers (1)

Answers (1)

former_member205763
Active Contributor
0 Kudos

wht u can do is limit the number of line items printing in one page manually, say only3 or only 5 then calculate their sum and trigger new page for other line items

Former Member
0 Kudos

Oh, thanks, didnt really think of this. I´ll leave the question open for now since i cant be sure this will fix my problems.

We have item texts, and so on, so an item can have something between 1 and 20 lines, so i dont really think our customer could live with such a solution but still, we have a fallback scenarion if no other ideas will follow.

anyway thanks Kartik, assigned at least some points!