Start of Content Area

Function documentation Exit Function  Locate the document in its SAP Library structure

Use

You can define your own planning functions of the type Exit Function to perform specific planning tasks that you cannot solve with any off the planning functions offered by BW-BPS.  You will need to provide function modules to modify the transaction data. Exit functions offer you extensive control over every detail for calculating plan data, however they also require the most work as you must write your own ABAP programs.

BW-BPS exit functions are similar to the SAP customer exits as they offer a defined interface to customer-specific enhancements. However they differ from the customer exits in the extent that the execution of the exit functions takes place within the planning environment (and not in a special transaction). In addition you can set up as many exit functions or function modules as you want, whereas BW-BPS only provides one branch to a customer exit. 

Prerequisites

If you want to set up exit functions you require thorough knowledge of the ABAP programming language and the interface of the function modules that you call up using the exit function.  You will find more information in the F1 help. You can call this when creating and editing an exit function for the field Function Module.

Features

The functionality of an exit function is only limited by the possibilities of the ABAP programming language. How well the function modules actually perform depends on the program logic you define.

Note

SAP delivers sample function modules in the function group UPFX (development class UPF) in order to give you an impression about the possibilities of planning with exit functions. You can use this function module as reference material or as the basis for programming your own function module. Among other things, they contain valuable hints on a generic approach to a solution for dealing with the client-specific, technical names of the automatically generated planning objects. Problems can arise after a transport from Customizing into the production clients when a static approach is used.

When creating an exit function, you enter the technical name of the function module that should be executed when calling up the exit function in the field Function Module. Additionally, you can specify the name of a further function module that you wish to use for initialization purposes.

Note

Using a function module for initialization is useful if you not only want to change data records with the exit function, but also want to create new ones. Initialization then makes sure that the key of the new data records to be created is transferred to the main function module via a parameter designated for this. This ensures that this function module is processed in any case, even if no data records exist yet.

Selection of characteristics

You can select fields to be changed from the list of characteristics that are contained in the planning level. This allows you to define which characteristics you can access within your function module in order to execute certain selections. Independent of what you select here, you can always access all the key figures that are contained in the planning level.

Note

If you create references between data records (for example, "increase planned revenue for the region EMEA by 10% when the revenue of the Asia region exceeds 5 million dollars; otherwise by 5%") in the source code of function modules that are processed when the exit function is called up, you need information on how BW-BPS executes the data transfer to planning functions internally. Make sure that you can actually access the necessary data records at the time of execution.

Essentially you can change the values of key figures with an exit function but not those of characteristics. Nevertheless, if you require such functions (for example for reposting), you can achieve this by first copying the data record to be changed into a local work area, making the necessary changes, saving the changed data record, and deleting the original data record.

Definition of parameters

You can also create any number of parameter fields. You evaluate both the fields to be changed as well as the parameters within your function modules by creating suitable import parameters for the function module. You use these import parameters to transfer the fields to be changed and the parameters to the function module.

A further special feature applies in the case of parameter fields: You create a parameter field with a user-defined name. You supply the fields with the values in a parameter group to the exit function. These values are transferred to the assigned function module when executing the function. To enter values for the parameter fields, it is also necessary that you specify a data element for every parameter field of the exit function. This data element is required to make validations and input help available for the definition of parameter values within the parameter group to the exit function. For the input help for parameter values, the name of a table and a field that it contains can be specified.

Combination of exit functions with other functions

You can include exit functions in planning sequences in the same way as all other types of functions. In this way you have the option, for a particular planning task, of combining the delivered, user-defined functions with the function modules that you execute when calling up exit functions.

 

See also:

Formula

Data Transfer to Planning Functions

Planning Functions

 

 

End of Content Area