Create Dynamic Prompt Files for BPC Data Manager
The scenario: You want to run a BPC data manager package automatically and you need the answers to the prompts to change dynamically depending on the system date or the value of some property in BPC.
In my case the situation was that my client runs a rolling forecast model which uses a new category each month. In January the forecast version is FCST_01 ..... December is FCST_12. I wanted a data manager package to export the transactional data every day from the main models out to a csv file but only for the current and previous forecasts. The csv files were to be kept for 7 days then overwritten with next weeks output.
To achieve this using an automated process I created a data manager package with two prompts - one to select the forecast versions and one to select the name for the output file and also created a simple ABAP program that created a file with the answers to the prompts and placed the file on the application server.
I then created variants for the program UJD_TEST_PACKAGE which were scheduled to run the data manager package using the prompt file.
Here are the full details of the solution:
Create Data Manager package using /CPMB/EXPORT_TD_TO_FILE
Script for the data manager package - click link to view or download.
Create an ABAP program that will create a different version of the answer prompt file depending on the system date when it is executed
Create a variant for program UJD_TEST_PACKAGE in transaction SE38. Enter Y in the answerprompt is a file box and enter the file name exactly as defined in the abap program into the Answer Prompt box.
Finally create an SM37 job with multiple steps to join it altogether and schedule the job to run everyday
The result is that a file called DATAMANAGER\DATAFILES\BACKUPS\MONDAY.CSV is written every Monday
DATAMANAGER\DATAFILES\BACKUPS\TUESDAY.CSV is written every Tuesday
etc and the forecast versions contained in the files changes each new month.
There are other backup routines running on a monthly and weekly basis that contain the data from other forecast versions in case there is a need to restore other data but since these older forecasts are locked using workstatus, the data should not have changed.