Financial Management Blogs by SAP
Get financial management insights from blog posts by SAP experts. Find and share tips on how to increase efficiency, reduce risk, and optimize working capital.
cancel
Showing results for 
Search instead for 
Did you mean: 
pravin_datar
Product and Topic Expert
Product and Topic Expert
10,983

Automate execution of any Data Manager package


 

Business Planning and Consolidation version for Netweaver uses Data Manager module to move data in to BPC as well as copy and move data within and across applications. To this effect it uses the data manager packages to accomplish this. These packages can be configured and executed from within BPC for Excel. The data manager also allows you to schedule these packages to run at a given time. These packages extensively use BW process chains. We can also create custom process chains that in turn will execute the data manager packages and thereby automate execution of data manager packages. (You can read more about creating such custom process chains at Running BPC process chains within non-BPC process chains). In this blog we will talk about some tricks that we can use to easily automate execution of any data manager package. We can use this technique for debugging a data manager package also. If the data manager log that we get after executing the data manager package does not help us to trouble shoot an issue, we can debug that package using ABAP debugger by following exactly the same steps.

 

The answer prompts in the data manager package:

One of the important steps in execution of a data manager package is to create the answer prompt file regarding the prompts that you get while running the package. For example, if we execute a package that loads transaction data from an infoprovider to our application, we get the following prompts while running the package:



Here we can see that the prompts that the user has to fill while running this package are: name of the Infoprovider, the transformation file to be used with this Infoprovider, method of importing the data and the option to run default logic. Similarly, on the next screen, we get the prompt to select whether the work status needs to be checked. Only after the user enters these prompts successfully, the execution of the data manager package begins. Hence any attempt to automate the execution of this package will involve providing answers to these prompts in some way.

 

Creating the answer prompt file:

One way out is to create this answer prompt file manually. The answer prompt file must be a tab delimited file and each prompt should start on a new line. If we follow this rule, then the answer prompt may look like the following:



Now is this the format for all answer prompt files for all data manager packages? Can we get any clue about the format of each package anywhere in the system? When we execute the data manager package manually, what happens to the prompts that we entered? At a later date, can we see what prompts we had entered while executing that data manager package? Let us try to answer these questions here. Firstly, though all answer prompts need to be tab delimited, the detailed format is not the same for all packages. So how do we know what the format is for each package? The answer is - refer to the data manager package log. Let us see how this can be done.

 

Creating answer prompts from the data manager package log:

When a user executes a data manager package manually by answering the prompts presented to him/her during the execution, those answers are stored in the data manager log file in the file service. In BPC version for Netweaver, we can access the file service using the SAP GUI and going to the transaction ujfs. The file service for our appset is as shown below..



The data manager log files that have the answer prompts are stored in the ‘privatepublications' folder within the node for the application.



Within the privatepublications folder, access the domain and within the domain the user folder who has executed the data manager package. For that user, the answer prompt files are stored in the folder called tempfiles.



In order to view this log, we need to download it. The log may look something like the following:



We can notice that the answer prompt that we created manually in the earlier step is included here in the top portion of the log. In order to create the answer prompt file from this log, we need to copy the pertinent portion and clean up the remaining. This way we can create the answer prompt from one of the successful manual executions of the data manager package.

 

Using the answer prompt:

Now we are in a good position to automate the execution of this data manager package using the program ujd_test_package. Enter the information regarding appset, user, package etc as shown below. At the answer prompt field, drop down to select the answer prompt file that was created in the above section.



We can save this variant so that we can use it as the program variant for automatic execution



This can now be used in the custom process chain to automatically execute the data manager package.

 

Automate any data manager package:

This technique of creating the answer prompt file from the data manager package log can be used to automate any data manager package. For some data manager packages, the answer prompts are not intuitive. For example, for a copy package, the front-end screen for the prompts looks like the following:



On the next screen, the prompt includes the ‘from' and ‘to' dimension members to be copied.



If we execute this package, the data manager package log would look like the following:



We can notice here that without looking at the data manager package log, it would be difficult to manually construct the prompt file for automating this package since the format of the prompt file in this case is not very intuitive. However the trick of using the data manager package log makes our work very easy - just copy the log and clean it up a bit  - and we get our answer prompt file. This way we can automate any data manager package - even those that are not delivered. There is only one caveat here - the program ujd_test_package may be changed later since the primary purpose of that program is to enable debugging of the data manager package than help automate it. However we can always copy that program to our own program and use it to automate execution of any data manager package.

17 Comments