cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to Sum Shared Variable in Group Header in Main Report - Going to be the death of me

0 Kudos

GH2 - Category

GH3 - Contract No
GH4 - Billing Item
GH5 - Project Phase

I have a subreport in the GH5a section pulling in estimated cost at the phase level. I created a shared var and placed it in the report footer. I then placed the shared var in the GH5b section of the main report. I can see the amount. But I can't do anything with it. I need to sum the phases estimate at the Billing Item level(GH4), the Contract No(GH3), and the Category(GH2). I think I need to create another variable that creates a total of the passed shared variable. But I do not know what I am doing.

lenastodal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Nikki,

Thank you for visiting SAP Community to get answers to your questions. I am here to help you to get the most out of it.

First of all, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers (if you haven't done so already), as it provides tips for preparing questions that draw responses from our members.
Please also make sure you're using all appropriate tags and headlines, so the right experts can find your question. Overall, the more details you provide, the more likely it is that members will be able to assist you. Should you wish, you can revise your question by selecting Actions, then Edit (although once someone answers your question, you'll lose the ability to edit the question - but if that happens, you can leave more details in a comment).

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS. By personalizing your profile with a photo of you, you encourage readers to respond.

Best,
Lena (SAP Community Moderator)

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Nikki,

Shared variables are populated only after the subreport runs. Therefore, you can't use the shared variable in a section above the section that holds the subreport - it always has to be below it.

You could move a copy of the subreport to every group header section and link it on the group field. You can then use separate shared variables for each subreport to bring back the group's estimated cost subtotal.

You could also do this with a single subreport that's placed on the report header, however, this method needs some advanced formulae to display subtotals for each group.

-Abhilash