Function documentationCustom Task

 

You can use this function to execute tasks whose functions you define yourself.

When a custom task is executed, the system calls the active implementation of the delivered Business Add-In (BAdI) UC_TASK_CUSTOM. This BAdI is freely programmable.

As in other tasks, when a custom task is executed, the system first checks the authorization and the task status. For more information, see Authorizations for Tasks and Status Management in the Consolidation Monitor.

The system then updates the task status and creates a task log (with messages only). For more information, see Task Log.

Integration

Custom tasks can reside anywhere in the task sequence. You can define preceding tasks. These may be required if the custom task uses the results of other tasks within the same task group. For more information, see Task Sequence.

Features

The BAdI UC_TASK_CUSTOM provides you with the interface methods EXECUTE and EXECUTE_FINAL.

You implement the function of the custom task in the EXECUTE method. When the EXECUTE method is called, the system transfers the following parameters (among others):

  • Consolidation area

  • Technical name of the custom task

  • Execution parameters, such as the consolidation units or groups to be processed, the group currency, version characteristics, and time characteristics

For more information, see the system documentation.

In Customizing for custom tasks, you can specify whether the custom task is to be executed for consolidation units or consolidation groups:

  • If you choose Processing per Consolidation Unit, the system executes the EXECUTE method collectively for all consolidation units to be processed, and then updates the status of each consolidation unit.

  • If you choose Processing per Consolidation Group, the system executes the EXECUTE method individually for each consolidation group to be processed, and then updates the status of each consolidation group.

The system executes the EXECUTE_FINAL method once only at the end of processing. You can use this method for cleanup activities, for example, to free up working memory.

In Customizing for custom tasks, you can also specify whether the log is to be saved when the task is run in update mode.

Activities

Customizing

To set up a custom task:

  1. Create a custom task. In the process view of the Consolidation workbench, choose Start of the navigation path Consolidation Functions Next navigation step Other Tasks Next navigation step Custom Tasks End of the navigation path.

  2. Implement the BAdI UC_TASK_CUSTOM.

    To see the definition of the BAdI UC_TASK_CUSTOM, go to the SAP Easy Access screen and choose Start of the navigation path Tools Next navigation step Utilities Next navigation step Business Add-Ins Next navigation step Definition End of the navigation path.

  3. Activate the implementation of the BAdI UC_TASK_CUSTOM.

If you activate the business function Financials, Group Close, Allocation (FIN_ACC_GC_ALLOC) and then activate the function Executability of Custom Tasks in the consolidation area settings, you can specify in a custom task with the Per Consolidation Unit processing type that the executability of the task depends on the consolidation unit.

For those consolidation units that you have not flagged as relevant in the task settings, the task appears in the consolidation monitor with the status Not Applicable.

Execution of the Custom Task

Execute the validation task in the consolidation monitor.

The system calls the active implementation of the BAdI UC_TASK_CUSTOM. When processing is finished, the system displays the messages of the EXECUTE and EXECUTE_FINAL methods.

Example

Extraction of Transaction Data

Data collection in your business process is configured so that the data is first extracted from an SAP source system and written to SAP NetWeaver Business Intelligence (BI), where it is then processed by the consolidation component (or by another BI-based application) by means of reading the respective InfoProvider. You want this data collection to be triggered and monitored in the consolidation monitor.

To do this, you create a custom task (processing per consolidation unit) and insert it into the consolidation monitor.

You implement the EXECUTE method (see also the source text of the example implementation of this BAdI) and activate the implementation.

Updating Custom Database Tables

Your business process periodically writes and updates certain data in separate database tables specifically defined for this purpose, from where it is used in the consolidation process. For example, you import consolidation-unit-specific exchange rates through a file interface in a database table, which is then used by the BAdI to determine exchange rates during currency translation. You want this update to be triggered and monitored in the consolidation monitor.

To do this, you create a custom task (processing per consolidation unit) and insert it into the consolidation monitor.

You implement the EXECUTE method. This method reads the data, performs the update, and returns any error messages (for example, if the expected data cannot be found).