cancel
Showing results for 
Search instead for 
Did you mean: 

Sub total carry forward in main window

Former Member
0 Kudos

Hi All,

In my SAPScript's main window many line items are coming. The output may appear on more than 1 page. I want to print the subtotal on each page(of the line items that are coming on that page), and I want to carry forward the previous page subtotal on the next page at top. This will happen on all pages...and in the end the grand total should appear.

I tried using SUMMING option...but don't have clarity on this. Plz help me out with a solution soon.

Thanks & Regards,

Niyati

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Niyati

If your lines items are comming on next page then summing the data and put it in a Footer of Table.The sub total will be displayed in a footer. T In the next page automatically total will be printed.

Reward points if it help.

Regards

Virendra

Former Member
0 Kudos

Hi Virendra,

The problem is:

I have used the summing command in the following way:

SUMMING &ITAB_TDS-BASAMT& INTO &ZTDS-BASE_AMT&

itab_tds is my internal table..and ZTDS is a transparent table(also defined in the tables stmt of the print program). When I debug, i find that the in ZTDS-BASE_AMT no value comes on executing the SUMMING command. Where am i wrong?

plz reply soon

Regards

Niyati

dev_parbutteea
Active Contributor
0 Kudos

Hi,

try writing a routine for your purpose!

Regards,

Sooness.

Former Member
0 Kudos

Hi Sooness,

Can U help me with a sample code on the same..

Thanks & Regards

Niyati

dev_parbutteea
Active Contributor
0 Kudos

Hi,

In sapscript

/: Perform <b>Routine</b> in program <b>ProgramNAME</b>

/: using &ITAB_TDS-BASAMT&

/: CHANGING &ZTDS-BASE_AMT&

/:ENDPERFORM

In a custom program in se38

FORM <b>Routine</b> TABLES IT_INPUT STRUCTURE ITCSY

IT_OUTPUT STRUCTURE ITCSY.

DATA:

temp1 TYPE <b>of ITAB_TDS-BASAMT</b>,

temp2 TYPE <b>of &ZTDS-BASE_AMT&.</b>

FIELD-SYMBOLS: <fs_out_tab> TYPE itcsy.

READ TABLE IT_INPUT WITH index 1.

IF SY-SUBRC = 0.

MOVE IT_INPUT-VALUE TO temp1 .

ENDIF.

READ TABLE IT_INPUT WITH index 2.

IF SY-SUBRC = 0.

MOVE IT_INPUT-VALUE TO temp2 .

ENDIF.

temp2 = temp1 + temp2.

READ TABLE IT_OUTPUT ASSIGNING <fs_out_tab> INDEX 1.

IF sy-subrc EQ 0.

<fs_out_tab>-value = temp2.

ENDIF.

ENDFORM.

Regards,

Sooness.

dev_parbutteea
Active Contributor
0 Kudos

then display &ZTDS-BASE_AMT& in footer