Tips Tricks and Techniques for Optimal Use of Process Chains

39
High Performance Consulting July 22, 2008, New York, NY Tips, Tricks and Techniques for Optimal Use of Process Chains Jeevan K Ravindran BI Solution Architect, TekLink Intl.

Transcript of Tips Tricks and Techniques for Optimal Use of Process Chains

Page 1: Tips Tricks and Techniques for Optimal Use of Process Chains

High Performance Consulting

July 22, 2008, New York, NY

Tips, Tricks and Techniques for Optimal Use of Process Chains

Jeevan K Ravindran

BI Solution Architect, TekLink Intl.

Page 2: Tips Tricks and Techniques for Optimal Use of Process Chains

A bird’s eye view of this session

• Comprehensive look at tips, tricks and best practices

• Understand new features available in BI 7.0

• System performance optimization options

• Process chain monitoring tools

7/22/2008 - Slide # 2

• Custom techniques and methods

Page 3: Tips Tricks and Techniques for Optimal Use of Process Chains

What we will cover …

• Process Chain Basics and beyond

• New features in BI 7.0

• System performance optimization options

• Monitoring and analysis of Process Chains

7/22/2008 - Slide # 3

• Utilities and custom techniques

• Summary & Wrap-up

Page 4: Tips Tricks and Techniques for Optimal Use of Process Chains

Process Chain Basics

• Process chain is a logical grouping of processes , jobs or steps

• Each step is made up of a ‘Process Type’• Process type generally corresponds to a BW activity

• Examples of Process types are ‘Load data’, ‘Activate ODS’ etc.

• Process types are maintained in table RSPROCESSTYPES• To view process type definition use Tcode RSPC

• Click on the menu option – Settings -> Maintain Process Types

7/22/2008 - Slide # 4

• Click on the menu option – Settings -> Maintain Process Types

• As of SP14 NW BI 7.0, SAP has supplied 47 process types

Page 5: Tips Tricks and Techniques for Optimal Use of Process Chains

Process Variant and its details

• Process Variant • An instance of a process type

• Contains specific values / parameters to execute a process type (step)

• To see the technical details of each step (process type’s variant)• Click on menu option ‘View -> Detailed view on’.

7/22/2008 - Slide # 5

• Scheduling time • System creates a batch job named BI_PROCESS_<PROCESS TYPE’s name>

• The job listens to a preceding step’s event (except for Start variant)

•The batch job uses the program RSPROCESS

• Process chain name, variant, wait time etc are passed to the program

Details

Page 6: Tips Tricks and Techniques for Optimal Use of Process Chains

Structure of a Process Type

• Process type details from table RSPROCESSTYPES

Code behind the process type’s functionality. Usually an ABAP class name.

7/22/2008 - Slide # 6

Determines whether a process type sends back success or error message.

Page 7: Tips Tricks and Techniques for Optimal Use of Process Chains

What we will cover …

• Process Chain Basics and beyond

• New features in BI 7.0

• System performance optimization options

• Monitoring and analysis of Process Chains

7/22/2008 - Slide # 7

• Utilities and custom techniques

• Summary & Wrap-up

Page 8: Tips Tricks and Techniques for Optimal Use of Process Chains

New features in BI 7.0

• Process Chain features• Process status evaluation (*)

• Execution User

• Copy process chain

• New Process Types• Decision Between Multiple Alternatives (*)

• Construct Database Statistics

• Deletion of Requests from the Change Log (*)

7/22/2008 - Slide # 8

• Deletion of Requests from the Change Log (*)

• Execute Planning Sequence

• Switch Realtime InfoCube to Plan Mode / Load Mode

• Close Request of Real-Time InfoPackage

• Interrupt process

• Trigger Event Data Change (*)

• Archive Data from an InfoProvider

• Check process chain is already active (*)

• Data Transfer Process

(*) Covered in detail in later sections

Page 9: Tips Tricks and Techniques for Optimal Use of Process Chains

Process Status Valuation

• Business Case: Ignore error in an ‘Unimportant’ step, and set the status of entire Process Chain to Green.

• ‘Unimportant’ means, the subsequent process will run even if the previous step is in Error. That is dependency is ‘Always’ or ‘With Errors’.

• Note – Mailing and alerting are not affected by this setting.

• In Tcode RSPC, for a process chain, select the menu option: Process Chain

-> Attributes -> Process Status Evaluation.

7/22/2008 - Slide # 9

• In the subsequent pop-up, select the check box

Page 10: Tips Tricks and Techniques for Optimal Use of Process Chains

Is the Previous run still active?

• Business case: Do not start the process chain, if the previous run is still active.

• Multi-fold solution: • 1) Using a custom ABAP program to schedule the process chain (PC) execution.

• The custom ABAP program will check the execution status of the PC

• If the PC is not running, the ABAP program will start the process chain

• 2) From NW BI 7.0 SP14 onwards,

7/22/2008 - Slide # 10

2) From NW BI 7.0 SP14 onwards,

• Use a new Process type named ‘Is the Previous run in the chain still active?’.

• As shown in the figure below, this process type can be found under ‘General Services’.

Page 11: Tips Tricks and Techniques for Optimal Use of Process Chains

Is the Previous run still active? (cont…)

• How to use this Process type• Step 1) Drag the process type ‘Is the Previous run in the chain still active?’ into the Design window

• Step 2) When you connect this process type to the next step, the following pop-up appears.

• Here, select the radio button ‘Successful’.

• Step 3) Select the line ‘Inactive’ (value 1) as show in the below figure, and then press the Green check mark button.

7/22/2008 - Slide # 11

Page 12: Tips Tricks and Techniques for Optimal Use of Process Chains

Is the Previous run still active? (cont…)

• How to use this Process type• Step 4) Create another process type for action, if the process chain is already active.

• An example of this step would be an ABAP to send an email alert

• Step 5) Connect the process type ‘Is the Previous run in the chain still active?’ to the process type created in Step 4.

• This time, select the option ‘Active’ (value 2). And press green check box.

• The process chain will look at this at the end of step 5.

7/22/2008 - Slide # 12

Step 5

Chain after completion of step 5

Page 13: Tips Tricks and Techniques for Optimal Use of Process Chains

Integration to BEx Broadcasting

• Business case: How can we execute reports just after finishing the data load?

• Solution: Use the process type ‘Trigger Event Data Change’ in the process chain.

• While scheduling BEx broadcaster setting, select the option ‘Execute with Data change in the InfoProvider’.

• The steps to achieve this are listed below:

7/22/2008 - Slide # 13

• The steps to achieve this are listed below:• Step 1: Include the process type as a step after data load. See below

figure.

Page 14: Tips Tricks and Techniques for Optimal Use of Process Chains

Integration to BEx Broadcasting (cont..)

• Steps to integrate to BEx broadcasting (cont …)• Step 2: In the variant specify the InfoProvider (Fig 1)

• Step 3: Select the option ‘Execute with Data change in the InfoProvider’ (Fig 2).

7/22/2008 - Slide # 14

• If you schedule many broadcast settings based on the data change, it can affect your system performance.

Fig 1. Enter InfoProvider in the variant Fig 2. Scheduling Options in BEx broadcaster

GOTCHA!

Page 15: Tips Tricks and Techniques for Optimal Use of Process Chains

What we will cover …

• Process Chain Basics and beyond

• New features in BI 7.0

• System performance optimization options

• Monitoring and analysis of Process Chains

7/22/2008 - Slide # 15

• Utilities and custom techniques

• Summary & Wrap-up

Page 16: Tips Tricks and Techniques for Optimal Use of Process Chains

Performance improvement options

• Performance improvement options in a Process Chain:

• Initial Fill of New Aggregates / Roll Up of Filled Aggregates

• Initial Activation and Filling of BIA Indexes / Roll Up of BIA Indexes

• Compression

• Construct Database Statistics

• Archive Data from InfoProvider

• Delete / Generate indexes

Deletion of Requests from the Change Log

7/22/2008 - Slide # 16

• Deletion of Requests from the Change Log (*)

• Deletion of Requests from PSA

• Miscellaneous• Process chain log deletion program (*)

(*) Covered in detail in later sections

Page 17: Tips Tricks and Techniques for Optimal Use of Process Chains

Change Log clean up

• Use the process type ‘Deletion of Requests from the Change Log’

• The process chain variant options are listed below.

7/22/2008 - Slide # 17

Enter retention period

Requests that have an OK quality status, and were successfully updated.

Requests that have incomplete quality status and that have not been updated into a data target .

Page 18: Tips Tricks and Techniques for Optimal Use of Process Chains

Process Chain Log deletion

• Use the program RSPC_LOG_DELETE to delete old logs• Establish log retention policy (For example, 90 Days).

• Use TCode SE38 to run the program

• Selection screen for the program

7/22/2008 - Slide # 18

• The log deletion program deactivates some steps of the process chain it touches.

• Reactivate the process chains after executing this program

GOTCHA!

If marked, logs of erroneous batch jobs will not be deleted.

Time period is specified here

Page 19: Tips Tricks and Techniques for Optimal Use of Process Chains

What we will cover …

• Process Chain Basics and beyond

• New features in BI 7.0

• System performance optimization options

• Monitoring and analysis of Process Chains

7/22/2008 - Slide # 19

• Utilities and custom techniques

• Summary & Wrap-up

Page 20: Tips Tricks and Techniques for Optimal Use of Process Chains

Monitoring and Analysis options

• Process Chain monitoring tools• Transaction - RSPC

• Display process chain logs

•Transaction - RSPC1

• Display log of one chain at a time

• Transaction - RSPCM (*)

• Transaction - RSM37 (*)

7/22/2008 - Slide # 20

• Process Chain analysis tools• Transaction - RSPC2 (*)

• Transaction - BWCCMS (*)

• Transaction - ST13 (*)

• BI Statistics reports

(*) Covered in detail in later sections

Page 21: Tips Tricks and Techniques for Optimal Use of Process Chains

Process Chain Monitor - RSPCM

• ‘One stop shop’ to monitor critical process chains’ runs• Main screen of RSPCM is shown below

Link to logStatus of execution

7/22/2008 - Slide # 21

• Add the required process chain using the ‘Create’ button

• Optional step – Add email message

Page 22: Tips Tricks and Techniques for Optimal Use of Process Chains

How to link a background job to a chain?

• Looking at SM37 jobs doesn’t give much insight• Jobs from different process chains (PC) have the same name

• For example, BI_PROCESS_ABAP could be from PC #1 or PC #10 or PC #14

• Difficult to relate a background job to its parent process chain

• A new transaction - RSM37 was introduced in BI SP13 to solve this conundrum

• To narrow down selection to only process chain related jobs, populate the fields in the section ‘Contents of Program Variant’.

7/22/2008 - Slide # 22

fields in the section ‘Contents of Program Variant’.

Can also enter Variant here

Enter Variant value here

Page 23: Tips Tricks and Techniques for Optimal Use of Process Chains

RSM37 cont …

• A sample output from RSM37 is shown below

Process Chain NameJob Name

Variant Name

Process Type

7/22/2008 - Slide # 23

Page 24: Tips Tricks and Techniques for Optimal Use of Process Chains

BWCCMS

• BWCCMS functions similar to transaction RSPCM.• Can be used to identify overall process chain errors (status) just by looking at the node ‘Process chains’.

• Integration with Process chain log (by double click on a message)

7/22/2008 - Slide # 24

• BWCCMS Monitoring can be excluded for a specific chain

Page 25: Tips Tricks and Techniques for Optimal Use of Process Chains

Analysis and Service tools launch pad

• Run-time analysis of process chains can performed using TCode ST13.

• Step1: Select the tool named ‘BW-TOOLS’ in the initial screen

• Step 2: In the next screen choose ‘Process Chain analysis’

7/22/2008 - Slide # 25

• Step 3: Select the button ‘Process Chains’

• For Process type level analysis,

Choose ‘Process Types’ option

Page 26: Tips Tricks and Techniques for Optimal Use of Process Chains

ST13 (cont…)

• Step 4: Enter selection values, and hit execute button.

• Step 5: The next screen shows process chain executions

Link to PC log

Step 4

PC Runtime value

7/22/2008 - Slide # 26

• Step 6: Perform run-time comparisons• Select up to 5 lines and click on ‘Compare Runtimes’ button

Step 4

Step 5

Page 27: Tips Tricks and Techniques for Optimal Use of Process Chains

What we will cover …

• Process Chain Basics and beyond

• New features in BI 7.0

• System performance optimization options

• Monitoring and analysis of Process Chains

7/22/2008 - Slide # 27

• Utilities and Custom techniques

• Summary & Wrap-up

Page 28: Tips Tricks and Techniques for Optimal Use of Process Chains

Utilities and Custom techniques

• How to debug a process chain?

• How to stop a running process chain?

• How to identify chains that use a particular Process Type?

• How can we incorporate decision branches in a Chain?

7/22/2008 - Slide # 28

• Custom method to schedule process chains.

• Custom method to identify errors in process chains.

Page 29: Tips Tricks and Techniques for Optimal Use of Process Chains

How to debug a process chain?

• How can we set a break-point in a process chain?• Step 1: RSPC, select the process chain.

• Go in change mode.

• Step 2: Select the process type that you want to debug

• Right mouse click and select ‘Debug Loop’ option

7/22/2008 - Slide # 29

• Step 3: Enter a wait time greater than 0 seconds. And then, activate the Process Chain.

Page 30: Tips Tricks and Techniques for Optimal Use of Process Chains

How to debug a process chain? (cont…)

• Step 4: Go to the menu option: Execution -> Execute Synchronous to Debugging

• Step 5: The debug screen will now pop-up

7/22/2008 - Slide # 30

• Step 5: The debug screen will now pop-up

Page 31: Tips Tricks and Techniques for Optimal Use of Process Chains

How to stop a running process chain?

• Develop a program which uses the function module RSPC_API_CHAIN_INTERRUPT

• Accept Process Chain as a ‘Select-Option’ variable.

• Call the function module for selected chain(s)

• The parameter I_KILL = ‘X’ will terminate data loading processes.

7/22/2008 - Slide # 31

• Alternate option• Using TCode RSPC, select the process chain.

• Switch to change mode. Go to menu Execution. Then select ‘Remove from schedule’.

Page 32: Tips Tricks and Techniques for Optimal Use of Process Chains

How to identify chains that use a particular Process Type?

• Business case: Identify the process chains that use process type – OS Command.

• Solution: Use TCode RSPC2.• In RSPC2, enter the process type value (e.g. COMMAND)

7/22/2008 - Slide # 32

• The subsequent screen will show the process chains that use this process type.

Page 33: Tips Tricks and Techniques for Optimal Use of Process Chains

How can we incorporate decision branches?

• Business case: Update to cube only if any data exist in ODS change log

• Solution: Use decision between multiple alternatives• Define a custom formula that returns a value 1, if any data exist in Change log

• Use that function in the formula editor of this process variant.

7/22/2008 - Slide # 33

Page 34: Tips Tricks and Techniques for Optimal Use of Process Chains

Decision Between Multiple Alternatives

• Maintain Decision variant (Fig 1)

• While trying to connect the Decision variant to the subsequent step, the a pop-up appears as shown in Fig 2.

7/22/2008 - Slide # 34

•Final view of process chain (Fig 3)

Fig 1

Fig 2

Fig 3

‘Further processing

step’ is executed only

if there is data

Option 01Option 02

Page 35: Tips Tricks and Techniques for Optimal Use of Process Chains

Custom method to schedule process chains

• Make process chain’s start condition ‘After event’• Create one event per process chain.

• Schedule the process chain with ‘Periodic Job’ check marked

• Write a driver program to schedule process chains• This program will trigger Events based on conditions

• Conditions include dependent Process Chains, Days and time.

Event related to Process Chain

Dependent Process Chain(s)

7/22/2008 - Slide # 35

• Create a background job for Driver program using SM36• In the Drive program, Create a variant (with event name and dependencies) for each process chain

•Schedule the job with a frequency that reflects data load frequency

Inclusion Days

Page 36: Tips Tricks and Techniques for Optimal Use of Process Chains

Custom method to identify process chain errors

• Develop a watchdog program that sniffs for errors• Step 1 - Identifies the process chains that the system has not yet analyzed

• Step 2 – Check process chain’s execution status

• Step 3 – For those chains in error status, perform further checks

• Analyze the status given in the process chain’s log.

• Analyze the status of the job spawned from the process chain’s step.

• If the process type has any interface, the watchdog program must checks the status of the interface.

• Step 4 – Send email notification of errors

7/22/2008 - Slide # 36

Step 4 – Send email notification of errors

• Define and schedule the watchdog job. • Schedule the watchdog program at 30 min frequency

• For more details, please refer to the March 2008 BI/BW Expert article titled ‘Uncover Process Chain Execution Errors When SAP

NetWeaver BI Fails To Notify You’. By Jeevan Ravindran, TekLink

International.

• Download the source code from the website - www.bwexpertonline.com

Page 37: Tips Tricks and Techniques for Optimal Use of Process Chains

Summary & Wrap-up

• Create message (notification) in the main steps of the process chain

• Easy way to get detect errors

• Use events to start process chains. • Alternatively, make the Chain ‘Start using Meta Chain or API’.

• This provides flexibility to schedule process chains with the help of a driver ABAP program

7/22/2008 - Slide # 37

• Make use of parallelism• Many process types such as Loading, Attribute change run, ODS Activation etc. supports parallelism.

• Use performance improvement option available• Both query and data load improvement options

• Monitor and analyze Process chain performance• Use all available options such as RSPCM, BI Statistics etc.

Page 38: Tips Tricks and Techniques for Optimal Use of Process Chains

Q & A

Questions?

7/22/2008 - Slide # 38

How to contact me?

Jeevan Kumar Ravindran

TekLink Intl Inc. , www.tli-usa.comCell:609-468-6279

Email: [email protected]

Page 39: Tips Tricks and Techniques for Optimal Use of Process Chains

Copyright

© 2008 TekLink International Inc.No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of TekLink International or the author of this presentation. The information contained herein may be changed without prior notice.

This document is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. TekLink shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. This limitation shall not apply in cases of intent or gross negligence. The statutory liability for personal injury and defective products is not affected. TekLink has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, Duet, Business ByDesign, ByDesign, PartnerEdge and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned and associated logos displayed are the trademarks of their respective companies. Data contained in this document serves informational purposes only.

7/22/2008 - Slide # 39