Data integrity is essential in the budget or forecasting process. By enforcing data integrity, you can ensure that reliable reporting is available when used for business decision making. Using a typical forecast scenario as an example, follow the steps to implement a master data driven validation rule in SAP BusinessObjects Planning and Consolidation, version for SAP NetWeaver, as a way to enforce data integrity.
Key Concept
When business users enter their budget or forecast data, checks are often needed to ensure the integrity of the data prior to write-back. Using the standard validation function, administrators can define specific rules that validate the integrity of data before it is saved back to the database, rejecting any data that does not meet the specified requirements. You can also implement a generic rule that is controlled via master data, delivering a flexible solution and reducing the administrative burden that a standard solution provides.
Using a Business Add-In (BAdI), you can configure a planning application to execute a master data driven validation rule that ensures data integrity. This method can simplify a work status configuration that is often used to perform the same task, but requires the administrator to manually apply these to each budget or forecast that is created. I explain how to implement a master data driven validation rule using a BAdI.
Note
This article is for SAP BusinessObjects Planning and Consolidation functional and technical team members who want to implement flexible validation rules in versions 7.0, 7.5, and 10.0 of SAP BusinessObjects Planning and Consolidation, version for SAP NetWeaver.
To implement an example of this solution you need to complete four tasks:
- Create an example planning application using the predelivered AppSet APSHELL, which you then apply the validation rules.
- Set up a validation rule for a BAdI implementation.
- Configure the master data properties that are used to define the validation rule.
- Implement the validation BAdI to enforce the validation rule when data is saved back to the database.
Finally, you can also see the validation rule in action.
To enter data or change data in a budget or forecast in SAP BusinessObjects Planning and Consolidation, you use an input schedule. The input schedule is an Excel spreadsheet that you configure for entering and reporting data.
When users create new forecast versions, they most likely use several data sources to build the data. For example, to create a February forecast, data is sourced from Actuals for the month of January and the months of February to December from January’s Forecast (Figure 1).

Figure 1
Input schedule with February forecast built with January Actuals and January forecast data
When entering new forecast values in an input schedule, you should not be able to change the data from the Actuals period because these values are sourced from your underlying transactional system. Because a standard input schedule offers no functionality to prevent this, you can protect the integrity of the data by creating a BAdI that provides the necessary validation rule.
Note
Because Actuals are used to build the new forecast data, you can introduce account codes that were not used in the previous forecast. For example, if you need to plan for employee compensation, you might use the Salaries account code. In actual financial postings, you may have data against account codes (e.g., bonuses); however, it may not be valid to provide a forecast on this account.
Create a New AppSet
Using the SAP BusinessObjects Planning and Consolidation pre-delivered AppSet (APSHELL), you need to create a new AppSet.
1. To create the new AppSet, log in to the APSHELL AppSet in SAP BusinessObjects Planning and Consolidation, version for SAP NetWeaver and select Add a new application set, as shown in Figure 2.

Figure 2
Log into the APSHELL AppSet
2. Enter the details for the new AppSet (e.g., VALIDATION_BADI as the name of the new application, Validation BADI Example as the description, and APSHELL as the application set to be duplicated). Next, select the records to be copied, and then click Add a New Application Set, as shown in Figure 3.

Figure 3
Create the new AppSet VALIDATION_BADI
Once the new AppSet VALIDATION_BADI is created, you have the necessary configuration to implement the example solution under discussion.
Set Up the Validation Rule
Next, set up the validation rule that will be implemented by a BAdI.
1. Log into SAP NetWeaver BW and use transaction UJ_VALIDATION.
2. Select your AppSet ID, in this case, VALIDATION_BADI (see Figure 4).

Figure 4
Select an AppSet Id, VALIDATION_BADI
3. Assign a driver dimension to the application. Click the Assign Driver Dimension button in the top left of the screen and then specify the Category dimension, which is used to represent a forecast version (Figure 5).

Figure 5
Assign a driver dimension to the PLANNING application
Only one driver dimension can be applied to an application. Therefore, you are limited to defining validation rules on only one dimension (i.e., Account or Category) using a standard logic table. Using a BAdI enables rules for any dimension or combination of dimensions to be implemented.
4. Click the Edit Rules button to display the Validations Maintenance–Create/Edit Rule screen. Click the Create Rule button, enter a rule description (e.g., Master Data Validation Rule), and define the assigned members (e.g., 0 to ZZZ). Finally, select the Use BAdI Implementation radio button (Figure 6), which activates the use of a BAdI validation rule for the AppSet and application. Don’t forget to click the Save Rule button.

Figure 6
Create the validation rule, specifying the members and validation logic
5. Finally, return to the Validations Maintenance – Initial Screen, and click the Turn Validations On/Off button (Figure 4). As shown in Figure 7, there are three options that determine when the validation rule can be executed:
- Journals, which enables validation to be executed when entering data via Journals
- Manual Planning, which enables validation to be executed when entering data via an input schedule
- Data Manager, which enables validation to be executed when creating data via a Data Manager package

Figure 7
Available validation switches
With the Manual Planning option on, the data you enter using an input schedule is checked against the validation rule you just created. Click the Save Validation Settings button. Once the validation rule is defined, you can maintain the master data properties that are used in the validation check.
Configure Master Data Properties for Validation
Because this is a master data driven validation rule, the properties of a dimension’s master data must be configured so that the BAdI can validate the data when it is saved back to the database. In the example used in this article there are two rules that you need to specify, which affect the Account and Category dimensions of the master data:
- Account code. Only account codes with the IS_INPUT property set to Y are valid. By setting the IS_INPUT property of the Account dimension to N, the validation BAdI can reject any data to be saved back to the database for these account codes. As shown in Figure 8, account code CE0004010 is set to N, but account codes CE0004020 and CE0004030 are set to Y.

Figure 8
Maintain the Account (P_ACCT) dimension
- Monthly lock. This is a slightly more complex rule because validity of a month depends on the Category dimension. As you create new forecast versions throughout the year (represented by the Category dimension), there are fewer months for which to enter forecast data, as shown in Table 1.

Table 1
Forecast progression though a year
You need to define the month in which data will be accepted in the STARTMTH property. The validation BAdI can then determine the valid month based on the Category dimension and reject data that is prior to this property value. A month is valid when it is greater than the STARTMTH on the Category dimension (Figure 9).

Figure 9
Category property settings
By maintaining the property values of the dimensions, you can quickly enable and disable the valid values in which data can be saved. You have set up the validation rule and configured the master data using standard functions within SAP BusinessObjects Planning and Consolidation. Now all that is left is to create the BAdI implementation to activate the validation rule.
Implementing the BAdI
When you save data that you have entered in the input schedule, the BAdI implementation is executed to enforce the validation rule. You must create the BAdI implementation to combine all the configuration elements together; otherwise the system will accept and save all data that is entered through an input schedule.
1. To create a BAdI implementation, use transaction SE19 and enter UJ_VALIDATION_RULE_LOGIC in the Enhancement Spot.
2. Click the Create Impl. button, and in the pop-up window, enter a name for the enhancement implementation (e.g., ZVALIDATION_BADI_EXAMPLE) and a brief description (e.g., Validation BADI Example), as shown in Figure 10.

Figure 10
Create the BAdI implementation based on enhancement spot UJ_VALIDATION_RULE_LOGIC
3. Click the green check mark to accept the information you entered.
4. Next, enter the following information as shown in Figure 11:
- BAdI Implementation field provides the name of the BAdI
- Implementation Class field identifies the ABAP class that will be executed
- BAdI Definition field identifies the BAdI definition
- Short Text field, which is optional, describes the purpose of the implementation
Click the green check mark when done.

Figure 11
Defining the implementation class
5. Define the filter restrictions that execute the BAdI. Double-click the Filter Val. Icon (Figure 12) on the Enh. Implementation Elements tab. Click the Combination button in the Filter Values pane, and select APPSET_ID as the filter value for the VALIDATION_BADI.

Figure 12
Setting filters for the BAdI implementation
6. To activate the enhancement implementation, click the Activate button
or press Ctrl-F. The validation rule is ready for use.
Once you set up the BAdI implementation, your data is protected by this validation rule.
Validation Rule in Action
To demonstrate the validation rule, open the SAP Business Planning and Consolidation Office Client for Excel, log in to the VALIDATION_BADI and PLANNING application, and open the BADI Validation Test.xls file, which is available in the Downloads section at the end of this article.
An input schedule similar to one shown in Figure 13 appears. Note that the cells with the gray background prevent data from writing to the database, although it is still possible to enter data in the standard Excel input schedule.

Figure 13
Input schedule showing gray cells where data should not be planned
When you enter data, the cell color changes to dark red. As shown in Figure 14, the cells show both valid and invalid data (i.e., data entered into white cells and gray cells, respectively).

Figure 14
Input values in all cells, both valid and invalid
When you execute the send data function in the Office client, in this case Excel, for the input schedule, the validation rule automatically executes the BAdI implementation. This evaluates each piece of data and determines if it is valid. The results of the validation are then passed back to the input schedule. The message shown in Figure 15 shows some data that did not pass validation rules (i.e., Rejected Count) and the corresponding errors, period locks (JAN FEB_FORECAST), and account locks (account CE0004010, as shown in Figure 8).

Figure 15
Refreshed schedule results show rejected records
The result of the validation allows only valid data to be saved. Figure 16 shows the result of the entered data. Note the invalid data previously entered into the gray cells has not been saved.

Figure 16
Validated data is saved
By using a validation rule with a BAdI implementation, you can carry out complex rules driven by master data to reduce the overall administration of your planning application. This is comparable to the characteristic derivation check and data slice functionality provided in SAP NetWeaver BW integrated planning. The implementation of the BAdI by using ABAP code also offers a solution to complex data validation rules in which the definitions are held in a transparent table or DataStore object.
Andrew Simmonite
Andrew Simmonite is a senior technical strategy consultant for SAP NetWeaver BW with Capgemini. He has more than nine years of experience with SAP NetWeaver BW and more than 19 years in IT. He has experience in both reporting and planning implementations for multi-national companies in the gas and oil, public-, and retail sectors. He holds a bachelor degree with honors in computer science.
You may contact the author at Andrew.Simmonite@capgemini.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.