CE155 Excercises

Embed Size (px)

Citation preview

  • 7/29/2019 CE155 Excercises

    1/65

    SAP TECHED 07

    VOICE-ENABLED APPLICATIONS ;COMPOSITES FOR THE PHONECE155

    Exercises / Solutions

    WILL GARDELLA,SAPLABS,LLC.

    THOMAS JUNG,SAPLABS,LLC.

  • 7/29/2019 CE155 Excercises

    2/65

    SAP TECHED 07 1

    VOICE-ENABLED APPLICATIONS ;COMPOSITES FOR THE PHONE

    Before You Start

    There are several prerequisite steps that we must complete before work can start on the main exercise. These steps must be completed

    otherwise you will receive errors later during the exercise.

    1. Install a VoiceXML Gateway2. Setup the Guest Account on your CE Server3. Logon to the ABAP Backend System4. Setup the RFC Destination for the ABAP Backend System

  • 7/29/2019 CE155 Excercises

    3/65

    SAP TECHED 07 2

    Install a Voice XML Gateway

    If you remember from the lecture, SAP NetWeaver Voice itself does not come with a VoiceXML gateway. It works with manyexisting VoiceXML gateways already on the market.

    SAP AG2007, SAP TechEd 07 / CE155 / 13

    High Level SAP NetWeaver Voice Architecture

    SAP NetWeaver

    Application

    Server J2EE

    Engine

    3rd party

    VoiceXML

    Gateway

    SpeechRecognition

    Text-To-Speech

    Touchtone

    Telephony

    Design Time

    VoiceXML

    HTTP

    VoiceXML

    Interpreter

    Run Time

    My SAPBusiness Suite

    Applications /

    Services

    PSTN

    VOIP

    ESS

    CRM

    SRM

    SCM

    SAP

    Visual Composer

    Voice Dialog

    Runtime

    Etc.

    Voice Data

    Runtime BAPI,eSOA,

    etc.

    SAP NetWeaver

    BI 7.0.3

    (optional)

    For the purposes of todays exercises, we will be installing a 3rd party VoiceXML Gateway. SAP does not endorse one VoiceXML

    gateway vendor over another. The selection of Voxeos Prophecy for todays exercise was only based upon the fact that the productis designed for use on desktops/laptops and comes with a free evaluation period.

    1. Go to the installation directory that was supplied by your instructor.Installation Directory: __________________________________________________________________________

  • 7/29/2019 CE155 Excercises

    4/65

    SAP TECHED 07 3

    2. Double click on the installation package (prophecy-326-small-tts.msi)

  • 7/29/2019 CE155 Excercises

    5/65

    SAP TECHED 07 4

    3. Acknowledge the Security Warning and choose Run to begin the installation

    4. Follow the installation steps, choosing the default parameters.

  • 7/29/2019 CE155 Excercises

    6/65

  • 7/29/2019 CE155 Excercises

    7/65

    SAP TECHED 07 6

    8. You can then choose Administration to launch the VoiceXML Server Console. You can also access this directly from theURL: http://localhost:9995/mc.php. The username is admin. The password is admin.

    9. Later we will return to the Prophecy Console and the Call Routing option to configure our newly created application.

  • 7/29/2019 CE155 Excercises

    8/65

    SAP TECHED 07 7

  • 7/29/2019 CE155 Excercises

    9/65

    SAP TECHED 07 8

    Setup the Guest Account on your CE Server (local Laptop)

    In the exercise we will create voice recordings within the SAP NetWeaver Voice application which are stored on the local file systemof the CE Server (your local laptop). The Backend ABAP system will need access to these files. Because the backend ABAP systemand your laptops are installed into different Windows Domains, we must activate the Guest Account on your local machine.

    1. From the Start menu, choose Control Panel -> Administrative Tools -> Computer Management

  • 7/29/2019 CE155 Excercises

    10/65

    SAP TECHED 07 9

    2. From the Computer Management Console, open the System Tools->Local Users and Groups->Users Folders. Then rightmouse click on the Guest Account and choose Properties.

  • 7/29/2019 CE155 Excercises

    11/65

    SAP TECHED 07 10

    3. Uncheck the Account is disabled option.

  • 7/29/2019 CE155 Excercises

    12/65

    SAP TECHED 07 11

  • 7/29/2019 CE155 Excercises

    13/65

    SAP TECHED 07 12

    Logon to the ABAP Backend System

    For this exercise we will interact with an ABAP Backend System in order to consume services and store data. In order to prepare forthese steps, we will first login to this system.

    1. From the SAPLogon application, choose system M24.

    2. Using the credentials supplied by your Instructor, please login to this system. You will be asked to change your password.Please record the password as you will need it later.ABAP User Name: _________________Initial Password: _____________New Password: ______________

  • 7/29/2019 CE155 Excercises

    14/65

    SAP TECHED 07 13

    3. Choose System->User Profile->Own Data from the MainMenu.

  • 7/29/2019 CE155 Excercises

    15/65

    SAP TECHED 07 14

    4. From this screen you can view the details of your User Profile. The main piece of data that we will need later is your PhoneExtension. Note it for later use. It should be 10XX, where XX is your Group Number.

    Extension Number: _________

  • 7/29/2019 CE155 Excercises

    16/65

    SAP TECHED 07 15

  • 7/29/2019 CE155 Excercises

    17/65

    SAP TECHED 07 16

    Setup the RFC Destination for the ABAP Backend System

    On the CE system that you are using (your local laptop), an RFC Destination was already created for you. It is useful, however, toknow how and where to setup this configuration. In this step we will change the destination configuration to run under your sessionABAP Userid and password (the information you recorded in step 2 of Logon to the ABAP Backend System).

    1. Go the homepage of your local CE Java Application Server (http://localhost:50100/index.html)2. Choose SAP NetWeaver Administrator.

  • 7/29/2019 CE155 Excercises

    18/65

    SAP TECHED 07 17

    3. From the SAP NetWeaver Administrator Console, choose Configuration Management, then Destinations.

    4. From the Show option above the Destination List, change the setting so that only RFC based destinations are displayed.

  • 7/29/2019 CE155 Excercises

    19/65

    SAP TECHED 07 18

    5. Select M24 from the Destination List and then click the Edit Button.

  • 7/29/2019 CE155 Excercises

    20/65

    SAP TECHED 07 19

    6. The Connection and Transport information for M24 is displayed. All of this information is already correct. We only need tomaintain the Logon Data.

  • 7/29/2019 CE155 Excercises

    21/65

    SAP TECHED 07 20

    7. Replace the current User Name and Password with the information from step 2 of Logon to the ABAP Backend System.Then hit Save.

  • 7/29/2019 CE155 Excercises

    22/65

    SAP TECHED 07 21

    8. After Saving, press the Ping Destination button to test the connection. You should receive a success message.

  • 7/29/2019 CE155 Excercises

    23/65

    SAP TECHED 07 22

    Exercise 1

    At the end of this exercise you will be able to:

    Create a SAP NetWeaver Voice Application that consumes backend services.

    We are going to design and build a simple voice mail application. The application will need functionality for a caller to select thephone extensions that they want to leave a voice mail for. Then it will allow them to record their message.

    Procedure

    1. Launch Visual Composer.2. Create a new SAP NetWeaver Voice Application3. Have a general greeting at the beginning of the application.4. Query the user for the Phone Extension they wish to leave a message for.5. Call a service (Z_RFC_VM_LOOKUP_BY_EXTENSION) in the backend ABAP system to validate the extension and

    retrieve the details associated with the extension.6. If there is an error in the extension service call loop back so that the user can correct their mistake. Otherwise output the

    details about the voice mail box that were retrieved in the service call.7. Record the Voice Mail and store the associated variables (filename, service IP) into the dataStore for later use.8. Call another backend ABAP service (Z_RFC_VM_CREATE_NEW) to create a new Voice Mail record and to store the

    Voice Mail recording.9. Check for any errors from this create_new service and report them to the user. End the application.

  • 7/29/2019 CE155 Excercises

    24/65

    SAP TECHED 07 23

    10.Solution for Exercise 1

    1. Launch the Visual Composer.a. From the browser use the following address (http://localhost:50100/VC/default.jsp)

    2. Create a new SAP NetWeaver Voice Application

  • 7/29/2019 CE155 Excercises

    25/65

    SAP TECHED 07 24

    a. Choose Model->New from the Visual Composer Main Menu

    b. This will display the Create New Model Dialog. Choose Voice Application from the Model Type.

  • 7/29/2019 CE155 Excercises

    26/65

    SAP TECHED 07 25

    c. Create a new Development component by clicking the New button.

    d. Enter the Name for your New Development Component (voicemail) and click OK.

  • 7/29/2019 CE155 Excercises

    27/65

    SAP TECHED 07 26

    e. Now type the name of your Voice Application (leaveVoiceMail) and click OK.

  • 7/29/2019 CE155 Excercises

    28/65

    SAP TECHED 07 27

    f. You should now have your newly created application open in an empty canvas.

    3. Have a general greeting at the beginning of the application.

  • 7/29/2019 CE155 Excercises

    29/65

    SAP TECHED 07 28

    a. Drag and Drop a Start Point Connector onto your Canvas. All applications must have one and only one start point.

  • 7/29/2019 CE155 Excercises

    30/65

  • 7/29/2019 CE155 Excercises

    31/65

    SAP TECHED 07 30

    c. If you double click on your new Speak element the Configuration screen will appear on the left. Use this screen tochange the name of your element from Speak1 to Welcome.

    d. To control the settings for any element you can press the Settings button from the Configuration dialog (as seen inthe image above) or right mouse click on the element in the canvas and choose Settings from the context menu. Theelement Settings dialogs are where we will do the major of the work for creating our Voice applications.

  • 7/29/2019 CE155 Excercises

    32/65

    SAP TECHED 07 31

    e. Create One Speak Item entry for our Welcome element with the following settings.

    Welcome

    Type Audio

    File Name Welcome

    Text Welcome to the Voice Mail System

    Target Prompts

    Condition

    Description

    Barge-in Default

    4. Query the user for the Phone Extension they wish to leave a message for.

  • 7/29/2019 CE155 Excercises

    33/65

    SAP TECHED 07 32

    a. Add a Listen element to the Canvas directly after your Welcome element. Name it Input Extension.

    b. Create one Listen Prompt Entry with the following settings.

    Input Extension

    Type Audio

    File Name extension

    TextPlease input the extension of the person you

    would like to leave a voice mail for

  • 7/29/2019 CE155 Excercises

    34/65

    SAP TECHED 07 33

    Target Prompts

    Condition

    Description

    Barge-in Default

    c. Go to the Input tab to map the input from the listen element to a variable in the dataStore. You can press on the button after the Result Variable input field to choose an existing variable from the dataStore or create a new

    variable.

  • 7/29/2019 CE155 Excercises

    35/65

    SAP TECHED 07 34

    d. In the Variable Manager dialog that pops up after pressing the button, you can add new records, tables andvariables to the data store by pressing on the + icon.

  • 7/29/2019 CE155 Excercises

    36/65

    SAP TECHED 07 35

    e. Add a new record called Input and then a new Number variable within this record called Extension.

    f. Highlight this new variable (Extension) and press the Select button. The variable name will be returned to theResult Variable input field.

    5. Call a service (Z_RFC_VM_LOOKUP_BY_EXTENSION) in the backend ABAP system to validate the extension andretrieve the details associated with the extension.

    a. Click the Search button the far right of the screen to open the Service Search window.

  • 7/29/2019 CE155 Excercises

    37/65

    SAP TECHED 07 36

    b. Input the following Search criteria. Search in M24 (R3). Search For Z*. Search Type Bapi/RFC. Hit the searchbutton and the resulting matches will be displayed below.

  • 7/29/2019 CE155 Excercises

    38/65

    SAP TECHED 07 37

    c. Drag and drop Z_RFC_LOOKUP_BY_EXTENSION onto the canvas and then connect it to the output from theInput Extension Listen element.

    d. Now we must do the input and output mappings for the service. Right mouse click on the service and start bychoosing In Mapping

  • 7/29/2019 CE155 Excercises

    39/65

    SAP TECHED 07 38

    e. Drag and drop the Input record from the dataStore onto the Input parameter of the Service. This will create abinding.

  • 7/29/2019 CE155 Excercises

    40/65

    SAP TECHED 07 39

    f. Click the Fx dropdown selector at the end of the Assigned Value field for the input parameter I_EXTENSION. Thiswill bring up the Dynamic Expression Editor. From the Editor choose the Extension Data Field from our dataStoreto create the parameter level mapping.

  • 7/29/2019 CE155 Excercises

    41/65

    SAP TECHED 07 40

    g. Now for the output mapping of the parameter call, we dont have any existing structure in our dataStore to match upto yet. Therefore we can right mouse click each service call parameter and choose the Create in Target Dataset andMap Automatically option.

  • 7/29/2019 CE155 Excercises

    42/65

    SAP TECHED 07 41

    h. Repeat this process for both the E_USER_LIST and Output parameters so that you will have dataStore variables forall the output for the service.

    6. If there is an error in the extension service call, loop back so that the user can correct their mistake. Otherwise output thedetails about the voice mail box that were retrieved in the service call.

    a. We will use a Route element to decide the branching logic of a good or bad service call.

  • 7/29/2019 CE155 Excercises

    43/65

    SAP TECHED 07 42

    b. The configuration of the Route element allows us to create multiple paths the conditions that will trigger thesepaths. We want to create two paths in this example: No Matches and Matches.

    Route1 No Matches Path

    Path No Matches

    Expression [email protected]_NUMBER_OF_HITS

  • 7/29/2019 CE155 Excercises

    44/65

    SAP TECHED 07 43

  • 7/29/2019 CE155 Excercises

    45/65

    SAP TECHED 07 44

    Route1 Match Path

    Path Match

    Expression DEFAULT

    Default Checked

    Description

    Target

    c. Now when you right mouse click on the lines the flow out of the output port of the Route element you can choosewhich path to assign to the line thereby creating flow logic for your application.

  • 7/29/2019 CE155 Excercises

    46/65

    SAP TECHED 07 45

    d. Lets build the Match path first. Add a speak element after the Route1 element and connect it using the Match path.Name this new speak element MailBox.

    For this element we will configure three separate speak items so that we can bring in dynamic elements from ourservice call.

    MailBox Speak Item #1

    TypeAudio

  • 7/29/2019 CE155 Excercises

    47/65

    SAP TECHED 07 46

    File Name MailBox

    Text You have reached the Voice Mail Box for

    Target Prompts

    Condition

    Description

    Barge-in Default

    MailBox Speak Item #2

    Type Text

    Text =@E_USER_LIST.FULLNAME

    Condition

    Description

    Barge-in Default

    MailBox Speak Item #3

    Type Audio

    File Name Beep

    Text Please leave a message after the Beep.

    Target Prompts

    Condition

    Description

    Barge-in Default

  • 7/29/2019 CE155 Excercises

    48/65

    SAP TECHED 07 47

    e. Now for the No Matches path. If there were no matches, then we need another Speak element to let the user knowthere was a problem with their extension lookup. The difference here is that the output port of this speak elementwill be connected back to the Input port of the Input Extension element creating a logic loop back to the beginning

    of the application so the user can try again.

    The NoMatches speak element has just one Speak Item with the following settings:

    NoMatches Speak Item #1

  • 7/29/2019 CE155 Excercises

    49/65

    SAP TECHED 07 48

    Type Audio

    File Name NoMatches

    Text Sorry. There were no matches for that

    extension. Please try again.

    Target Prompts

    Condition

    Description

    Barge-in Default

    7. Record the Voice Mail and store the associated variables (filename, service IP) into the dataStore for later use.a. Connected off the successful MailBox route of our application we flow directly into the Record element.

  • 7/29/2019 CE155 Excercises

    50/65

    SAP TECHED 07 49

    b. The Recording element should have the following settings. Notice that you must create a new String variable in thedataStore to keep the recording filename (this is the Variable field in the settings).

    c. There are a few pieces of data and environment variables that we are going to need in order to record the voice mailin the backend system. Before we make a our service call, we want to move all this data to one area in thedataStore. There is another Voice Kit element, called Process, which allows you perform such manipulation andstore of elements. Add a Process element after the output of the Recording element.

  • 7/29/2019 CE155 Excercises

    51/65

    SAP TECHED 07 50

    d. With the Process element, we will have twoOperations.

    Process1 Operation #1

    Action Set Variable

    Condition

    Description

    Variable Input.Username

    Expression =@E_USER_LIST.USERNAME

    Process1 Operation #2

    Action Set Variable

    Condition

    Description

    Variable Input.Hostname

    Expression =@_ENV.DialogEngineHostIP

  • 7/29/2019 CE155 Excercises

    52/65

    SAP TECHED 07 51

    8. Call another backend ABAP service (Z_RFC_VM_CREATE_NEW) to create a new Voice Mail record and to store theVoice Mail recording.a. Just like you did back in Step 5, search for the service Z_RFC_VM_CREATE_NEW and place it after the Process1

    element.

    b. Also like earlier, you must now map the input and outputs from the Service call.c. Input Mapping:

  • 7/29/2019 CE155 Excercises

    53/65

    SAP TECHED 07 52

    d. For the output we cant use the automatic mapping because both of our services had a parameter named Output.Therefore we will have to define a structure in our dataStore manually and then perform the mapping for the oneoutput parameter:

    9. Check for any errors from this create_new service and report them to the user. End the application.a. Just like after our first service call, we will once again use a Route element to determine the processing status of the

    service call and respond accordingly.

  • 7/29/2019 CE155 Excercises

    54/65

    SAP TECHED 07 53

    b. The Route element will have two paths:

    Route Error

    Path Error

    Expression Default

    Default Checked

    Target

    Process1 Operation #2Path Good Recording

    Expression =@Recording_Output.Status==

    Default

    Target

  • 7/29/2019 CE155 Excercises

    55/65

    SAP TECHED 07 54

    c. Add two simple Speak elements off of each path.

    d. The settings for the Error Speak:

    Error

    Type Audio

    File Name Error

  • 7/29/2019 CE155 Excercises

    56/65

    SAP TECHED 07 55

    Text

    There was a problem saving your voicemail.

    We apologize for the inconvenience. Please

    hang up and try again.

    Target Prompts

    Condition

    Description

    Barge-in Default

    e. The settings for the Good Speak:

    Good Speak Item #1

    Type Audio

    File Name Good

    Text Your voice mail message for

    Target Prompts

  • 7/29/2019 CE155 Excercises

    57/65

  • 7/29/2019 CE155 Excercises

    58/65

    SAP TECHED 07 57

    f. Regardless of the path, both speak elements should connect up to an End Point.

    g. Although you have been saving periodically throughout the development process, you should save your completedmodel one last time.

  • 7/29/2019 CE155 Excercises

    59/65

  • 7/29/2019 CE155 Excercises

    60/65

    SAP TECHED 07 59

  • 7/29/2019 CE155 Excercises

    61/65

    SAP TECHED 07 60

    Exercise 2 - Solutions

    Procedure

    1. Continuing with the application you just built in the previous exercise, deploy the application.a. Click on the Deploy button on the far right of the screen. This brings up the Deploy tool. Now click on the Deploy

    button within the tool.

    b. After a few seconds, you should receive an acknowledgement that the deployment was successful. You can thenclick on the hyperlinked item under Applications to see the URL for the new application.

  • 7/29/2019 CE155 Excercises

    62/65

    SAP TECHED 07 61

    c. You will need this URL in a few moments when we configure the VoiceXML gateway, so either write it down orcopy it to your clipboard for easy retrieval.

    2. Return to the Voxeo Prophecy (VoiceXML Gateway) console and configure the default URL to be the URL for theapplication you just created.

    a. As we did earlier in the setup of the VoiceXML gateway, launch the Voxeo Prophecy admin console(http://localhost:9995/mc.php). Remember the username and password were both admin.

    b. From the console menu choose Call Routing. Enter the URL of your application as the Default URL and make surethe Default Type is set to VXML.

  • 7/29/2019 CE155 Excercises

    63/65

    SAP TECHED 07 62

    c. Scroll down to the end of the page in order to save your changes.

    3. Using the Voxeo Software, call your application and test it. Try using a completely incorrect extension number (9987) andthen use your correct extension and leave yourself a voice mail.

    a. Launch the softphone from the Voxeo system tray icon.

  • 7/29/2019 CE155 Excercises

    64/65

    SAP TECHED 07 63

    b. Press the dial button on the softphone to initiate a call. From there the application should function just like a regularphone.

    4. To demonstrate that the application functions correctly and stores the voice mail in the backend system, launch the followingapplication to view and playback your recorded voice mail(http://m24tdc00.wdf.sap.corp:51080/sap/bc/webdynpro/sap/zvoice_mail).

  • 7/29/2019 CE155 Excercises

    65/65

    SAP TECHED 07 64

    Copyright 2007 SAP AG. All Rights Reserved

    No part of this publication may be reproduced or transmitted in any form or for any purpose without the expresspermission 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 othersoftware vendors.

    Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries,

    pSeries, xSeries, zSeries, System i, System i5, System p, System p5, System x, System z, System z9, z/OS, AFP,

    Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, POWER5+, OpenPower andPowerPC are trademarks or registered trademarks of IBM Corporation.

    Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of AdobeSystems 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.

    MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, 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 severalother countries all over the world. 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 mayvary.

    The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, ortransmitted in any form or for any purpose without the express prior written permission of SAP AG.

    This document is a preliminary version and not subject to your license agreement or any other agreement with SAP.This document contains only intended strategies, developments, and functionalities of the SAP product and is not

    intended to be binding upon SAP to any particular course of business, product strategy, and/or development. Please notethat this document is subject to change and may be changed by SAP at any time without notice.

    SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy orscompleteness of the information, text, graphics, links, or other items contained within this material. This document isprovided 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.

    SAP shall have no liability for damages of any kind including without limitation direct special indirect or