cancel
Showing results for 
Search instead for 
Did you mean: 

Expand to level for a structure in VBA

andre_maucher
Discoverer
0 Kudos

We use collapsed structures in our query for performance reasons, so we do not show all key figures when the workbook opens. Now we would like to have a functionality written in VBA which should open the structure up to a specified level like it is done when I use "Expand to level" -> "1" in the context menu. (This is of course only a part of the functionality)

I already tried to use SAPSetFilter without any success. Is there any VBA command available that I could use?

Best regards,

Andre

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi, Andre. I submitted this as an idea in March, and it has a whopping 1 vote (mine).

Set "Show Level" via macro : View Idea

TammyPowlas
Active Contributor
0 Kudos

Now you have two votes.

It is good to promote your ideas

Tammy

andre_maucher
Discoverer
0 Kudos

Hi John,

great, I also voted for it - currently 5 votes.

Andre

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Andre,

I agree with Michael... currently there is no standard function for this.

You could maybe create your own workaround by combining these examples:

http://scn.sap.com/thread/3520367

http://scn.sap.com/thread/3497125

My Idea would be:

1) You included the report with all rows expanded

2) via VBA macro (e.g. on different Buttons for Level 1, 2, x) you first identify the hierarchy cell levels

3) you use the "Callback_AfterRedisplay" to expand or collapse the respective levels.

Feel free to share your result ... it might be helpful for others, until there is a standard functionality.

Regards, Martin

Former Member
0 Kudos

Hi Andre,

As far as I know this feature is not available as yet. I think this would be great functionality to add and I would definitely vote for it on the sap idea's site

You could look at using either two quieries or report to report interface as a possible work around.

Regards

Michael