Using Process Chains

Objective

After completing this lesson, you will be able to use Process Chains

Process Chains

Scenario

In this learning journey, Data Transfer Processes have been executed manually, but normally they’re scheduled using Process Chains. Let's see how Process Chains can be used to schedule and monitor Data Transfer Processes and other processes in SAP BW/4HANA.

Use of a Process Chain

A process chain is a sequence of processes that are scheduled to wait in the background for an event. Some of these processes trigger a separate event that can, in turn, start other processes.

In an operating SAP BW/4HANA system, several processes occur regularly. If you use process chains, you can:

  • Automate the complex process flows in SAP BW/4HANA with the help of event-controlled processing.

  • Visualize the processes by using network graphics.

  • Centrally control and monitor the processes.

The following list gives the fundamental principals of the process chain:

  • Openness: The principle of openness is applied to the theory behind process chains, in that both user-defined programs and processes can be implemented. In addition, you can include process chains in other process chains, known as meta chains. In doing so, you can integrate process chains from the system in which the meta chain is found, or from other systems. In this context, we’re referring to local or remote process chains.

  • Security: Using process chains offers a high amount of process security, which is based on the following principals of background management:

    • Processes are scheduled before they run and can be monitored with the standard batch monitor.

    • Background events start subsequent processes.

    • Short dumps and terminations are recognized and handled respectively.

  • Flexibility: The subsequent process must get all the required information for a correct run from its predecessors. This set up allows new process types to be integrated without the existing types having to be adjusted.

Process Chain Creation

To create, schedule, and monitor Process Chains, you can use apps in the SAP BW/4HANA Cockpit.

A Process in the context of process chains is a procedure inside, or external to, an SAP system with a defined beginning and end. A distinction is made between a start process, an application process, and a collection process.

A Process is characterized in the following ways:

  • Process Type

    Load Process and Postprocessing - Execute DTP is an example of a Process Type. The Process Type decides which tasks the process has and which properties it has in the maintenance.

  • Process Variant

    The Process Variant is the name of the process. Within the Process Chain context, it displays the configuration of a process of a particular type set at the time of definition. A Process Variant is only consistently defined together with the Process Type. For example, a specific Data Transfer Process represents a Process Variant for Process Type Load Process and Postprocessing - Execute DTP. The user defines the Process Variant at the time that the process is scheduled. A Process Type can have various Process Variants.

    When using a Process Variant, you define the properties directly in the Process Type or, if you want to use it often, you define a variant in advance.

  • Process Instance

    The Process Instance is the characteristic value of the process. It contains the most important information that the process, or subsequent processes wants to communicate. For example, in the load process, this is the name of the request. If the process is ended, the instance is transferred to the process chain management and saved. The logs for the process are stored under the Process Instance. The instance is determined by the process itself at run time, and is normally determined consistently, independent of time or system.

The picture above shows Process Types, which are offered in SAP BW/4HANA.

Start Process in Process Chains

You can define the start condition of a process chain by using a start process. The background control options are available to schedule the start process directly. You can start the process chain immediately (when activating the process chain), at a specified time, or after a particular event. When you activate the process chain, the start process is scheduled in the background, as defined in your selections.

If there aren’t sufficient options available, you can trigger the start of the process chain using API. Use the RSPC_API_CHAIN_START function module. The SAP Scheduling Framework can be used to start the chain using the API and has more extensive scheduling options. You can also trigger the start of a process chain using a meta chain. If the process chain that you set this start condition for is integrated into another process chain, this is called a meta chain. The process chain is started directly by this meta chain.

Note

If you start the start process using a meta chain, it isn't scheduled after you’ve activated the related process chain. The process is only started once the meta chain that it is integrated into is running.

All other processes in a chain are scheduled to wait for an event.

The start process has the following special features:

  • Only the start process can be scheduled without a predecessor process.

  • The start process can’t be a successor of another process.

  • Only one start process is allowed for each process chain.

  • A start process can only be used in a single process chain.

If you want to define more than one start condition to execute a process chain or part of a process chain, use the interrupt process and the start process.

Application Process in Process Chain

Application processes are processes that you want to automate in process chain maintenance. They represent activities typically performed in the operative use of SAP BW/4HANA.

You can also develop your own reusable, custom processes using ABAP.

When you use Process Type Data Target Administration – Clean Up DSO Request, the following three options are available under Clean Up Action:

  • Removal of old requests from the inbound table, for DataStore Objects (advanced) without modeling properties and with the properties Activate Data and Keep Inbound Data, Extract from Inbound Table.

  • Remove old requests from the change log - for DataStore Objects (advanced) with the modeling property Activate Data and Write Change Log.

  • Activate requests – for DataStore Objects (advanced) with modeling properties Activate Data and All Characteristics are Key, Reporting on Union of Inbound and Active Table. In this case, the requests are compressed.

Note

When you use Process Type Data Target Administration - Clean Up DSO Request with CleanUp Action Activate Requests for a Data Mart DataStore Object, it activates requests (which means compressing the data). If you want to activate requests in a Process Chain for a Standard DataStore Object, you have to use Data Target Administration – Activate DSO Data.

Collection Process in Process Chain

A collection process collects several chain strings to form one string in the process chain maintenance.

Process chain management handles collection processes in a particular way. The system makes the variant names consistent and guarantees that all processes of the same name that have been scheduled more than once, trigger the same event. This enables the several chain strings to be collected to form one and also makes multiple-scheduling of the actual application processes unnecessary.

The following collection processes are available in the process chain maintenance:

  • And Process (Last)

    This process doesn't start before all events of the predecessor processes, that is including the last event, which it has waited for, have been successfully triggered. Use this collection process when you want to combine processes and when further processing depends on process starts every time a predecessor process event has been successfully triggered. Use this collection process when you want to avoid multi-scheduling the actual application process.

  • XOR Process (First)

    The application process starts when the first event in one of the predecessor processes has been successfully triggered. Use this collection process when you want to process processes in parallel and schedule further independent processes after these ones.

Process Chain Scheduling and Monitoring

You can check process chain runs and start new runs in the Process Chain Runs app.

In the log view, you get information about the time of creation, change, or activation as well as about the chain runs displays. Symbols display the status of the runs. Yellow indicates that the chain is active, green that the chain ended successfully, red that the chain ended with errors or was terminated.

You can re-select the log for this process chain by choosing Go toOther Log (on the toolbar of the process chain maintenance). The system updates the overview of the process chain runs according to your time selection. The system also refreshes the status of the runs.

Using Display Messages ... shows the log for this single process, for example job logs or process-based messages.

The log view allows to restart any chain process (instance) that was terminated, this in turn ends the chain run. The process can be repeated either automatically or manually.

Depending on the process type, you can start a process in the following two ways:

  • Repair: A process can be repaired and the terminated instance is executed again. This enables you to restart processes that can’t be repeated with a new instance, because the data to be edited is attached to the instance, as with a data transfer process. A data transfer process, for example, can’t be repeated with a new request number, because the data itself is attached to the request.

  • Repeat: A process can be repeated. In this case, a new instance is created.

Restarting a process in a process run can either be controlled manually in the log view (process chain maintenance screen), or the restart can be automated by using the options in the plan view (process chain maintenance screen).

If this is possible for the process type, you can restart a terminated process. In the plan view of process chain maintenance, you can set whether a process can be repaired or repeated when terminated. Go to SettingsMaintain Process Types (in the RSPROCESSTYPES table).

Caution

Do not change the settings for the SAP process types. This can lead to inconsistencies in the data handled by the process.

SAP BW/4HANA also offers automated generation of a Process Chain from an active Data Flow object. Using this option in the BW Modeling Tools offers you to define the technical name and description of the Process Chain. The generated Process Chain can be modified or extended if desired in the SAP BW/4HANA Cockpit. This way of generating Process Chains offers simplified and accelerated creation of Process Chains and reduces development effort.

Video: Creating a Simple Process Chain

Watch the following video to learn how to create a simple Process Chain.

Log in to track your progress & complete quizzes