Transfer employee in BPC Planning with magic button.
This article describes a method for users who do not have permission to manage dimensions, to be able to create or modify specific master data, perform automatic refresh of metdata, run calculations and then refresh a report all with a single click of a button.
My research into this arose from a client's requirement for a simple process to transfer employees to a different cost centre on secondment for a period of time during the planning horizon. Various calculations use properties of the employee master data to assign the cost to the employees cost centre, therefore it became necessary to create a copy of the original employee record that was assigned to the secondment cost centre for a selected period in the planning timeline.
There were several excellent how to papers and SDN/SCN articles that helped me to come to the chosen solution
In case links to the original documents above get broken there are pdf versions here
The first article by Daniel Settanni addresses the first problem, allowing users to create master data directly without waiting for an administrator to do it, but although it suggests that ordinary users will be able to do this directly it is not actually possible unless they are assigned the Manage Dimensions task in their task profile.
If they are assigned that task then they could just modify the master data directly in the web interface which would risk the integrity of the solution.
The initial solution was to implement the BADI from the master data on the fly how to paper, and it works fine if the user executing it has master data editing rights, but executing all the steps and answering text prompts in the data manager packages is a bit clunky and would be prone to error. The client wanted something a lot simpler to use and less prone to error, exactly as Abdullah Baydas describes at the start of his Magic Button article.
The other essential requirement was that any user should be able to execute the employee transfer process without having access to modify master data generally in the web client. The modification should be strictly limited to single members or specific properties with a dimension and controlled programatically. The next paper by Kirill Gromyko gave me the solution how to do this , but in order to make it work with master data I needed to incorporate it into a custom process chain.
In the end I did not use the Master data on the fly BADI because the combination of VBA magic button and the BADI to allow execution as another user, provided exactly the functionality I needed.
The Master data on the fly BADI only allowed a copy of an existing master data record , whereas the vba solution would allow creation of a completely new member or just an update to specific properties.
Step by Step Description of my Employee Transfer Process
Create a BAdI Implementation to switch user
Follow steps 1 to 13 in the document
The abap code is available in text form in the download area here (easier than copy paste from pdf)
Create a user that has access to the task Manage Dimensions I called mine MDUSER. Alternatively you can use an existing user id such as BPC_SERVICE
Create a script logic file to switch the user id
The code in the how to paper is designed to allow the user to be able to write data to members that they don't have access to. This works fine within a runcalcaccount script but does not work if you execute that script followed by an import_master data because as soon as the runcalcaccount finishes, the user switches back again.
The trick to get it to work with a master data import task is to create a custom process chain that incorporates the runcalcaccount process into the chain
Create a copy of the standard IMPORT_MASTER process and add in the RUNCALCACCOUNT step, I called mine Z_IMPORT_MASTER as shown below.
Create a transformation file to map the employee data from a csv file into the employee dimension. I called my file EMPLOYEE_TRANSFERS.xls and referred to it specifically in the data manager package.
Create a Data Manager package to call this custom process chain and a second one to move the transactional data across to the new cost centre
Script for Step 1
Script for Step 2
PROMPT(SELECTINPUT,,,"Select the Forecast and employee to transfer out","CATEGORY,EMPLOYEE",,1)
Create an Excel file with VB coding to control the process
This file will allow the user to select , the employee to be transferred, the destination cost centre and the start and finsh periods of the transfer. The vb code will create a csv file containing modified employee records, upload the file to BPC, run both DM pacakages, refresh metadata and then refresh the report.