• No results found

Integration of SAP NetWeaver BPM with SAP BusinessObjects Query as a Web Service

N/A
N/A
Protected

Academic year: 2021

Share "Integration of SAP NetWeaver BPM with SAP BusinessObjects Query as a Web Service"

Copied!
19
0
0

Loading.... (view fulltext now)

Full text

(1)

Integration of SAP NetWeaver BPM

with SAP BusinessObjects Query

as a Web Service

Applies to:

SAP BusinessObjects Query as a Web Service XI 3.1 SP2 and SAP NetWeaver BPM 7.2.

Summary

This document describes the procedure to model business process using automated service generated from Query as a Service. This is a convenient way to consume SAP BusinessObjects Query as a Web Service in NW Composition Environment (CE) and BPM. This paper is written in collaboration with

innovation-center.sap.com (http://innovation-center.sap.com).

The referenced files are available at the following location -

http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/6037d950-23b7-2c10-5d9f-cdd1b6c5dcd3

Author: Abhishek Kumar

Company: SAP Labs India, Ltd Created on: 11 November 2009

Author Bio

(2)

Table of Contents

Introduction ... 3

Business Scenario ... 3

Required Software Component ... 4

Step-by-Step Procedure ... 4

1.1 SAP BusinessObjects Query as a Web Service ... 4

1.1.1 Query as a Web Service query Generation ... 4

1.1.2 Query as a Web Service Service Provisioning ... 5

1.2 SAP NetWeaver BPM ... 6

1.2.1 Wrapper Service ... 7

1.2.2 Process Modeling ... 8

1.2.3 Ruleset Function Modeling ... 12

1.2.4 Deploying Process ... 17

Conclusion ... 18

References... 18

(3)

Introduction

Business processes and Information are the backbone of any company, always going together. Business process management and Business Intelligence (BI) are crucial for running any company. In most cases, Business Processes are monitored and optimized using analytics. Therefore, an easy communication channel between Business Process and Business Intelligence is vital for the successful running of an organization. In simple terms what this means is that it should be easy and intuitive to model different

process steps from numerous reports generated on facts. But creating a process from a report or a section of the report has not always been straightforward task, and can quickly become a complex technical

implementation.

How does one solve the problem posed by the above use case? An ideal solution would be to have a reusable service for the data on which the report is generated; that is, the report element should be published as a web service that can be used as an automated activity within a process. Such a service ensures that the report and the process will work on the same types of data; such a service also helps hide the complexity of working with databases.

While at one level, the integration described in the paper is pretty straightforward, it also shows some interesting points of integration between Business Process and Business Intelligence:

 SAP BusinessObjects Semantic Layer (universe) as the Single source of the truth: The BPM uses the same view on the Enterprise data that the business intelligence platform presents to users. This is an important assurance that Business process automation and user decisions are based on the same facts,

 Nice separation of concerns with the business process platform and the business intelligence platform :

o Business process developer can quickly integrate data without having to worry about how potentially complex analytics are performed

o Business Process are easy to change than embedded processes in the BI platform

 No need for Business Process developer to learn a new language to gather data, such as SQL or MDX - SAP BusinessObjects Semantic Layer – to help one to quickly get analytics on any type of data source in a highly secured manners.

Business Scenario

At a retail store –„ABC‟ - , the manager, while looking at the sales facts, for example, on SAP

BusinessObjects Explorer, realizes that the sale volume of certain products is not as good as expected. In order to improve sales, he decides to offer discount for different product categories based on their price, quantity sold, revenue and cost of sales. All the relevant information is stored in the company database. Business Process will be used to actually calculate the discount based on the different criteria.

(4)

Required Software Component

 SAP BusinessObjects XI 3.1 SP2 Enterprise

 Tomcat or another supported Web Server

 JDK 1.5 or above

 .NET 2.0 framework

 SAP NW Composition Environment

Step-by-Step Procedure

1.1 SAP BusinessObjects Query as a Web Service

Query As a Web Service is a tool from SAP BusinessObjects which lets business user create and publish a

service from SAP BusinessObjects Semantic Layer(universe). The universe is a business representation of corporate data that helps end users access data autonomously using common business terms; it also helps avoid complexity of a query language such as SQL or MDX as well as enabling strong security on data. In other words, the universe represents database queries in the form of Business Terms that are easily understandable to a Business Analyst; these are the terms that are used for report generation and now business process modeling as well. BusinessObjects Universe Designer helps in creating such a universe from diverse datasource such as databases, OLAP, even Web Services or ABAP function. For most use cases, the universes are already available in the BI system in the company. So the Business Process developer has to just create queries for the types which are needed for modeling a process. More details on Query as a Web Service can be found at

http://help.sap.com/businessobject/product_guides/boexir31SP2/en/xi31_sp2_qaaws_en.pdf

1.1.1 Query as a Web Service query Generation

We will use following types to create the query for our solution.

Unit Price MSRP: This is the manufacturer suggested retail price per SKU and color. Quantity sold: Quantity sold - number of SKU sold

Sales revenue: Sales revenue $ - $ revenue of SKU sold

Sold at (unit price): This is the actual unit price per SKU obtained at sale time (i.e. Revenue/Quantity) Margin: Revenue - Cost of sales

SKU: Stock Keeping Unit number (SKU).The lowest level of product description.

Discount: This is a virtual field and does not exist in database. This is added as query to get the discount

result from the rules.

(5)

Following screen shows the generated query

1.1.2 Query as a Web Service Service Provisioning

(6)

See the attached stockService.wsdl for the QaWS service definition.

In the above wsdl the data for our business terms is represented by Table. The table has multiple rows and each row has SKU_number, Unit_Price_MSRP, Sales_revenue, Quantity_sold, Margin,

Sold_at__unit_price_, and Discount as its child entity. The following XSD snippet shows the way data is structured.

<s:complexType name="Row"> <s:sequence>

<s:element name="SKU_number" type="s:double" nillable="true" /> <s:element name="Unit_Price_MSRP" type="s:double" nillable="true" /> <s:element name="Sales_revenue" type="s:double" nillable="true" /> <s:element name="Quantity_sold" type="s:double" nillable="true" /> <s:element name="Margin" type="s:double" nillable="true" />

<s:element name="Sold_at__unit_price_" type="s:double" nillable="true" /> <s:element name="Discount" type="s:double" nillable="true" />

</s:sequence> </s:complexType>

<s:complexType name="Table"> <s:sequence>

<s:element name="row" maxOccurs="unbounded" type="s0:Row" /> </s:sequence>

</s:complexType>

1.2 SAP NetWeaver BPM

Process Composer does not support mapping context data and header of a service input. Only body of the input can be mapped to context data. Since the service published by Query as a Web Service has both header and body for service input, it cannot be directly consumed in the Process Composer as an automated activity. More details about Process Modeling can be found at

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c052052e-fbab-2b10-0d9a-9feed5463589&overridelayout=true

The service operation is as follows:

<operation name="runQueryAsAService">

<soap:operation soapAction="storeService/runQueryAsAService" style="document"/> <input>

<soap:header message="s0:runQueryAsAServiceSoapIn" part="request_header" use="literal">

<soap:headerfault message="s0:runQueryAsAServiceSoapIn"

part="request_header" use="literal" /> </soap:header>

<soap:body use="literal" parts="parameters" /> </input> <output> <soap:body use="literal" /> </output> </operation> <message name="runQueryAsAServiceSoapIn">

(7)

1.2.1 Wrapper Service

In order to be able to use the service provided by Query as a Web Service in the Process Consumer, we need to create a wrapper service that hides the header information and exposes only body of the input part. See the attached java code which exposes the wrapper service.

import java.net.MalformedURLException; import java.net.URL; import java.util.List; import javax.xml.namespace.QName; import javax.jws.WebService; import javax.jws.WebMethod; import javax.jws.WebParam; @WebService(name="WrapperService", portName="WrapperServicePort",serviceName="WrapperServiceService", targetNamespace="http://storeservice/")

public class WrapperService {

@WebMethod(operationName="getTableInfoFromQaaWS", exclude=false)

public static Table getTableInfoFromQaaWS(@WebParam(name="login") String login,@WebParam(name="password") String password){

try { URL wsdlUrl = new

URL("http://inln50076293a.dhcp.blrl.sap.corp:8080/dswsbobje/qaawsservices/?WSDL&cuid= AVYcPaCLNsJPk7v_53vcv6U");

QName qname = new QName("storeService","storeService"); StoreService service = new StoreService(wsdlUrl,qname); QueryAsAServiceSoap queryAsAServiceSoap =

service.getQueryAsAServiceSoap();

RunQueryAsAService parameter= new RunQueryAsAService(); parameter.setLogin(login);

parameter.setPassword(password); QaaWSHeader header = new QaaWSHeader();

header.setSerializedSession("serializedsession"); header.setSessionID("sessionid"); RunQueryAsAServiceResponse runQueryAsAServiceResponse = queryAsAServiceSoap.runQueryAsAService(parameter, header); return runQueryAsAServiceResponse.getTable(); } catch (MalformedURLException e) { //do nothing } return null; }

(8)

The only difference between Query as a Web Service and the wrapper service is in the operation and the input type.

<wsdl:operation name="getTableInfoFromQaaWS" parameterOrder="parameters"> <wsdl:input message="tns:getTableInfoFromQaaWSIn"/>

<wsdl:output message="tns:getTableInfoFromQaaWSOut"/> </wsdl:operation>

<wsdl:message name="getTableInfoFromQaaWSIn">

<wsdl:part element="tns:getTableInfoFromQaaWS" name="parameters"/> </wsdl:message>

It can be seen from the above snippets that the wrapper service is same as the Query as a Web Service service; it only does not have header part for the input type.

Once the wrapper service is ready, we would need to model the process for the same.

1.2.2 Process Modeling

1.2.2.1 Importing a wsdl

1. In the Project Explorer view, expand the Process composer DC node, and the src node. 2. In the context menu of the wsdl node, choose Import.

3. In the wizard that appears, expand the Web Services node and choose wsdl. Choose Next.

4. In the screen that appears, choose Browse and specify the folder in your workspace where the wsdl file has to be placed and choose Remote Location / File System. Choose Next.

(9)

1.2.2.2 Creating a Process

The process can be modeled as follows:

(10)

The input mapping is

The functions mapped to input types in above diagram are constant functions and capture login and password.

The output mapping is

(11)
(12)

1.2.3 Ruleset Function Modeling

Once the aliases are generated the next step is to create the ruleset. The ruleset created for this solution is very simple and contains only one rule and one decision table. The decision table is used to calculate the discount for each product SKU number.

1.2.3.1 Creating a Ruleset Function End of the example.

1. In the Project Explorer view, expand the process composer DC node and in the context menu of the

Rulesets node, choose New Ruleset.

2. In the wizard that appears, enter the name of the ruleset (say discountCalculationFunction) in the field.

3. Select ReturnType as Table-storeService. 4. Add parameter as Table-storeService.

5. Open the ruleset function editor.

(13)

7. Open Aliases page and make all the aliases visible. The default alias name can be changed to give more user friendly English name. The names are changed to Margin, Discount = {double},

(14)

1.2.3.2 Creating a Definition 1. Open the „stockRuleset‟ editor

2. Navigate to Definitions page in the editor 3. Click on „+’ icon under Variable Definitions. 4. Select „double‟ as type from the drop down 5. Give the name of definition (say Cost_per_SKU) 1.2.3.3 Creating a Decision Table

1. In the context menu of the ruleset function node (discountCalculationFunction), choose New

Decision Table.

End of the note.

2. In the Decision Table Creation Wizard that appears, enter a name in the Decision Table Name (say

discountCalculationDT ) field and optionally enter a description in the Comments field. Choose Next.

3. On the Select the Conditions screen, press Ctrl and select the alias,Quantity_sold, in the Available

Conditions section and choose the Select Conditions button.

The „Quantity_sold „alias appears in the Selected Conditions section. Also select “Table has other

condition” radio button. Choose Next.

4. On the Select the Actions screen, press Ctrl and select the alias, Discount = {double}, in the

Available Actions section and choose the Select Actions button.

(15)

The following diagram shows the decision table

1.2.3.4 Creating an If-Then Rule

1. In the context menu of the ruleset node (stockRuleset), choose New Rule. End of the note.

2. In the dialog box that appears, enter a name(say stockRule) for the rule in the field. Choose OK. 3. In the rule editor that appears, under the If section, choose (Add a new Condition).

(16)

5. In the rule editor that appears, under the Then section choose (add a new Action)and in the drop down menu, expand an action type node and choose Evaluate-DecisionTable :

discountCalculationDT

(17)

1.2.4 Deploying Process

You should have a running instance of SAP AS, and should have configured the SAP NetWeaver Developer Studio with this instance.

1. In the Project Explorer view, in the context menu of the process composer DC node, choose Development Component Build

2. In the dialog box that appears, select the process composer DC checkbox and choose OK. End of the note.

3. In the context menu of the process composer DC node, choose Development Component

Deploy.

4. In the Deploy DCs dialog box that appears, select the process composer DC checkbox and choose

(18)

Conclusion

Combining both Query as a Web Services and BPM as one entity hides the complexity of data mapping and its flow from business user. It also offers simplicity through semantic translation of the Query output data model to the Business Process definition and simple data mapping allowing the final integration to increase the level of information.

References

For more information on SAP BusinessObjects Query as a Web Service

http://help.sap.com/businessobject/product_guides/boexir31SP2/en/xi31_sp2_qaaws_en.pdf

See also Web Intelligence chapter “Sharing Web Intelligence content with other Web applications”

http://help.sap.com/businessobject/product_guides/boexir31SP2/en/xi31_sp2_webi_rich_en.pdf

For more information on SAP NW BPM

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c052052e-fbab-2b10-0d9a-9feed5463589&overridelayout=true

For more information on SAP NW BRM

(19)

Copyright

© Copyright 2009 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.

Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.

SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, 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.

Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.

All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

References

Related documents

Instead of sending backups to a tape drive or other media attached to the computer being backed up, a remote backup sends encrypted file data over the internet to a computer file

A w weak organic acids: phenols, enols, oximes, imides, sulfonamides, thiophenols (all &gt;5C), b-diketones, nitro compounds with a-hydrogens B aliphatic amines (≥8C), anilines

The debt stabilising primary surplus in every year from 2015 onward is 3.7 percent in the optimistic scenario and 10.5 percent in the cautious scenario (top of the blue bar), while

Welcome to SAP BusinessObjects Business Intelligence Suite 4.1 SP3 SAP BusinessObjects Business Intelligence Platform Enhancements for SP3 SAP BusinessObjects Analysis, edition

“God in the form of pure, bright white light flowing through my entire body, mind and soul is purifying and healing apus, pridhvi, vayu, tejas, akash, my home, my DNA, and all

SAP, R/3, SAP NetWeaver, SAP NetWeaver Business Warehouse, SAP Industry Solutions and other SAP products and services mentioned herein as well as their respective logos are

This is deemed as being appropriate, as numerical standards for when establishing a new classification item are fulfilled, it is possible to clearly categorize this as an

Using repeated cross-sectional prevalence data for injection-related infections in IDUs in treatment in Italy from 1998 to 2006, we could define a hierarchy of struc- tured models