Exercise 1: Adding business logic to your application

Similar documents
What s New / Release Notes SAP Strategy Management 10.1

Install TREX for CAF Version 1.00 March 2006

configure an anonymous access to KM

How to Set Up and Use the SAP OEE Custom UI Feature

SAP Composite Application Framework. Creating a Content Package Object

How To Configure the Websocket Integration with SAP PCo in SAP MII Self Service Composition Environment Tool

MDM Syndicator Create Flat Syndication File

How to Set Up and Use the SAP OEE Custom KPI Andons Feature

Do Exception Broadcasting

How To Extend User Details

Visual Composer - Task Management Application

Installation Guide Business Explorer

Integrate a Forum into a Collaboration Room

How to Create a New SAPUI5 Development Component

Create Partitions in SSAS of BPC Version 1.00 Feb 2009

How To Develop a Simple Web Service Application Using SAP NetWeaver Developer Studio & SAP XI 3.0

How to Upgr a d e We b Dynpro Them e s from SP S 9 to SP S 1 0

link SAP BPC Excel from an enterprise portal Version th of March 2009

Cache Settings in Web Page Composer

A Step-By-Step Guide on File to File Scenario Using Xslt Mapping

Data Validation in Visual Composer for SAP NetWeaver Composition Environment

How to View Dashboards in the Self Service Composition Environment with Additional Metadata

How to Use Function Keys in Mobile Applications for Handhelds

SAP NetWeaver How-To Guide

R e l ea se 6. 20/

SAP Composite Application Framework. Creating an External Service type Callable Object in Guided Procedures

Web Page Composer anonymous user access

How To Configure IDoc Adapters

SAP GRC Access Control: Configuring compliant user provisioning (formerly Virsa Access Enforcer) into CUA Systems

Authentication of a WS Client Using a SAP Logon Ticket

Extract Archived data from R3

How To Recover Login Module Stack when login to NWA or Visual Administrator is impossible

How To Set up NWDI for Creating Handheld Applications in SAP NetWeaver Mobile 7.1

Configure SSO in an SAP NetWeaver 2004s Dual Stack

Consuming Web Dynpro components in Visual Composer.

The test has been performed using a 64 Bit SAP NetWeaver Application Server Java 7.1 Enhancement Package 1 SP4 or greater system.

How To... Reuse Business Objects and Override Operations of a Business Object

Using Business Graphics

Integrating a Web Service in a Composite Application. SAP Composite Application Framework

Best Practices Using KMC Capabilities in an External Facing Portal Version 1.00 October 2006

Configure TREX 6.1 for Efficient Indexing. Document Version 1.00 January Applicable Releases: SAP NetWeaver 04

Transport in GP. How-to Guide Beginning with SAP NetWeaver 2004s SPS06. Version 2.00 January 2006

SAP Composite Application Framework. Creating a Callable Object in Group: Miscellaneous

Sizing for Guided Procedures, SAP NetWeaver 7.0

How To Troubleshoot SSL with BPC Version 1.01 May 2009

Quick Reference Guide SAP GRC Access Control Compliant User Provisioning (formerly Virsa Access Enforcer): HR Triggers

How To...Use a Debugging Script to Easily Create a Test Environment for a SQL-Script Planning Function in PAK

Work with Variables in SAP NetWeaver Visual Composer Version 1.00 May 2006

Enterprise Portal Logon Page Branding

How to Translate a Visual Composer Model Part I

Setup an NWDI Track for Composition Environment Developments

SAP NetWeaver Identity Management Identity Center. Tutorial. Version 7.0 Rev 2. - Basic synchronization

Web Dynpro for ABAP: Tutorial 4 - Display Bookings of Selected Flight

How to Install SAP Netweaver 2004s ABAP Edition on Your Local PC

How-To... Add Sensitive Content into an Area

Visual Composer Build Process

SAP NetWeaver Identity Management Identity Center Minimum System Requirements

Use Business Objects Planning and Consolidation (version for the Microsoft platform) BPF services in Xcelsius

How To... Configure Integrated Configurations in the Advanced Adapter Engine

Configure UD Connect on the J2EE Server for JDBC Access to External Databases

How To...Configure Integration of CUP with SPM

Create Monitor Entries from a Transformation routine

WDA - Custom themes for Web Dynpro ABAP applications without SAP Enterprise Portal integration

Modify the Portal Framework Page in SAP EP 6.0

How To... Master Data Governance for Material: BADI USMD_SSW_SYSTEM_METHOD_CALLER to create successor change request

How To... Promote Reports and Input Schedules Through Your System Landscape

How To... Master Data Governance for Material: BADI USMD_SSW_PARA_RESULT_HANDLER to merge result of parallel workflow tasks

SAP NetWeaver Identity Management Virtual Directory Server. Tutorial. Version 7.0 Rev 4. - Accessing LDAP servers

Visual Composer for NetWeaver CE: Getting Started with a Typical Workflow

Duplicate Check and Fuzzy Search for Accounts and Contacts. Configuration with SAP NetWeaver Search and Classification (TREX) in SAP CRM WebClient UI

Create Monitor Entries from an update routine

Building a Composite Business Process from Scratch with SAP NetWeaver BPM Guide 2

SAP NetWeaver How-To Guide

Tutorial: Consuming Web Services in Web Dynpro Java

Process Control 2.5 Implementation Checklist

Building a Tax Calculation Application

View Time Security for crystalreports.com

SAP Enterprise Portal 6.0 -Sample Screenshots- 31/03/2003

Handle. How-to Guide SAP NetWeaver 2004s. Version 1.00 Sept 2006

Single Sign-on For SAP NetWeaver Mobile PDA Client

Introducing SAP Enterprise Services Explorer for Microsoft.NET

Duet Enterprise: Tracing Reports in SAP, SCL, and SharePoint

How To Use Surveys with Mobile Sales for handheld Version 1.00 January 2007

Simplified Configuration of Single System Update in Maintenance Optimizer

How to receive and convert PDF-documents with SAP XI

How to Create New Portal Display Rules

SAP NetWeaver Identity Management Virtual Directory Server. Tutorial. Version 7.0 Rev 4. - Joining data sources

MODULE 2: CREATE A DECISION TABLE USING RULES COMPOSER (BRM)

How To Generate XSD Schemas from Existing MDM Repositories

BC100. Introduction to Programming with ABAP COURSE OUTLINE. Course Version: 15 Course Duration: 2 Day(s)

Web Dynpro for ABAP: Tutorial 5 Component and Application Configuration

BIT460. SAP Process Integration Message Mapping COURSE OUTLINE. Course Version: 15 Course Duration: 3 Day(s)

SDN Contribution HOW TO CONFIGURE XMII BUILD 63 AND IIS 6.0 FOR HTTPS

SAP BusinessObjects Predictive Analysis 1.0 Supported Platforms

Preview of Web Services Reliable Messaging in SAP NetWeaver Process Integration 7.1

Visual Composer for SAP NetWeaver Composition Environment - Connectors

How to Browse an Enterprise Services Registry in Visual Composer

and Adapt ERP Roles and Their Content to SAP Enterprise Portal

How to Work with Analytical Portal

Monitoring System Landscapes Using the DBA Cockpit

Transcription:

Exercise 1: Adding business logic to your application At the conclusion of this exercise, you will be able to: - Enhance a Business Object with a new Property - Implement an Event Handler for a Business Object - Enhance a Tile with a new Controller Scenario: You want to show the total amount of orders for a customer on the Customer Detail Tile within the Tile Set Customer Orders. Prerequisites You have installed SAP CRM Mobile Sales 4.0 SP06, including the SAP Mobile Application Studio (MAS). You have installed the training repository (demo_arsdb40) for the SAP MAS 4.0 and created an ODBC source for it. You have reserved the namespace Y_ for this training repository. You have created BOL and UI projects for the training application (DEMBOL and DEM) and have generated the application runtime files from the training repository. Tasks To realize this scenario you have to carry out the following steps: 1) Add a new property to the customer Business Object. This property is used to store the total amount of orders for a customer. 2) Implement the functionality to evaluate the total amount of orders and store the value in the new property defined in 1). 3) Add a new controller to the customer detail Tile to show the total amount of orders. This new controller has to be bound to the new property defined in 1) in order to show the correct data. The result should look like this:

Before After Hints - The customer Business Object is CBusinessPartner. - The customer detail Tile where the new information shall be shown is bpdetail. - The new BO property has to be of a numeric data type and doesn t need to be bound to a segment field of a BDoc. - To evaluate the total amount of orders for a customer you can use an already existing relationship modelled for the customer Business Object. - The new BO property has to be updated whenever a new customer object is loaded. Begin the exercise now.

Exercise 1 - Solution 1. Start the SAP Mobile Application Studio and create a new change list for your enhancements/modifcations To start the SAP Mobile Application Studio, choose Start Programs SAP CRM Mobile SAP Mobile Application Studio. To log on, make the following entries: - DSN: demo_arsdb40 - Login: ARSAdmin - Password: (no password) Create a new change list called Y_Training. 2. Create a new property Y_TotalOrders for Business Object CBusinessPartner In the Object Browser (Hierarchy tab) navigate to Business Library Business Objects CBusinessPartner Properties. Right-click on the Properties-folder and choose New. Enter the necessary attributes (see the following screenshot for details): Save the new property Y_TotalOrders. 3. Implement the Event Handler Loaded for Business Object CBusinessPartner In the Object Browser (Hierarchy tab) navigate to Business Library Business Objects CBusinessPartner Event Handlers. Right-click on the Event Handlers-folder and choose New. Select the Event Loaded from the list of possible events. Enter Y_Loaded as name of the Event Handler. Enter the following line of code for the Event Handler: Y_TotalOrders = ThisBO.Orders.count Save the new Event Handler Y_Loaded.

4. Drag and drop the new property Y_TotalOrders onto the Tile bpdetail In the Object Browser (Hierarchy tab) navigate to Tiles Detail Tiles bpdetail. Right-click on Tile bpdetail and choose Edit. A popup window asks for the creation of a new branch, because you are modifying an SAP object. Enter Y_Training as branch name. (Remark: the branch name is independent of the change list name and doesn t necessarily need to be the same). In the Object Browser (Hierarchy tab) navigate to Business Library Business Objects CBusinessPartner Properties Y_TotalOrders. Drag and drop the property Y_TotalOrders onto the Tile bpdetail. Arrange the newly created controller Y_ctrlTotalOrders nicely with the other already existing controllers on the Tile. The properties of the new controller Y_ctrlTotalOrders should be set like follows: Save the modified Tile bpdetail.

5. Generate your changes Via the menu Build Generation Settings check the generation settings for your BOL and UI project. The settings should look like follows: Via the menu View Generation List, select all change list objects for generation (should be the default). Via the menu Build Generate, generate the new runtime files. 6. Start the application To start the application, run the MobileClient.exe in C:\Program Files\SAP\Mobile\bin\ and choose MSA (DEM). Login: crmuser Password: crm NOTE: the application could also be started by using any other password, because other than in the standard mobile applications, for this demo application there is no programmed event to verify the login data. Choose BusinessPartners Customer Orders and check if the new field Total orders is visible and containing the correct amount of orders for a corresponding customer. Remark: In the training database there are two customers (ADCOM COMPUTER and MEDIA STORE) with assigned orders.

Exercise 2: Raising messages depending on certain conditions At the conclusion of this exercise, you will be able to: - Create new Messages with and without parameters - Implement an UI Event Handler - Access the Business Object Layer from the User Interface Layer Scenario: In addition to the scenario in Exercise 1 you want to show a corresponding message to the user indicating if there are orders for the selected customer or not. Prerequisites You have installed SAP CRM Mobile Sales 4.0 SP06, including the SAP Mobile Application Studio (MAS). You have installed the training repository (demo_arsdb40) for the SAP MAS 4.0 and created an ODBC source for it. You have reserved the namespace Y_ for this training repository. You have created BOL and UI projects for the training application (DEMBOL and DEM) and have generated the application runtime files from the training repository. You have successfully completed Exercise 1. Tasks To realize this scenario you have to carry out the following steps: 1) Create two new messages for the two conditions you want to indicate to the user. i. The current customer has <n> orders assigned. You need to include two parameters to this message. One parameter which is filled with the total amount of orders for the current customer during runtime, and a second parameter which is filled with the customer name. ii. The current customer has no orders assigned. Here you don t need any parameters, because the message to be shown is the same for every customer with no orders assigned. 2) Implement the functionality to raise the respective message depending on the conditions described in 1). When the first condition holds true the message should be of type information. Otherwise (no orders for the customer) it should be of type warning. The result should look like this:

Before After

Hints - Parameters are included in message descriptions like that: <message text> %1% <message text> %2% <message text> - Use the Object Browser in the MS Visual Basic development environment to learn how the method RaiseMessage of the BusinessRootObject is designed and to be used. - Implement the appropriate <Anchor>OnUpdate Event Handler on the customer Tile to raise the messages depending on the respective condition. - To access the BusinessRootObject from the UI you can use the element gservices of class GlobalData. Begin the exercise now.

Exercise 2 - Solution 1. Start the SAP Mobile Application Studio and choose your change list which you have created in Exercise 1 To start the SAP Mobile Application Studio, choose Start Programs SAP CRM Mobile SAP Mobile Application Studio. To log on, make the following entries: - DSN: demo_arsdb40 - Login: ARSAdmin - Password: (no password) Choose the change list Y_Training from the drop down list on the change list selection screen. 2. Create two new messages for the two conditions: <n> orders / no orders assigned to a customer Look Up ID: Y_TotalOrder, Error Code: 1 and Look Up ID: Y_TotalOrder, Error Code: 2 Open the message editor via the menu Tools Message Editor. Right-click on the screen area and choose New from the context menu. In the opening message window enter the Look Up ID, Error Code, Source and Description. Save the new message. Repeat the last three steps for the second message. The result should look like follows:

3. Implement the Event Handler Y_CBusinessPartneronUpdate on Tile bpdetail In the Object Browser (Hierarchy tab) navigate to Tiles Detail Tiles bpdetail and double-click on the Tile to open it. In the Tile design window navigate to bpdetail Class Event Handlers. Right-click on the Event Handlers-folder and choose Add. Select <Anchor>CBusinessPartner from the upper left drop down box in the ScriptEditor window. Select onupdate from the upper right drop down box in the ScriptEditor window. Press the Begin Edit button in the tool bar to switch to the edit mode. Notice that in the lower right input field the name of the Event Handler Y_CBusinessPartneronUpdate is automatically created. Enter the source code for the Event Handler. One possible solution is: Dim params(1) If acbusinesspartner.bo.y_totalorders <> 0 Then params(0) = acbusinesspartner.bo.y_totalorders params(1) = acbusinesspartner.bo.mname1 gservices.bol.raisemessage "Y_TotalOrder", 1, EMS_INFO, params() Else gservices.bol.raisemessage "Y_TotalOrder", 2, EMS_WARNING End If Save the new Event Handler. 4. Generate your changes Cf. step 5 in Exercise 1. 5. Start the application Cf. step 6 in Exercise 1. In Tile Set BusinessPartners / Customer Orders skip through various customers to check if the correct messages are displayed. Remark: In the training database, e.g. the customer ADCOM COMPUTER has orders assigned. So it is advisable to search for customers with search term AD* in Tile Set BusinessPartners / Business Partner Search and skip through the resulting list of customers in Tile Set BusinessPartners / Customer Orders afterwards. OPTIONAL question: There is a little bug in the implementation on this scenario. What is it? How can it be solved?

Copyright 2004 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, 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, z/os, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM Corporation 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 several other 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 may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP assumes no responsibility for errors or omissions in these materials.