Show TOC Start of Content Area

Procedure documentation Developing Your First Voice Application  Locate the document in its SAP Library structure

Use

This tutorial walks you through the basic development steps for modeling a voice-enabled application, using a credit-check model as an example.

In this example, users can call to find out what their available credit limit is. The application asks the caller for an ID, retrieves the data from the back end, and provides the caller his or her available credit.

Prerequisites

      The development landscape is set up and configured.

      You are familiar with SAP Visual Composer.

Procedure

1. Create a New Model

...

       1.      Open Microsoft Internet Explorer.

       2.      Enter or choose the URL for Visual Composer and log on to Visual Composer.

       3.      Choose Model New.

The Create New Model dialog box appears.

       4.      In the Model Type list, select Voice Application.

       5.      In the Development component field, choose New.

The Create New Development Component dialog box appears.

       6.      In the Development component field, type credit_check, and choose OK.

The name you entered appears in the Development component field of the Create New Model dialog box.

       7.      In the Name field, type Credit_Check_Demo, and choose OK.

2. Model the Application

...

       1.      In the task-panel toolbar, choose Compose.

       2.      In the Model Component task panel, drag and drop the Start connector in the workspace.

Note

Every NetWeaver Voice application requires a Start connector.

       3.      In the Model Component task panel, drag and drop the Speak element in the workspace.

       4.      In the task-panel toolbar, choose Configure.

       5.      In the Name field type Welcome, then choose Settings.

       6.      Choose This graphic is explained in the accompanying text Add.

       7.      In the File Name and Text fields, type Welcome, then choose OK.

       8.      Choose This graphic is explained in the accompanying text Add.

       9.      In the Type field, select Break, then choose OK.

   10.      Connect the Start connector to the Speak element. (Click on the Start connector and hold the button while moving the mouse to the Speak element, then release the mouse button.)

   11.      In the Model Component task panel, drag and drop the Listen element in the workspace.

   12.      In the task-panel toolbar, choose Configure, and in the Name field, type Get_ID, then choose Settings.

   13.      On the Prompt tab page, maintain a Type Audio prompt with a File Name, say_ID and a Text, Please say or enter your ID.

   14.      Choose the Input tab.

   15.      In the Grammar Type field, choose Digits, then in the Maximum field, type 10.

   16.      In the Result Variable field, choose the ellipsis pushbutton.

   17.      Choose This graphic is explained in the accompanying text Add variable Record, then type Input_Values for the variable name.

   18.      Choose This graphic is explained in the accompanying text Add variable Number and type ID for the variable name.

   19.      Choose Select and in the Settings dialog box, choose OK.

3. Call the Appropriate Back End for Verification and Information

...

       1.      In the task-panel toolbar, choose Search.

       2.      In the Search in field, select the system that contains the item you want to use.

       3.      In the Search for field, type Z_RFC_CREDIT_CHECK, then choose Search.

Data matching the information you typed appears in the Results area of the Task Panel.

       4.      Locate the RFC that you want to use from the list and drag and drop the RFC in the workspace.

The Redefine Ports dialog box appears.

       5.      Choose OK.

       6.      Click the data service (RFC) with the secondary mouse button and choose In Mapping.

The Map Data screen appears.

       7.      Connect the Say_ID source to the Input target.

       8.      In the Assigned Value field, choose Define expression.

The Dynamic Expression Editorta screen appears.

       9.      Expand Data fields Say_ID and double-click ID.

   10.      Click the data service (RFC) with the secondary mouse button and choose Out Mapping.

The Map Data screen appears.

   11.      Click the Output source with the secondary mouse button and choose Copy&Map.

More information: Handling Data Services

   12.      In the task-panel toolbar, choose Compose.

   13.      In the Model Component task panel, drag and drop a Process element in the workspace.

   14.      In the task-panel toolbar, choose Configure.

   15.      In the Name field, type Set_RFC_Output, then choose Settings.

   16.      Choose This graphic is explained in the accompanying text Add.

   17.      In the Variable field, choose the ellipsis button.

   18.      Expand Data fields Output and double-click Credit_Limit, then choose OK.

   19.      In the Expression field, choose the dynamic expression pushbutton.

   20.      Expand Data fields Output and double-click Credit_Limit, then choose OK.

   21.      Choose This graphic is explained in the accompanying text Add and repeate steps 17 through 20 using Score.

   22.      Add a Speak element to tell the caller the Score retrieved from the back end.

The maintained data could include the Name Say Score and Goodbye, Type SpeakAs with the Value Score, Ending final, and Target prompts_speakas.

   23.      Add an End connector and choose Save.

   24.      From the task-panel toolbar, choose Deploy.

Note

Deployment is an administrative task associated with compiling and debugging. For more information on these topics, refer to Deploying and Debugging Your Voice Application.

The graphic representation of your credit-check model follows.

This graphic is explained in the accompanying text

4. Enhance the Credit-Check Model

To verify the caller's ID, you can add:

      Listen element (Confirm ID)

      Route element (with the Yesand No paths)

      Speak element (Sorry)

This added loop looks like this:

This graphic is explained in the accompanying text

Result

The application asks for two input variables:

      Category

      User ID

The application then returns:

      Status

      Score

      Credit limit

      Currency

      Validity date

For more information on developing voice-enabled applications, refer to Concepts and Tasks.

 

End of Content Area