Skip to Content
avatar image
Former Member

Problem with 'Transfered' amount between pages

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 07, 2010 at 10:17 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • Apr 07, 2010 at 10:08 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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!