This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Details and Usage .............................................................................................................................................. 6
Step by Step Instructions .................................................................................................................................... 7
Create the PARAMETERS Excel Name Range ............................................................................................. 7
Create the PACKAGE Excel Name Range ................................................................................................... 12
Add the Visual Basic code ............................................................................................................................ 15
Create the User Interface to perform the Copy ............................................................................................. 18
How to display the Developer tab in the Excel Ribbon ................................................................................. 21 MS Office Excel 2010 ................................................................................................................................................ 21
Example XML Prompt File ............................................................................................................................ 31
Related Content ................................................................................................................................................ 33
Finally, the user selects whether they want to run the copy immediately, or schedule it to run later.
These options can be confusing to an occasional user of BPC, such as a Cost Centre Manager preparing their annual budget. Many of the options are not relevant to what they are trying to achieve, and would actually cause errors in the way their data is processed if set incorrectly.
One solution is to copy the standard package and amend the Prompt script to default those options where appropriate and only present options that are pertinent to the user, in contextualised language that the user will understand.
This may, however, still leave the user navigating through a number of screens when they simply wish to perform a simple function, such as copying their data from one version to another. A common question from users in such a scenario is whether they can simply have drop-down boxes in two cells in the Excel spreadsheet where they can specify from and to Categories, and a button that executes the copy:
How to Call BPC Data Manager Package from Visual Basic
An Excel sheet where the user can specify from and to versions and click the button to execute the copy.
A Name range called PARAMETERS in the Excel Workbook that specifies all of the parameters that the function in question (in our case, the Copy function) expects, along with the values that will be passed to them.
How to Call BPC Data Manager Package from Visual Basic
A Name range called PACKAGE in the Excel workbook that defines the details of the package we wish to execute.
We also specify here the name of the Prompt File that is generated during the process.
Visual Basic code that, upon being invoked, calls the Data Manager Package specified in the PACKAGE Name range, passing the parameters specified in the PARAMETERS Name range.
Step by Step Instructions
Create the PARAMETERS Excel Name Range
The standard Copy DM Package delivered in the EnvironmentShell BPC model expects the following parameters (as defined in the prompt script file).
TARGETMODE – contains a 0 or a 2 RUNLOGIC – contains a 0 or a 1
CHECKLCK – contains a 0 or a 1
SELECTION – Dimension/ Member pairs defining the source data range.
TOSELECTION – Dimension/ Member pairs defining the target data range.
This information can be gleaned by looking at the DM Package prompt script file, which is accessed as follows:
Navigate to the DataManager
tab on the Excel ribbon
How to Call BPC Data Manager Package from Visual Basic
The final popup, Modify Script, shows the script used to pass parameters back to the DM Package Process Chain. Analyse this information to work out which parameters you need to include in the PARAMETERS Excel Name
Range.
Now we will create the PARAMETERS Name range in Excel.
How to Call BPC Data Manager Package from Visual Basic
Create the cells containing the specification of parameters as per the screenshot. Note:
Prompt names should match those in the DM Prompt definition, with % before and after.
Prompt Type is either Parameter or StringListPairs
Dimension is only relevant for StringListPairs
Value is the value you want to set this parameter to – this can be hard coded (as is the case for the three Parameters), or can use an Excel formula, as is the case for the source and destination categories which look at the selection the user has made in the from and to version drop-downs.
How to Call BPC Data Manager Package from Visual Basic
Enter the BPC Environment and Model IDs into the APPSET_ID and APP_ID fields respectively.
Click on:
In the table returned, identify the row containing the DM Package we are interested in and select it.
Click on:
The resulting screen contains all of the details you will need to populate the PACKAGE name range.
The following table indicates how you should map the values found in the UJD_PACKAGE2 table with the fields you need to populate in the Excel Name Range you will shortly create.
How to Call BPC Data Manager Package from Visual Basic
Field from table UJD_PACKAGES2 Field in Excel Name Range Example
CHAIN_ID Filename /CPMB/COPY
GROUP_ID GroupId Data Management
PACKAGE_ID PackageDesc Copy
PACKAGE_ID PackageId Copy
PACKAGE_TYPE PackageType Process Chain
TEAM_ID TeamID <blank>
USER_GROUP UserGroup* 0010
* Note that the number in the table must be entered with leading zeroes, as a four character field.
Additionally, field PromptFile will contain the name of a file that will be created as part of the process of launching the DM Package. Note that, if you are using this in an Enterprise environment, that you’ll need to decide on a file location that can be guaranteed to exist on all end users’ PCs. In our, example we use: C:\CopyDataManagerPromptFile.txt
Now we will create the Excel PACKAGE Name Range:
Create the cells containing the specification of parameters as per the screenshot.
How to Call BPC Data Manager Package from Visual Basic
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.
Java is a registered trademark of Oracle Corporation.
JavaScript is a registered trademark of Oracle Corporation, used under license for technology invented and implemented by Netscape.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries.
Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.
All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.