Conditional Execution of Planning Functions in BI-IP in a Planning Sequence using the After_Burn_Selection Exit

Applies to:
BW 7.X, BI-Integrated Planning. For more information, visit the Business Intelligence homepage.

Summary
Executing a planning sequence means that every single planning function contained in the planning sequence is executed one after the other. This paper shows how a conditional execution of planning functions inside a planning sequence can be achieved. It is possible to skip the execution of certain planning functions of a planning sequence based on a customer defined criterion. This behavior can be used to emulate IF THEN ELSE ENDIF or CASE ENDCASE conditions in planning sequences. We utilize the AFTER_BURN_SELECTION exit to achieve this behavior, which is described in detail in note 1101726 “Changing the active filter of planning functions”, although in a different context. Author: Matthias Nutt

Company: SAP (Switzerland) AG Created on: 12 May 2010

Author Bio
Matthias Nutt works for SAP (Switzerland) AG. He is a professional consultant since 2002 and works in the area of BW in close co-operation with the development and support team. His work spans a variety of roles, including project manager, technical project manager, consulting, development, primary and development support.

SAP COMMUNITY NETWORK © 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 1

..................................................................................................sap........................................................................sap............................. 10 SAP COMMUNITY NETWORK © 2010 SAP AG SDN .....................sap............... 3 A simple sample implementation for “skipping” the execution of a planning function .............................com | BOC ......com 2 ..................................boc................ 8 Related Content ............................sdn......................................... 3 Activating the AFTER_BURN_SELECTION exit ...................................Conditional Execution of Planning Functions in BI-IP in a Planning Sequence using the After_Burn_Selection Exit Table of Contents Introduction ....... 4 Modeling IF THEN ELSE ENDIF for “skipping” the execution of planning functions ......................................................................... 5 Miscellaneous .......................................... 9 Copyright ..................com | BPX ..............bpx.................................................................................................................................................................................

X is a sequence of planning functions. In this paper. Please note as well that the SAP support organization cannot handle customer messages about the implementation of “skipping” planning functions. the exit is a link to a customer defined function module which has a certain interface (see below). This exit is not an exit in terms of a standard SAP customer exit which can be implemented using transactions SMOD/CMOD. Later on. Every single step of a planning sequence is defined by a (internal) step id. If the criterion is false. please enter the name of a function module (in the customer name space) that should be used as exit function. the AFTER_BURN_SELECTION exit is used to change the active filter of a planning function to allow the planning function to work only on changed records.sap. IMPORTANT NOTE: Please be aware that the purpose of the AFTER_BURN_SELECTION is to allow changing the active selection.com | BOC . A customer defined criterion is evaluated to check if a planning function should be executed or not 2. It starts by activating the exit. To use the exit it must be activated in a different way.sap. SAP COMMUNITY NETWORK © 2010 SAP AG SDN . followed by a simple sample implementation. The technique which allows that has been introduced by note 1101726 “Changing the active filter of planning functions”. In fact. In fact.com | BPX . One planning function is executed after the other. Indeed the planning framework tries to start the planning function but by raising an artificial error message it is possible to stop the execution of the planning function before it is really started which leads to the illusion that the planning function was not executed at all. this how-to-paper misuses the AFTER_BURN_SELECTION exit in a way it was not designed for. This has been done to allow planning functions to run only on changed records as described in the above mentioned note.bpx. a simple IF THEN ELSE ENDIF sample is explained. It is not possible to skip a single step. If the criterion is true an artificial error message is issued in the AFTER_BURN_SELECTION which causes the system to stop the execution of the planning function.sdn. Please post your questions in SDN in the business planning forum. The basic idea is to implement the AFTER_BURN_SELECTION exit in such a way that 1.com 3 . Please enter RSPLF_SELECTION_EXIT into parameter OBJECT. Here we show another example how this exit can be used to fulfill our requirement. An entry in table RSADMIN needs to be maintained (see note 1101726 for further details). For parameter VALUE. In that note. The approach discussed in this paper does not change this fundamental behavior but it demonstrates how “skipping” a step can be simulated by implementing the AFTER_BURN_SELECTION exit. Adding the entry can be achieved by executing report SAP_RSADMIN_MAINTAIN. This functionality is now available in the standard (see note 1356805 for further details). an aggregation level. no artificial message is raised and the execution of the planning function continues normally. Activating the AFTER_BURN_SELECTION exit The core idea is to use the AFTER_BURN_SELECTION exit.boc. In the remaining section an outline of this technique is given. a filter and a planning function.Conditional Execution of Planning Functions in BI-IP in a Planning Sequence using the After_Burn_Selection Exit Introduction A planning sequence in BI-IP 7. the exit function has the name Z_SELECTION_EXIT.sap. Planning sequences can be defined in the planning modeler (Transaction RSPLAN). During the execution of the planning sequence each single step is executed.

com | BOC . This artificial error stops the remaining execution of the planning function. The ABAP code below implements this scheme: The case statement checks the name of the planning function. In this case. *"*"Local interface: *" IMPORTING *" *" *" REFERENCE(I_INFOPROV) TYPE RSINFOPROV REFERENCE(I_SERVICE) TYPE RSPLF_SRVNM REFERENCE(I_SELOBJ) TYPE RSZCOMPID *" CHANGING *" REFERENCE(C_T_CHARSEL) TYPE RSPLF_T_CHARSEL *" EXCEPTIONS *" *" EMPTY ERROR A simple sample implementation for “skipping” the execution of a planning function In the following we assume that the planning sequence with the name PLSEQ has been defined in the planning modeler.bpx. the error message is a success message (type S). filter FILT02 and planning function PLFUNC02. the system is raising an artificial error.sap. we need a customer based criterion if a planning function should be executed or not.boc. Or in other words: planning function PLFUNC01 should be “skipped” if the planning sequence is not running on th e first day of a month.sap. The planning framework stops the execution of the current planning function and continues with the next planning function in the planning sequence. which corresponds to the first day in the month. Planning sequence PLSEQ has 2 steps. The second step uses aggregation level AGGLVL02. nothing happens in the exit. SAP COMMUNITY NETWORK © 2010 SAP AG SDN . If the day is not equal to 01.com | BPX . the system retrieves the current day from the system date.com 4 . This is necessary because we do not want to stop the execution of the planning sequence which would be the case if a message of type E is raised. Furthermore. The first step uses aggregation level AGGLVL01. In this example a very simple criterion is used: Planning function PLFUNC01 should only run on the first day of each month.sap. If the name of the planning function is equal to PLFUNC01. Planning function PLFUNC02 should run all the time. Please note that although an error message is raised using the raising statement. the planning function is executed as normal. If the name of the planning function is not equal to PLFUNC01. filter FILT01 and planning function PLFUNC01.Conditional Execution of Planning Functions in BI-IP in a Planning Sequence using the After_Burn_Selection Exit The function module must have the following interface: FUNCTION z_selection_exit.sdn.

planning function PLFUNC01 should be executed on the first day of a month. All that must be done is to split up the IF THEN ELSE ENDIF statement in two simple IF ENDIF statements.com | BPX . a technique which is used in this chapter.sap. the BI-IP planning framework is trying to start them all but for planning function PLFUNC01 the AFTER_BURN_SELECTION exit tests a condition. In the next chapter. execution of the planning function. This represents the ELSE branch of the IF statement. The simple example above shows how a conditional execution of a planning function in a planning sequence can be achieved.bpx. The condition used is to check if the current day is equal to 01. Example: IF A = 01 THEN B ELSE C ENDIF is split up into two simple conditions IF A = 01 THEN B ENDIF followed by IF not ( A = 01 ) THEN C ENDIF This shows that it is straight forward to split up IF THEN ELSE ENDIF statements into two simple statements. The first IF statement uses the original condition and the second IF statement uses the negated condition. Planning function PLFUNC01 is only executed on the first day in a month. In the previous chapter.sap.Conditional Execution of Planning Functions in BI-IP in a Planning Sequence using the After_Burn_Selection Exit FUNCTION z_selection_exit. reading data.com | BOC . WHEN „PLFUNC01‟. * raise artificial error to stop the execution of the planning function MESSAGE S001(UPF) WITH „Skipping planning function: „ I_SERVICE RAISING error. This represents the THEN branch in our example.sdn. WHEN OTHERS. checking the data consistency and the data slices). Especially the expensive part of the planning function is not executed (e. IF sy-datum+6(2) <> „01‟. * do nothing ENDCASE ENDFUNCTION. As the check in the AFTER_BURN_SELECTION exit is one of the first things done during the execution of a planning function. Here we enrich the first example by stating that planning function PLFUNC02 should be executed on all days except the first day of the month. *"*"Local interface: *" IMPORTING *" *" *" REFERENCE(I_INFOPROV) TYPE RSINFOPROV REFERENCE(I_SERVICE) TYPE RSPLF_SRVNM REFERENCE(I_SELOBJ) TYPE RSZCOMPID *" CHANGING *" REFERENCE(C_T_CHARSEL) TYPE RSPLF_T_CHARSEL *" EXCEPTIONS *" *" EMPTY ERROR CASE I_SERVICE. In fact.sap.com 5 .boc. Raising the error message inhibits the remaining execution of the planning function by the planning framework.g. Modeling IF THEN ELSE ENDIF for “skipping” the execution of planning functions Based on the simple example above modeling an IF THEN ELSE ENDIF statement is straight forward. ENDIF. the simple example is further extended to simulate an IF THEN ELSE ENDIF condition. the effect is that the planning function does not seem to be executed. SAP COMMUNITY NETWORK © 2010 SAP AG SDN .

If the condition is true. It is clear that these two conditions need to be checked for each planning function.com | BPX . This is equivalent to run the planning function only on the first day of a month.boc. the system checks if the day is not equal to 01. For planning function PLFUNC01.bpx.com | BOC . an artificial error is raised which stops the execution of the planning function. the artificial error is raised and the execution of PLFUNC02 is stopped.com 6 .sap.sap. For planning function PLFUNC02.sap. the inverse condition is checked: if the day is equal to 01.sdn. SAP COMMUNITY NETWORK © 2010 SAP AG SDN .Conditional Execution of Planning Functions in BI-IP in a Planning Sequence using the After_Burn_Selection Exit Stating this in more technical terms leads to the following statement: IF current day = 01 THEN Execute planning function PLFUNC01 ELSE Execute planning function PLFUNC02 ENDIF Restating this using a “skipping” wording leads to: IF current day <> 01 THEN Skip the execution of planning function PLFUNC01 ELSE Skip the execution of planning function PLFUNC02 ENDIF Transforming this into two separate IF statements leads to: IF current day <> 01 THEN Skip the execution of planning function PLFUNC01 ENDIF IF current day = 01 THEN Skip the execution of planning function PLFUNC02 ENDIF And this is exactly what is going to be implemented in this example.

sap.sap. the system uses a success message.Conditional Execution of Planning Functions in BI-IP in a Planning Sequence using the After_Burn_Selection Exit FUNCTION z_selection_exit.com 7 . WHEN OTHERS. Nevertheless the system is only checking one specific condition for each single planning function. *"*"Local interface: *" IMPORTING *" *" *" REFERENCE(I_INFOPROV) TYPE RSINFOPROV REFERENCE(I_SERVICE) TYPE RSPLF_SRVNM REFERENCE(I_SELOBJ) TYPE RSZCOMPID *" CHANGING *" REFERENCE(C_T_CHARSEL) TYPE RSPLF_T_CHARSEL *" EXCEPTIONS *" *" EMPTY ERROR CASE I_SERVICE. If the model is extended further. ENDIF. SAP COMMUNITY NETWORK © 2010 SAP AG SDN . WHEN „PLFUNC02‟. * do nothing ENDCASE ENDFUNCTION.com | BOC . IF sy-datum+6(2) = „01‟. The IF THEN ELSE ENDIF or CASE ENDCASE semantic is derived from choosing the conditions carefully and implementing them the right way. Please note again that although an error message is raised. * raise artificial error to stop the execution of the planning function MESSAGE S001(UPF) with „Skipping planning function: „ I_SERVICE RAISING error. WHEN „PLFUNC01‟. By introducing different conditions for each planning function.boc. CASE ENDCASE like constructs can be created.sdn.bpx. we are able to model IF THEN ELSE ENDIF statements. ENDIF. * raise artificial error to stop the execution of the planning function MESSAGE S001(UPF) with „Skipping planning function: „ I_SERVICE RAISING error.sap.com | BPX . IF sy-datum+6(2) <> „01‟.

boc.sap. As we can see from the ABAP code above.sdn. the information which planning sequence is currently running is not evaluated. you first need to copy PLFUNC01 to PLFUNC03. If you do not want skipping PLFUNC01 in planning sequence PLSEQ2.Conditional Execution of Planning Functions in BI-IP in a Planning Sequence using the After_Burn_Selection Exit Miscellaneous This paper describes the “skipping” technique in the context of a planning sequence. This means that “skipping” as described above is independent of the planning sequence and relies only on the name of the planning function.bpx.com | BPX . it will be skipped in both planning sequences. In the next step you can replace PLFUNC01 with PLFUNC03 in PLSEQ2.sap. If you have for example two planning sequences PLSEQ1 and PLSEQ2 which both contain planning function PLFUNC01.com 8 . SAP COMMUNITY NETWORK © 2010 SAP AG SDN .sap.com | BOC .

sap.sap.boc.com 9 .Conditional Execution of Planning Functions in BI-IP in a Planning Sequence using the After_Burn_Selection Exit Related Content Note 1101726 “Changing the active filter of planning functions” Note 1356805 “Planning functions: Deltas” For more information. visit the Business Intelligence homepage.sdn.sap.bpx. SAP COMMUNITY NETWORK © 2010 SAP AG SDN .com | BOC .com | BPX .

and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. POWER6. POWER5+. JavaScript is a registered trademark of Sun Microsystems. Tivoli and Informix are trademarks or registered trademarks of IBM Corporation. in the United States and in other countries. PostScript. z10. Oracle is a registered trademark of Oracle Corporation. Nothing herein should be construed as constituti ng an additional warranty. Microsoft.com | BOC . Netfinity. AS/400. System x. VideoFrame. POWER6+. Linux is the registered trademark of Linus Torvalds in the U. System z10. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services. z/VM. i5/OS. POWER5.Conditional Execution of Planning Functions in BI-IP in a Planning Sequence using the After_Burn_Selection Exit Copyright © Copyright 2010 SAP AG. Program Neighborhood. S/390 Parallel Enterprise Serv er. X/Open. SAP. Duet. RETAIN. Inc. HACMP. xSeries.sap. WinFrame. Acrobat. zSeries. HTML. MVS/ESA. National product specifications may vary. iSeries.sdn. System z9. System p. AIX.A.boc. Crystal Reports. System Storage. Windows. IBM. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. Xcelsi us. Power Architecture. System p5. BladeCenter. Java is a registered trademark of Sun Microsystems. Citrix. Business Objects and the Business Objects logo. R/3.sap. eServer. System i5. World Wide Web Consortium. All rights reserved. System i. and other countries. S/390. Web Intelligence. OS/390. BatchPipes. PartnerEdge. PowerPC. XHTML and W3C are trademarks or registered trademarks of W3C®. SAP COMMUNITY NETWORK © 2010 SAP AG SDN . DB2 Universal Database. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.. System z. Intelligent Miner. DB2.S. without representation or warranty of any kind. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only. z/OS. if any. SAP NetWeaver. Inc. OpenPower. Excel. PowerVM. POWER. DB2 Connect. Data contained in this document serves informational purposes only. All other product and service names mentioned are the trademarks of their respective companies. UNIX. z9. used under license for technology invented and implemented by Netscape.com 10 . and PowerPoint are registered trademarks of Microsoft Corporation. WebSphere. 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 other countries.com | BPX . Outlook. OS/2. Crystal Decisions. These materials are subject to change without notice. and SAP Group shall not be liable fo r errors or omissions with respect to the materials. Business Objects is an SAP company. BusinessObjects. RACF. and MultiWin are trademarks or registered trademarks of Citrix Systems. OS/400. GPFS. ByDesign. XML. and Motif are registered trademarks of the Open Group. Massachusetts Institute of Technology. pSeries. MetaFrame. The information contained herein may be changed without prior notice.sap. ICA. Inc. OSF/1. and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S. Adobe. the Adobe logo. Parallel Sysplex.bpx. Redbooks. SAP Business ByDesign.

Sign up to vote on this title
UsefulNot useful