By transferring plan data back to R/3, you can perform tasks such as comparing plan to actual data and budget control.
The ability to extract data from SAP R/3 and legacy systems into BW for analysis and planning via SEM-BPS (Strategic Enterprise Management-Business Planning and Simulation) has been available for several years. Now you can take data out of BW and move it into R/3 using SAP-delivered programs called “retractors.” They allow users to:
- Compare plan data with actual data
- Replace plan data already entered in R/3 with data from SEM-BPS
- Use certain functions that R/3, but not SEM-BPS, supports for further processing (for example, budget control)
As of SEM release 3.0B, three retractors are available:
- Profitability Analysis (CO-PA)1
- Cost Center Planning (CO-OM-CCA)
- Project and Investment Management (PS-IM)
Figure 1 shows the relationship of these retractors to R/3. The information you need to set up these retractors can be difficult to find, as it is scattered among the SAP documentation, OSS Notes, IMG, and other places. My goal with this article is to give you all the relevant background on the retractors, including technical detail such as release dependencies and function, program, and transaction names. I'll also outline the basic steps required to set up your SEM and R/3 systems to push back the planning results to R/3 and trigger execution using these retractors.

Figure 1
How the CO-PA, CO-OM-CCA, and PS/IM retractors interact with R/3
Due to the diverse nature of the R/3 components with which they are associated, each of these retractors works in a slightly different way. Nevertheless, with the following instructions, configuration and execution in your own system should be a snap.
Three Steps for Setting Up the Profitability Analysis Retractor
Retracting data from BW and moving it into CO-PA uses a BW query to read the data from an InfoCube and a special program, RKEBW3RE in R/3, to post the data to an operating concern. (Note that due to a system limitation it is only possible to transfer data for costing-based Profitability Analysis.) Table 1 summarizes key information about the Profitability Analysis retractor.
You need to carry out three steps to enable users to run this retraction:
- Create a BW query
- Define field assignments
- Execute the data transfer
| R/3 release |
As of 4.0B, PI 2001.1 |
| Retraction method |
BW query and R/3 program RKEBW3RE |
| Customizing |
Transaction code KELC in R/3, Define field assignments |
| Execution |
Transaction code KELR in R/3, Execute data transfer |
| Parameters |
- Name of transfer |
Description of BW system, query, and variant |
| - BW data |
Selection of BW system, query, and variant |
| - CO-PA update |
Update actual or plan data. For plan data, specify a transaction type, a plan version, and indicator for weekly data transfer and an indicator for valuation. |
| - Test mode |
Yes = test run without database update ; No = update data (default) |
| Documentation |
See online documentation in IMG (transaction code SPRO):
Profitability Analysis > Tools > Data Transfer Between CO-PA and Other Systems > Data Transfer from SAP BW |
|
| Table 1 |
Summary of the Profitability Analysis retractor |
Step 1. Create a BW Query
First, create a BW query for the InfoCube that contains the target transaction data. This query has to meet a few requirements that will allow R/3 to uniquely identify all records that will be read via the query:
- Put characteristics as well as their attributes in rows, columns, or in the list of free characteristics.
- Use only one structure for key figures and formulas.
- Key figures must not be restricted by more than one characteristic value.
- Set the Release for OLE DB for OLAP indicator.
Step 2. Define Field Assignments
Now you specify the mapping between fields of your query and the fields of a CO-PA operating concern.2 Follow the IMG menu path Profitability Analysis > Tools > Data Transfers Between CO-PA and Other Systems > Data Transfer from SAP BW > Define Field Assignments or enter transaction code KELC. In the next screen (Figure 2), select the RFC (remote function call) destination under BW system. If you haven't done so already, you must also set the operating concern at this time. Then select your BW query (Figure 3) and go to the Details window (Figure 4) to define the field assignments. To assign the fields for company code, for example, you map the CO-PA company code field name (BUKRS) to the BW company code field name (0COMP_CODE).

Figure 2
Select the RFC destination of your BW system

Figure 3
Select BW query

Figure 4
Define the field assignments in the Details window
Tip!
If you need more complex mappings (for example, for master data values) use the SAP R/3 enhancement COPA00RE (or COPA0007). In this enhancement, you can access the data selected by the query and change or delete the CO-PA line items created from the query, or create additional CO-PA line items.
Step 3. Execute the Data Transfer
Finally, run transaction code KELR to start the retraction of data from BW into CO-PA. Select the name of your BW system and the name of your query as defined in the previous step (QB8CLNT003 and 0COPA_C05_0001, respectively, in my example shown in Figure 5). If you used variables, then you also need to specify a variant name. My example uses the variant PLAN_VALUES.

Figure 5
Execute the CO-PA Retractor by running the transaction code KELR
If you want to retract actual values, then all you need to do is select Actual and click on the green checkmark. The system will execute the query, expand the results to the greatest level of detail, and create corresponding CO-PA line items. All actuals are passed through CO-PA's derivation and valuation functionality and are then posted to the CO-PA line-item table using record type H (statistical key figures), which identifies the BW data from R/3 postings.
For plan values, you must first select the Plan option and then define the record type and plan version before you can execute the data transfer. The Perform Valuation option (Figure 5) is optional in this case. The system keeps a detailed log for each data transfer, which you can view with the same transaction (click on the Logs button in transaction code KELR). You also have the ability to cancel running retractions (when you view the log) or reverse the posted values using the Reverse button.
Three Steps for Setting Up the Cost Center Planning Retractor
SAP delivers several integrated planning applications, Cost Center Planning being one of them. The Cost Center Planning application contains, among many layouts and planning functions, the complete configuration for retracting data to CO-OM-CCA. You can use the “plug and play content” out of the box as it is delivered by SAP or as a template to build your own solution. This will save you valuable time since only a few additional settings are required.
Assuming that you have already implemented CO-OM-CCA, you need three steps to set up the Cost Center Planning retractor:
- Configure the field mapping
- Create the planning function
- Enter parameters and execute the planning function
Prerequisites
As a prerequisite to configuring the CO-OM-CCA retractor, you need a planning area and level that contain all characteristics and key figures required to allow a consistent retraction to R/3. For a start, I recommend that you closely stick to the delivered planning area (4EXP0001) and InfoCube (0SEM_C18). That way you can avoid errors because field mappings are not required.
Note
The InfoCube you use must be transactional. Otherwise, you cannot use it for planning in SEM-BPS and you won't be able to run the retractor.
Step 1. Configure the Field Mapping
If you are using the standard SAP InfoObjects around Cost Center Accounting (such as 0COSTCENTER or 0COSTELMNT), you can skip this step. As of SEM release 3.1, you have the choice of using your custom InfoObjects as well. However, you then need to use transaction code UPB_STRUCT to map between your InfoObjects and the SAP InfoObjects. The mapping transaction works the same way as in CO-PA and EC-EIS.
Step 2. Create the Planning Function
Start BPS with transaction code BPS0 and navigate to your planning level. In your planning level, which contains the data you want to transfer back to R/3, create an exit-type planning function and assign both function modules (UPR_COST_PLAN_EXEC and UPR_COST_PLAN_INIT) to it (see the sidebar, “Background on the CO-OM-CCA Retractor”). Then set up the parameters for the planning function, as shown in Figure 6. The quickest way to do that is to copy them from the delivered sample application. Last but not least, move the following characteristics to Fields to be changed: Activity Type, Business Process Number, Cost center, Cost Element, Order Number, Partner Activity, Partner Cost Center, Posting Period, and WBS Element. The system checks this field list, so if you add other characteristics to this list, the retraction will give you an error message.

Figure 6
Customize the CCA retractor by creating an exit-type planning function
Step 3. Enter Parameters and Execute the Planning Function
Now create a parameter group and enter the settings for your retractor run. In Figure 7, I entered Re: Primcost in the Parameter group field. Retractor Control, Delta Update, Destination, and Test mode Is Active are obligatory parameters. All others are optional. Finally, select a planning package and, if it contains variables, set them to the desired values. You can now double-click on parameter group Re: Primcost (4EXPPG14) to execute the push-back function.

Figure 7
Set up a parameter group and execute it to start the CO-OM-CCA retractor
If you have done everything right, the system will lock the selected transaction data, read the data from the InfoCube, and post it to R/3 via a BAPI. Although the BAPI is called several times—for example, once for each of several cost centers—and single calls could fail (due to missing authorizations in R/3, for example), the complete retractor call is handled as a single transaction. So either all data is posted to R/3 or nothing is posted.
Note: The BAPIs used in the CO-OM-CCA retractor start with BAPI_COSTACTPLN_*. They are documented for Business Object CostActivityPlanning in the SAP Interface Repository, which you can access at
https://ifr.sap.com.
Tip! You don't have to execute the retractor via the SAPGUI. It also works using other front ends such as the Web Interface. Alternatively, you can put the function into a global planning sequence and schedule it with program UPC_BUNDLE_EXECUTE to run in the background. Remember that in any case the system needs to be able to lock the data even though it is not changed in SEM. This way, no other user can change the figure while the retractor is running
Background on the CO-OM-CCA Retractor
To understand the basic configuration of the CO-OM-CCA retractor, first activate the Cost Center Planning application.1 It comprises the planning areas 4EXP0001 to 4EXP0005.
You can then study the SAP-delivered examples listed in the table below for the push-back functions.
You will see that the CO-OM-CCA retractor is implemented as an SEM-BPS planning function and consists of two function modules on the SEM side and a few BAPIs on the R/3 side. Several options, which can be stored in parameter groups, allow you to configure the push-back function to your needs. Table 2 shows options for those parameters. If you are not using the SAP-delivered planning area and matching InfoCube, transaction code UPB_STRUCT is available in SEM to map your InfoObjects to the respective fields of R/3.
| SEM release |
As of 3.0B |
| R/3 release |
As of 4.5B |
| Retraction method |
SEM exit-type planning function and R/3 BAPIs |
| Customizing |
- Transaction |
BPS0 in SEM, Create function UPB_STRUCT in SEM, Field mapping |
|
- Function module |
UPR_COST_PLAN_INIT |
| - Transaction |
BPS0 in SEM, Execute function |
| Parameters |
- Destination |
RFC destination for target systems |
|
- Delta mode |
0 = update values absolute
1 = add values to existing values |
| - Test mode |
0 = execute update
1 = add values to existing values
|
| - Retractor control |
1 = activities/prices
2 = activity input
3 = statisticalk key figures
4 = primary costs |
| - R/3 component (optional) |
6 = Cost Center Accounting (default)
7 = Internal Orders
8 = Activity-Based Costing (business process)
9 = Project System (WBS element) |
| - Sender Structure (optional as of 3.1B) |
Name of DDIC structure if field mapping is used (see "Documentation" below) |
| - R/3 version (optional as of 3.1B) |
0 = no
1 = yes |
| Documentation |
See SEM-BPS docuementation: Planning Applications > Cost Center Planning > Data Retratcion
See SAP Note 525543 for additional documentation on field mapping. |
Table 2 Summary of the Cost Center Planning retractor |
Three Steps for Setting Up the Project and Investment Management Retractor
Just as Cost Center Planning is closely linked with CO, Investment Planning in SEM-BPS is closely linked with the Investment Management (IM) module in SAP R/3. Retractors for IM plan data have been available since SEM release 3.0. With release 3.1, you can also push back budget data to WBS (work breakdown structure) elements in IM and Project System (PS).
You can find examples for the retractors in the delivered planning application for Investment Planning (planning areas 4IM0001 to 4IM0003). Table 3 lists them.
| Example 1 |
- Planning area |
Corp. IM: Strategic Planning (4IM0001) |
|
- Planning level |
Push-back Program Positions (4IMPBIP) |
|
- Planning function |
Push back (4IMPBIP) |
| Example 2 |
- Planning area |
Corp. IM: Strategy Planning (4IM0001) |
|
- Planning level |
Push-back App. Request (4IMPBIQ) |
|
- Planning function |
Push-back (4IMPBIQ) |
| Example 3 |
- Planning function |
Push-back (4IMPBPR) |
| Table 3 |
Investment Planning retractor examples |
The steps to customize and execute the PS/IM push-back functions are the same as those you perform for the CO-OM-CCA retractor: Access BPS with transaction code BPS0 and go to your planning level. Create an exit-type planning function, set the parameters, and execute the function. (See Figures 8 and 9.) Field mapping is not quite as flexible for the PS/IM retractor. However, if you are using custom InfoObjects, you can define the key figure and the most important characteristics as parameters of the planning function. Important: You must have the right authorizations in R/3 to execute the PS/IM retractor, because it checks the A_IMPR* authorization objects for activity 33, Change plan data. Tables 4 through 6 provide an overview of release dependencies, extraction methods, customization, and parameter settings.

Figure 8
Customize the PS/IM retractor by creating an exit-type planning function

Figure 9
Set up a parameter group and execute it to start the PS/IM retractor
Those of you who have already implemented SEM-BPS should now have enough information to put the three retractors for R/3 to work. If you do not yet have SEM-BPS up and running at your site, I hope I've given you another reason to consider implementing this tool.
| SEM release |
As of 3.0B |
| R/2 release |
As of 4.5B, PI 2001.1 |
| Retraction method |
SEM exit-type planning function and R/3 BAPIs |
| Customizing |
- Transaction |
BPS0 in SEM, Create function |
|
- Function Module |
UPB_CI_PUSHBACK_MATCH_IP |
|
- Init Function Module |
UPB_CI_PUSHBACK_INIT |
| Execution |
Transaction |
BPS0 in SEM, Execute function |
| Parameters |
- Logical system |
RFC destination for target system |
| - Test mode |
Space= Update data
X = Test without update (simulation) |
| - Output of non-matched strategic program positions, only matching |
Space = no
X = yes
|
| - No push back of strategic program positions, only matching |
Space = no
X = yes |
| - Save matched strategic program positions in the InfoCube |
Space = no
X = yes |
| - Exchange rate type |
Exchange rate type for currency translation |
| - InfoObject for key figure |
InfoObject for key figure (default: 0AMOUNT) |
| Documentation |
See online documentation of function module UPB_CI_PUSHBACK_MATCH_IP (transaction code SE37). See SAP Note 503399 for additional documentation. |
| Table 4 |
Summary of the Investment Planning retractor for program positions |
| SEM release |
AS of 3.0B |
| R/3 release |
As of 4.5B, PI 2001.1 |
| Retraction method |
SEM exit-type planning function and R/3 BAPIs |
| Customizing |
- Transaction |
BPS0 in SEM, Create function |
|
- Function module |
UPB_CI_PUSHBACK_IQ |
| - Init function module |
UPB_CI_PUSHBACK_INIT |
| Execution |
Transaction |
BPS0 in SEM, Execute function |
| Parameters |
- Logical system |
RFC destination for target system |
|
- Test mode |
Space = update data
X = test without update (simulation) |
| - Output of appropriatation requests without R/3 source system |
Space = no
X = yes |
| - Exchange rate type |
Exhange rate type for currency translation |
| - InfoObject key figure |
default: 0AMOUNT |
| - InfoObject appropriation request |
default: 0APPR_REQU |
See online documentation of function module UPB_CI_PUSHBACK_IQ (transaction code SE37).
See SAP Note 503399. for additional documentation. |
| Table 5 |
Summary of the Investment Planning retractor for appropriation requests |
| SEM release |
AS of 3.0B (Budget as of 3.1B) |
| R/3 release |
As of 4.5B, PI 2001.1 (Budget as of PI 2002.1) |
| Retraction method |
SEM exit-type planning function and R/3 BAPIs |
| Customizing |
- Transaction |
BPS0 in SEM, Create function |
|
- Function module |
UPB_CI_PUSHBACK_PR |
| - Init function module |
UPB_CI_PUSHBACK_INIT |
| Execution |
Transaction |
BPS0 in SEM, Execute function |
| Parameters |
- Logical system |
RFC destination for target system |
|
- Test mode |
Space = update data
X = test without update (simulation) |
| - Output of WBS element without R/3 source system |
Space = no
X = yes |
| - Post budget |
Space = plan (default)
X = budget |
| - Post budget changes as returns and supplements |
Space = original budget (default)
X = returns and supplements |
| - Exchange rate type |
Exchange rate type for currency translation |
| - InfoObject for key figure |
default: 0AMOUNT |
| - InfoObject for WBS element |
default: 0WBS_AS_ELE |
See online documentation of function module UPB_CI_PUSHBACK_IQ (transaction code SE37).
See SAP Note 503399. for additional documentation. |
| Table 6 |
Summary of the Investment Planning and Project System Retractor for WBS elements |
1 The CO-PA retractor does not require SEM. It is based on BW functionality only.
Marc Bernard
Marc Bernard is a chief architect for SAP NetWeaver, specializing in SAP NetWeaver Business Intelligence, Business Planning, BI Accelerator, and Enterprise Search. In his role as chief architect, he has a strategic focus on future development topics, works closely aligned with the Development Architecture team, and is a trusted advisor for SAP’s customers. Marc has spoken at many SAP-sponsored events and is also a moderator on the SAP Developer Network.
You may contact the author at marc.bernard@sap.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.