cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate the page totals

Former Member
0 Kudos

Hi To All,

In scripts i need to calculate the page totals.that means for a customer i have lot of invoices for example my line items has been displayed in three pages, then in 1st and 2nd page i need to calculate the page total.and then for 3rd page i need to calculate the total.(but i don't that for a customer how many invoices are there).very urgent........

U can check the standard form : f140_acc_stat_01

correspondence type is:sap06

For the above form i made modifications as well here i need to get the valuse for due now, due later and past due.can any one provide me the logic or field mappings.

<REMOVED BY MODERATOR>

Thanx and regards,

loki

Edited by: Alvaro Tejada Galindo on Feb 19, 2008 11:37 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

&PAGE(Z)& displays the pagenumber you are on

&SAPSCRIPT-FORMPAGES(C)& displays the total number of pages

no need to calculate anything sap-script does that for you

just use:

AQ Page &PAGE(Z)& of &SAPSCRIPT-FORMPAGES(C)&

while AQ is just the paragraph format

Edited by: Florian Kemmer on Feb 19, 2008 4:36 PM

Former Member
0 Kudos

hi,

iam not asking about the pages and no of pages.i need to calculate the line items total which has been displayed in the pages.if it's 1st then i need to calculate the sum of line item total for that perticular page as a page total.

Thanx and regards,

loki

Former Member
0 Kudos

hmmm ok, i dont aks why you need that

ok in your SAP-SCRIPT form there is a text element called "ITEM_LINE".

this is beeing called once for every ITEM you print.

in this text element make a external perform.

like:


/E ITEM_LINE
/:  DEFINE &ITEM_COUNT& = ' '
/:  perform calculate_item_count in program YOUR_PROGRAM
/:  changing &ITEM_COUNT&
/:  endperform

your external perform shoulöd then look like:


form calculate_item_count tables in_tab  STRUCTURE itcsy
                                                 out_tab STRUCTURE itcsy.

  statics:  lv_count       type i.

  lv_count = lv_count +1.

  read table out_tab
  with key name = 'ITEM_COUNT'.
  if sy-subrc = 0.
    out_tab-value = lv_count.
    modify out_tab index sy-tabix.
  endif.

endform.

well the variable ITEM_COUNT you defined in your form is now accesible throughout the whole form, and can be printed, like other variables.

i hope i got you right this time

Edited by: Florian Kemmer on Feb 19, 2008 4:59 PM