Related to Process Type in BI 7.0: Decision between Multiple Alternatives

Size: px
Start display at page:

Download "Related to Process Type in BI 7.0: Decision between Multiple Alternatives"

Transcription

1 Related to Process Type in BI 7.0: Decision between Multiple Alternatives Applies to: SAP Business Intelligence 7.0. For more information, visit the EDW homepage. Summary The objective of this document is to explain about the process type Decision Between Multiple Alternatives with an example. Author: Ram Mohan Ala Company: L&T Infotech Limited. Created on: 22 April 2011 Author Bio Ram Mohan Ala is a Software Engineer at L&T Infotech Limited. He has been involved in SAP BW/BI Implementation & support Projects 2011 SAP AG 1

2 Table of Contents Decision Between Multiple Alternatives Process Type in BI Business scenario:... 3 Decision between Multiple Alternatives:... 3 Inserting of Process type... 4 How to specify the condition... 4 Formula Building... 6 Creation of Formula... 7 Functionality of WORKINGDAY_MONTH... 7 Parameters of WORKINGDAY_MONTH... 7 Saving the Variant... 9 Linking up the Subsequent Process for success... 9 Loading of Process to check the condition Linking up the Subsequent Process for error Loading of Process to check the condition Another Scenario Note Related Content Disclaimer and Liability Notice SAP AG 2

3 Decision Between Multiple Alternatives Process Type in BI 7.0. Decision Between Multiple Alternatives is a process type which is used in the process chains to trigger the chain on multiple Times or on a specified period of the requirement. Business scenario: A process chain should be triggered on all workdays of the month other than a particular workday. In process chain we have options to trigger the chain on a particular day, but we don t have simplest way to stop on a particular day. Other options which we have are to write a program, or create a new factory calendar of required dates. These both are complexes when compared to Decision Between Multiple Alternatives. Process Type Decision Between Multiple Alternatives which is new feature in BI 7.0, by which we can meet such situations. And it s the simplest way like adding any other process types, and formula needs to be put in place as per the requirement. Decision between Multiple Alternatives: The Decision process type allows you to determine a set of conditions which form the basis of a decision, in accordance with the following logic: If condition A is filled, option X applies, if condition B is filled, option Y applies, otherwise, option Z applies. In the formula builder, only syntax fields are directly available as fields. In particular, this allows decisions on the basis of date and time. Once you put all conditions in the process type, then when you connect a link between decision process type to the next process, it will asks on what condition you need to proceed to next process type. You can find the process type in "General Services". Process type 2011 SAP AG 3

4 Additional information: Process Chain category contains the following formula functions: PREDECESSOR_PARAMETER: Runtime parameter of direct predecessor PROCESS_PARAMETER: Runtime parameter of a process in the current chain PROCESS_VALUE_EXISTS: Process in chain has parameter value These functions allow you to access values from predecessor (and successor) processes of the current process chain. If the process is a predecessor process, the system requests the instance values otherwise the maintained variant values are requested. Inserting of Process type Insert the Decision process type into the process chain by using drag and drop or by double-clicking. I am using a Business Scenario to explain the process. Example: The process chain/subsequent Process to be triggered on all other Workdays except Workday 9, Or I can use the same event for triggering the subsequent process for workday equals to 1 or 16. As shown below give the Technical name and Press create button. Then a window pops up asking for the description. Enter the description of the process variant and choose next Create How to specify the condition Next the maintenance screen of process variants for a decision appears as shown below SAP AG 4

5 Enter the decision paths for the process variant in the table i.e. you specify the conditions on the basis of which specific options are to be selected as events. When creating the variant, the system displays the first row with the IF then commands and the second, last row with the commands Else then. You can insert additional rows. These are inserted between the first and last rows with the ELSE IF. For the last row, you cannot specify a formula because the condition is If none of the previous conditions is fulfilled, chose <Option X> as event The above Screenshot talks about If and else if part i.e. The formula written gives the output as Workday other than 9 then first condition satisfies, and the rest of the chain will trigger Else if we go with other two conditions, workday equal to 1 or 16 which ever workday you like to go and hit the next process type i.e. DTP which will trigger on base of that formula on that particular day. If none of the above condition is satisfied then else part will fall in SAP AG 5

6 Formula Building Specify the condition in the Formula column using the formula builder for each row by selecting Create (Button). For the formula, enter the description that is displayed. Create Below is screen where you have to insert the formula as per the requirement. There are some functions and some standard fields which come handy to meet the requirement SAP AG 6

7 Creation of Formula Workday of the month function is used to describe the parameters as below. WORKINGDAY_MONTH (Input_date, Factory_Calendar, Selected_correct_Option) Formula based on the functions below. Parameters inside the function are Input_date Mandatory Factory _Calendar (Optional) Selected_correct_Option (Optional) Functionality of WORKINGDAY_MONTH It calculates from < date> the corresponding working day, depending on the calendar variant. If the selected date is not a working day, you can select whether the preceding or the following working day is to be returned. Parameters of WORKINGDAY_MONTH workingday_month(<date>, <<cal_id>>, <<correct_option>>) The parameters <<cal_id>> and <<correct_option>> are optional. If you do not enter anything for these optional parameters, the system uses the default values 01 for Factory Calendar Germany Standard. The latter tells the system to return the next working day if the date falls on a weekend or is a holiday. Formula as per the example i.e. the subsequent process to be triggered on all other workdays except workday 9 So the formula goes as below. WORKDAY_MONTH (Current Date, 01, ) <> SAP AG 7

8 Workday Formula Next press Back button as shown below. BACK Here there will not be any save option once we hit back then in the next screen we will get the same option SAP AG 8

9 Saving the Variant Coming out from the formula window, next Save the formula as shown below. Save Variant Formula Updated Linking up the Subsequent Process for success Next update the formula, by linking up the process types. Below is the example of linking up the decision event with the DTP. Let s trigger the subsequent process (DTP) if the condition Workday is not equal to 9 as shown below. We can link up the other 2 options (Option2 and Option3) is similarly to trigger the subsequent process type. If we are going with workday <> 9 then the process type DTP will be triggered on all other working days except workday 9. Otherwise if we are going with workday equals to 1 or 16, depending up on the selection. The Process type DTP will be triggered on either workday 1 or 16 whichever is selected SAP AG 9

10 Updated formula The below screen shot explains that if the decision is success then the below DTP should be triggered. So here I am going with the workday <>9 if that is successful then the next Process type DTP should be triggered. Suppose in future Client is requests for loading the data on only workday 1 then we go with the option 2, And if it is for only workday 16 then we go with option 3. By this way we can use multiple options and trigger the loads on different dates using a single variant which has multiple formulas. Link which shows in green with Option SAP AG 10

11 Loading of Process to check the condition 1 As per the above condition of Workday <> 9 is satisfied then the process chain should not trigger on all other Workdays except 9. Below is the snap shot where the process chain is successful going through the Decision event as the day the load was triggered is not workday 9 Linking up the Subsequent Process for error Another condition which can be checked is, the subsequent process (DTP) will not trigger if the condition Workday is <> 9 is unsuccessful as shown below SAP AG 11

12 The below screen shot explains that if the decision event is Failed then only below DTP should be triggered Other Wise load should complete at decision event only. The same Process is used in another condition where I want to load the data only if it is workday 9. So Instead of creating a new variant for this I have used the same variant by selecting the option errors as shown above, that means the process for workday <> 9 then all other days that chain will end there itself and Only on Workday 9 the chain will push forward i.e. if the condition fails. Link which shows in Red Loading of Process to check the condition 2 As per the above condition the process chain should not trigger on all other Workdays except 9. Below is the snap shot where the process chain is successful But the Decision event did not trigger the DTP as per the condition SAP AG 12

13 Another Scenario One more Scenario where we can go with Decision Between Multiple Alternatives is, by using the same process type we can trigger the process chains on multiple times as per the requirement. For example: There is business need to trigger a process chain for Workday 01 and workday10 we can use the below formula and by this the process chain will trigger on multiple days that is... It means the process chain will be triggered on workday 01 and also on workday 10 as per the below logic. Note This Process Type can be Changed only in Development and moved across the landscape. As this object doesn t have change access in other boxes except Development SAP AG 13

14 Related Content SAP Community Network SAP Help Portal For more information, visit the EDW homepage SAP AG 14

15 Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document SAP AG 15