cancel
Showing results for 
Search instead for 
Did you mean: 

AdobeForms: subtotal per page w/o script

former_member185943
Participant
0 Kudos
365

Hi, all,

I have an internal table (T_INVOICES) with amounts (NETWR) and I am showing it in AdobeForm. I have a requirement to display incremental subtotal of amounts at the end of each page.

I found this thread which nicely explains how to do it by use of JavaScript. However, my form must be PDF/A compliant an I am not allowed to use scripting.

I came to an idea to insert a field INCREMENTAL_SUBTOTAL in the table and fill it with values where each value is a total of all previous NETWR values. On ABAP side it is clear - works fine. However, I am facing a problem on how to utilize it in form layout.

I created a table T_INVOICES which I converted to subforms. I created a TRAILER subform inside it (before DATA) and assigned it to a Overflow Trailer attribute of T_INVOICES subform node. Then I tried the following scenarios:

  1. TRAILER with a static Text just for test - works perfectly (prints at the end of page), except that I miss subtotal value.
  2. I added a Text Field bound to $.DATA[*].INCREMENTAL_SUBTOTAL. The result was bad: all the subtotal values were printed before all DATA lines, like there were two separate tables one after another.
  3. I moved the TRAILER inside DATA (still being Overflow Trailer of T_INVOICES). As expected, now there is one TRAILER for each DATA line, instead only at the end of each page. If I remove Repeat Subform for Each Data Item, it has no effect - still the same problem.
  4. Relative binding for the field as $.DATA[-1].INCREMENTAL_SUBTOTAL - empty field

I ran out of ideas. Please share yours!

Thanks in advance!

KR,

Igor Barbarić

View Entire Topic
Florian
SAP Champion
SAP Champion
0 Kudos

Another solution is, that you sum it up in your table for each line. It's the same as in the first suggestion.

And assign the field dynamic in your form. But that lead to, that you need to script something inside. So are you allowed to script basic stuff inside?

If not the only way I see is, that you count the lines before, what end in a bigger effort, because you need to featch all the data before and the form itself + Interface do nothing or even do the job a second time.