Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Why aren't my shared variables showing up in the main report?

I have two subreports each containing a cross tab. I want to take the variables from the subreport crosstab totals and add them to the main report totals.

These are the formulas I'm using for the shared variables:

WhilePrintingRecords;

Shared NumberVar col_total := Sum({@UNITSC});

col_total

and

WhilePrintingRecords;

Shared NumberVar fam_total := Sum({@UNITSF});

fam_total

Both cross tabs are placed in the ReportFooter on their respective reports while the shared variable is placed in ReportFooter B. The shared variables show up in their respective reports but when I run the main reports they are missing from the subreports while the crosstabs are still present.

I've also attempted running a formula in the main report and placing that in a report footer of it's own but it only shows a zero number.

This is the formula I used (I ran it with just col_total just to see if I could get it functioning)

WhilePrintingRecords;

Shared NumberVar col_total;

col_total

What I am doing wrong? Why won't my shared variables show up? Thanks

Tags:
replied

I realized what I was doing wrong. I added the formulas to the original reports. Not to the subreports versions of the reports attached to the main report.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question