How To Model And Design Enterprise Services In ESR710 - SAP

Transcription

How to model and designenterprise services in ESR710Applies to:NetWeaver ESR710, Any business suite components running on WebAS 6.40 and aboveSummaryThis tutorial will show you how to model and design enterprise service interfaces in SAP Enterprise ServicesRepository (ESR) 710.Author: Canyang (kevin) LiuCompany: National Competency Center, SAP AmericasCreated on: 12 December 2007Author BioKevin Liu is a principal enterprise architect with the National Competency Center of SAPAmericas. Kevin’s current focus is on SAP Enterprise Architecture Framework andEnterprise SOA, covering the whole life cycle of enterprise service modeling, design,development, and composition. Before NCC, Kevin was a NetWeaver technology architectwith SAP Labs Palo Alto since 2001 with a strong focus on industry standards for Webservices technologies. He represented SAP in various standard organizations includingW3C, WS-I, Rosettanet and helped the adoption of these standards in SAP NetWeaver.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com1

How to model and design enterprise services in ESR710Table of ContentsKeywords .3Target Audience .3Prerequisites.3System required for this exercise .3Overview of business case and SAP service modeling methodology.4Create a software component in System Landscape Directory(SLD) .6Start the Integration Builder .6Create software component in SLD .6Import software component to ESR.8Model the service interface in the ESR .9Create Business Objects, Service Interface, and Operations.10Define the service interface in the ESR.12Assign namespace to the service interface and operations .12Define attributes for the service operations .13Create Message types and data types .16Using SAP Global Data Type.19Activate all the changes .23Display the ESR definitions in the Enterprise Services Browser in SAP Backend.25Related Content.26Copyright.27SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com2

How to model and design enterprise services in ESR710KeywordsESR, Enterprise Services Repository, PI, Integration Builder, Enterprise services modeling, consumer model,provider model, enterprise service interface model, enterprise service interface definition, Global Data Type(GDT), service operation, message type, data type.Target AudienceTechnical consultants, Architects, Developers, IT Managers, business process experts and businessanalysts who already have exposure to SOA concepts, and would like to learn how to do services modelingand design with SAP ESRPrerequisites-Basic understanding of SOA concepts, especially the top-down approach and related consumerand provider model methodology for identifying and developing enterprise servicesWorking knowledge of SAP NetWeaver and Business SuiteSystem required for this exerciseTo complete this tutorial, you need access to an Enterprise Service Repository version 710. Currently, theESR is available to SAP customers and partner as part of SAP NetWeaver Process Integration (PI) 710 orComposition Environment (CE) 710 SR3.NOTE: Throughout this tutorial, the X8A system is used which is only accessible to SAP employee. If you areusing a different system to do the exercise, you need to use the appropriate hostname, port number toaccess the Integration Builder come with that system. Depends on the service pack levels of your system,some of the screens and task steps in your system may be slightly different from what’s shown in thistutorial, but the overall process and key activities should be similar if not same.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com3

How to model and design enterprise services in ESR710Overview of business case and SAP service modeling methodologyIn the example business case, a large retailer chain is experiencing slow sales of certain products. Themanagement team realizes that their price is not competitive, and would like to adjust their prices based onmarket condition. To achieve this goal, the following steps have to happen:- Select the product and competitors. A sales person who is familiar with the market conditionneeds to put together a list of products and the major competitors for each of the products.Collect and maintain competitor prices. Some body needs to go to competitor stores collect thedata and enter it into their system.Analyze the competitor data. A manager needs to look at the competitor pricing, and determinemore competitive while profitable prices for the stores.To come up with the best pricing, they need an application that can be rolled out to thousands of their storesto support store managers do analysis of their competitors pricing, and adjust their price accordingly. Afterchecking with IT, they realized that there is no application in place for such requirements yet, so they startout to build it up.Now they need to figure out what exactly need to happen to implement this process. In a SAP recommendedeSOA based top-down development approach, the development of a new application typically goes throughthe following phases: Business Requirement Build Consumer Model Build Provider Model Search Existing Services & funtions Identify Missing Services Model and design missing services Implement Missing Services Implement Composite ApplicationNOTE: The focus of this tutorial is modeling and defining service interfaces, so we will not go too deep on theoverall methodology (if interested, please contact the author for more information about related trainings), orthe composition process (I will write a separate paper to cover service composition for this example businesscase).Based on the requirement they have identified, the first step is to build a consumer model which is basically ahigh level break down of required functionalities to support each key steps of the process. The consumermodel only focuses on requirements, and is independent of any application that maybe used forimplementation. Once a consumer model is in place, the next step is to develop a so called “Provider model”where each of the functionality is mapped to a business application module. The module can be an ABAPfunctional module, an SAP pre-delivered enterprise services, a third party Web service, an in-houseapplication, or whatever system that can support such functional requirement. For SAP pre-deliveredenterprise services, SAP provides an online service catalog called Enterprise Services es ) where users can browser the enterprise services and finddetail information about what each of services can do, where they are deployed in SAP landscape, and howto use them.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com4

How to model and design enterprise services in ESR710In this tutorial we only focus on service interface modeling and design, so we assume the consumer modeland provider model is complete. As shown in the following diagram, the retailer has figured out that most ofthe required functions can be supported by services delivered from SAP. For example, the consumer model(left panel of the diagram) indicates that it needs to find relevant competitors for a product which needs priceadjustment. The provider model (the right panel) indicates that the enterprise service Find Business Partnerby Basic Data provides this function. This services is part of the process component “Business Partner DataManagement” which is implemented as part of mySAP ERP, so on the so forth. As a result of the consumerand provider model, they have identified that one piece of required function “Update Sales Price Information”is not supported by SAP or any other application yet (as shown by the fire icon in the diagram). It’s a gap thatneeds to be implemented as a Service.Now let’s move on to show you how this particular service can be modeled and designed in the SAPEnterprise Services Repository.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com5

How to model and design enterprise services in ESR710Create a software component in System Landscape Directory(SLD)Start the Integration BuilderEither from x8A, using transaction SXMB IFR, or directly from an IE t/index.jspPrerequisite: you need Java Web Start installed to use the Integration Builder, see the following page fordetail art installation.jspCreate software component in SLDSince this is a custom development, you would not want to mix it with SAP standard components, and needto define a software component and a namespace for your service.In a typical development scenario, a software component should have already been defined for you by yourproject lead before you start the service development. For our example, since we want to show the processfrom the scratch, we need to create the software component first.Logon to SLD from the integration builder home page, click on the “Products” link in the software catalogarea.You will be presented a few screens to enter the product and software component info. Follow the wizard tocreate the component and save the changes. Eventually, by search the component you just created, youshould see a screen like the below.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com6

How to model and design enterprise services in ESR710SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com7

How to model and design enterprise services in ESR710Import software component to ESRNow logon to the Integration Repository by clicking on the Link in the homepageTo import the software component from SLD to ESR, the procedure changed from PI70 to PI 710. In PI 70,the menu tools has an item for transfer SLD objects to the ESR. In PI710, use menu item Objects/New ,then follow the wizard as in the following screen.Click on the refresh button in the ESR Tree list to see the newly imported software componentAfter the software component is imported, use the same wizard to create a new namespace as a container ofyour new objects. (Models will be stored under the separate Modeling section)SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com8

How to model and design enterprise services in ESR710Model the service interface in the ESRIn the Design Objects tree, select the software component you would like to develop with. ChooseModeling/Models folder. Create a new folder if you would like, then right click on the folder and chooseNew to get to the following screen. To see all the relevant ARIS symbols for process component definition,choose model type “SAP ProComp Model”SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com9

How to model and design enterprise services in ESR710Create Business Objects, Service Interface, and OperationsOnce the ARIS modeling area appears, create a business object and a service interface simply by drag anddrop the corresponding symbols into the modeling pane.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com10

How to model and design enterprise services in ESR710Creating the operations is a bit tricky. Select the BO symbol first, then right click on the operation symbol,and choose the second option in the pop-up (operation is realized by BO) as in the below screenEnter a name for the new operation. Repeat the process until all intended operations are added.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com11

How to model and design enterprise services in ESR710Define the service interface in the ESRAssign namespace to the service interface and operationsOnce the model is completed, now we need to assign a namespace to the new constructs.Right click on the service interface or operation, choose create assignment.After save, it returns to the modeling pane, and there should be a small circle appear to the lower-left cornerof the service interface symbol. Double click on it to create the Interface object under the selectednamespace.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com12

How to model and design enterprise services in ESR710Define attributes for the service operationsWhen prompted to create a new object for the selected interface, proceed with yes. It creates a defaultoperation with the same name as the interface as shown below. Save it so we can add more operationslater.Now repeat the process for the new operations. Change the attributes for each operation as appropriate(stateless, synchronous, etc)Since we will add our own interface, the default interface will not be needed and we will delete it. Save thechanges.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com13

How to model and design enterprise services in ESR710The final results of the interface model should be something like the followingSAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com14

How to model and design enterprise services in ESR710The final results of the interface definition should be something like the followingSAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com15

How to model and design enterprise services in ESR710Create Message types and data typesThe operations created so far do not have any message types assigned to them yet. To start, enter thenames for the request, response and fault messages following the appropriate naming convention, andassign them to the right name space.To actually define a message type, right click on a message, and select new. It brings up the message typedefinition page. Enter a name for the data type used by the message type as shown in the following screen.The typical naming convention is to add a prefix sync or async to the end of the message name.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com16

How to model and design enterprise services in ESR710Now right click on the value of the “data type used” field, and choose “New” from the pop-up menu. It bringsup the Data type definition page.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com17

How to model and design enterprise services in ESR710SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com18

How to model and design enterprise services in ESR710Using SAP Global Data TypeWe would like to use a few global data types in our data type definition for the request and responsemessages of our UpdateSalesPriceInformation operation.In particular, we need a business partner ID, aproduct ID, and a Price for the request, and a system status code for the response.SAP GDTs are defined in the SAPGlobal software component under the namespacehttp://sap.com/xi/SAPGlobal/GDT as shown below.Find the GDTs you need, right click on it and choose copy object to get the following pop-up window.Specify the target component and namespace as shown below, then click on “Copy”. If asked to overwrite anexisting data type, say Overwrite. It may show a process log window, just close it and wait for the GDTs to becopied.Trick: Specify the Software Component Version before the Namespace.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com19

How to model and design enterprise services in ESR710A new page will be opened for each copied data type. Save and close these windows. Now we have all theGDTs in our own namespace ready for our use. Go back to the data type definition screen, and use theGDTs to define our data types.You may need to play with the tool a bit to get yourself familiar with the use of the different icons. Overall it’sstraight forward. After you are done, the data type for the request message should be something likeSAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com20

How to model and design enterprise services in ESR710Go to the message definition page, and save the change now. It should pick up the data type definition andlooks as belowRepeat the same process for the Response message. The response message should be something likeSAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com21

How to model and design enterprise services in ESR710Now for the Fault message. Just use the default standard fault data type.Now save everything, if not yet.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com22

How to model and design enterprise services in ESR710Activate all the changesHave a look at the list of our design objects now, you will notice that many of them has a red check besidethem. The red checks indicate that these objects are not activated yet.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx.sap.com23

How to model and design enterprise services in ESR710Switch to the Change Lists tab, select your change list, right click and choose “activate ”In the pop-up, select all the objects you would like to activate, and click the “Activate” button to complete theactivation process.Now we have completed the modeling and definition of the ManageSalesPriceInformation enterprise serviceinterface.SAP DEVELOPER NETWORK sdn.sap.com 2008 SAP AGBUSINESS PROCESS EXPERT COMMUNITY bpx

functional module, an SAP pre-delivered enterprise services, a third party Web service, an in-house application, or whatever system that can support such functional requirement. For SAP pre-delivered enterprise services, SAP provides an on