Sunteți pe pagina 1din 55

CD101 BSP Crash Course

Contributing Speaker

Jonathan Ziegler
SAP Development Supervisor TravelCenters of America Westlake, Ohio

SAP AG 2007, SAP TechEd 07 / CD101

Contributing Speaker Company Info TravelCenters of America


A leading full-service travel center chain Serving professional drivers and motorists alike Nearly 12,000 employees 164 travel centers in 40 states and Canada $4.8 billion in annual revenues Great place to stop while traveling the interstate SAP I/S Oil users over 750, SAP I/S Retail users over 600 some overlap and use both

SAP AG 2007, SAP TechEd 07 / CD101

Learning Objectives As a result of this workshop, you will be able to:


Understand the key components of a BSP application Highlight the key differences between BSP and normal ABAP Create a simple application class and BSP application Know where to go when learning BSP development

SAP AG 2007, SAP TechEd 07 / CD101

What is a BSP Application? BSP vs. ABAP Sample Application Resources

What is a BSP Application? A complete, functional application Executed in a Web browser Uses HTTP or HTTPS protocols Similar to server pages technology Consists of a user interface and business logic Runs on SAP Web AS Apps are developed in SE80 Uses services in SICF

SAP AG 2007, SAP TechEd 07 / CD101

Key Components of a BSP Application

SAP AG 2007, SAP TechEd 07 / CD101

Key Components of a BSP Application Controller


Controllers contain business logic and application data. Controllers assess the data of an incoming request based on a model and then select a suitable view for rendering the response to the user, see also Model View Controller (MVC).

Business Server Pages (BSPs)


BSPs are the Web sites that are displayed in the browser when the application is in use. BSPs can contain static HTML code and dynamic scripting code (ABAP or JavaScript). The scripting code is interpreted on the server.

SAP AG 2007, SAP TechEd 07 / CD101

Key Components of a BSP Application Business Server Pages (BSPs) continued A page can have the following versions:
Page with flow logic These are simple pages with event handlers, but without much application logic or visualization elements. It is possible to build a BSP application exclusively out of pages with flow logic and event handlers. View Views are used to visualize data. Page fragment These are created in the same way as normal BSPs, but are then marked as page fragments. Other BSPs can also include these fragments using the include directive.

SAP AG 2007, SAP TechEd 07 / CD101

Key Components of a BSP Application Navigation structures


The navigation structure determines which navigation request is used to direct the navigation process from which page to which subsequent page.

Application class
The business logic of a BSP application is encapsulated in an application class. This class is realized by means of a global ABAP class which implements the access to business data using BAPI calls, for example. Every page of a BSP application can directly reference the components of this class (attributes, methods, and so on) using the predefined Object application. You can also assign several BSP applications to an application class.

SAP AG 2007, SAP TechEd 07 / CD101

Key Components of a BSP Application MIME objects


In the SAP system, all MIMEs, such as graphics, style sheets (used to define formatting properties of individual HTML tags), audio files, video files, and so on, are stored and administered in a central repository, the MIME repository. For every new BSP application, a directory of the same name is created in the MIME repository. This directory is used as a storage location for all application-specific MIMEs.

SAP AG 2007, SAP TechEd 07 / CD101

What is a BSP Application? BSP vs. ABAP Sample Application Resources

Differences between BSP and ABAP HTML, CSS and JavaScript


Additional knowledge outside of a normal ABAP development

Session Management
No longer running from the SAP GUI

Page Event Handling


Need to learn what each event does and how it can be used

Page Navigation
Passing parameters to the next page can be tricky

Extensive use of ABAP Objects


Really cant avoid them when using BSP technology

SAP AG 2007, SAP TechEd 07 / CD101

How we used BSP

Mobile computing development Runs through Internet Explorer on Symbol MC3090

SAP AG 2007, SAP TechEd 07 / CD101

How we used BSP Custom developments for SAP Retail Store


Reports in PDF format Reprinting POs in PDF format Creating and updating Suggested Orders Printing Shelf Labels using a MS Office mail merge

SAP AG 2007, SAP TechEd 07 / CD101

What is a BSP Application? BSP vs. ABAP Sample Application Resources

Sample Application Create Application Class (SE24) Create BSP Application (SE80)

Create Application Class (SE24)

SAP AG 2007, SAP TechEd 07 / CD101

Define Class Type

SAP AG 2007, SAP TechEd 07 / CD101

Create Object Directory Entry for Class

SAP AG 2007, SAP TechEd 07 / CD101

Create Attributes

SAP AG 2007, SAP TechEd 07 / CD101

Create Method

SAP AG 2007, SAP TechEd 07 / CD101

Define Method Parameters

SAP AG 2007, SAP TechEd 07 / CD101

Define Method Code

SAP AG 2007, SAP TechEd 07 / CD101

Sample Application Create Application Class (SE24) Create BSP Application (SE80)

Create BSP Application (SE80)

SAP AG 2007, SAP TechEd 07 / CD101

Create BSP Application

SAP AG 2007, SAP TechEd 07 / CD101

Create BSP Application

SAP AG 2007, SAP TechEd 07 / CD101

Create BSP Application

SAP AG 2007, SAP TechEd 07 / CD101

BSP App Created

SAP AG 2007, SAP TechEd 07 / CD101

Create Page with Flow Logic

SAP AG 2007, SAP TechEd 07 / CD101

Create Page with Flow Logic

SAP AG 2007, SAP TechEd 07 / CD101

Default Page is Created

SAP AG 2007, SAP TechEd 07 / CD101

Default Code in Page

<%@page language="abap"%> <%@extension name="htmlb" prefix="htmlb"%> <htmlb:content design="design2003"> <htmlb:page title = "My Default Page "> <htmlb:form> <htmlb:textView <htmlb:button </htmlb:form> </htmlb:page> </htmlb:content> text design text onClick = "Hello World!" = "EMPHASIZED" /> = "Press Me" = "myClickHandler" />

SAP AG 2007, SAP TechEd 07 / CD101

Specify Page Attributes

SAP AG 2007, SAP TechEd 07 / CD101

Specify Layout of the Page

SAP AG 2007, SAP TechEd 07 / CD101

Modified Layout Code


<%@page language="abap"%> <%@extension name="htmlb" prefix="htmlb"%> <htmlb:content design="design2003"> <htmlb:page title = "My Default Page "> <htmlb:form> <htmlb:textView text = "Enter Article Number" design = "EMPHASIZED" /> <htmlb:inputField id = "lv_matnr" value = "<%=lv_matnr%>"/> <htmlb:button text = "Get Article Description" onClick = "btnGetArticleDescription" /> <% if lv_maktx is not initial. %> <p> <htmlb:textView text = "Article Description:" design = "EMPHASIZED" /> <htmlb:textView text = "<%=lv_maktx%>" /> <% elseif lv_matnr is not initial. %> <%-- No description, but article was selected --%> <p> <htmlb:textView text = "Article not found!" /> <% endif. %> </htmlb:form> </htmlb:page> </htmlb:content>
SAP AG 2007, SAP TechEd 07 / CD101

Add Event Handler - OnCreate

SAP AG 2007, SAP TechEd 07 / CD101

Add Event Handler - OnInputProcessing

SAP AG 2007, SAP TechEd 07 / CD101

Modify BSP App Properties - Initial BSP, App Class, Stateful

SAP AG 2007, SAP TechEd 07 / CD101

Activate BSP App

SAP AG 2007, SAP TechEd 07 / CD101

Test BSP App

SAP AG 2007, SAP TechEd 07 / CD101

CD101_a.avi

SAP AG 2007, SAP TechEd 07 / CD101

What is a BSP Application? BSP vs. ABAP Sample Application Resources

Resources HTML, CSS, and JavaScript www.w3schools.com JavaScript & DHTML Cookbook: Solutions and Examples for Web Programmers
By Danny Goodman

SAP AG 2007, SAP TechEd 07 / CD101

Resources

SAP Books
Advanced BSP Programming by Brian McKellar and Thomas Jung Web Programming in ABAP with the SAP Web Application Server (2nd Edition) by Frdric Heinemann and Christian Rau http://www.sap-press.com

SAP AG 2007, SAP TechEd 07 / CD101

Resources

SAP Sample Applications


system BSP Application
Login, logoff, session handling

it00 BSP Application


Internal Test 00(basic functions, BSP runtime) Stateless/Stateful tests, MIME referencing, Server-side cookies example

sbspext_htmlb BSP Application


Test Pages for HTMLB BSP Extension

SAP AG 2007, SAP TechEd 07 / CD101

Resources

BSP Application Overview


http://help.sap.com/saphelp_nw2004s/helpdata/en/5a/f8b53 a364e0e5fe10000000a11405a/frameset.htm Handling Logoffs on a Stateful Application http://help.sap.com/saphelp_nw04/helpdata/en/6b/9d91d06 2cc52419f23926ff1bf2ad3/content.htm

SAP Developers Network


http://sdn.sap.com

SAP AG 2007, SAP TechEd 07 / CD101

Resources

The Spot 4 SAP


http://www.thespot4sap.com/Articles/SAP_WAS_BSP_App s.asp

Step by step example for creating a BSP


http://www.sapdevelopment.co.uk/webapps/bsp/bsp_exam. htm

SAP AG 2007, SAP TechEd 07 / CD101

Summary BSPs are a useful development tool for creating web-based solutions for SAP BSP development requires different knowledge than typical ABAP development There are many resources and sample applications available for getting started with BSPs

SAP AG 2007, SAP TechEd 07 / CD101

Further Information SAP Public Web: SAP Developer Network (SDN): www.sdn.sap.com Business Process Expert (BPX) Community: www.bpx.sap.com Americas SAP Users Group (ASUG) www.asug.com Related SAP Education and Certification Opportunities http://www.sap.com/education/

SAP AG 2007, SAP TechEd 07 / CD101

ASUG and SAP: Partners in Education

ASUG, the Americas SAP Users Group, is the worlds largest, customer-run community of SAP professionals and partners, with 45,000 individual members and 1,800 companies represented. ASUG delivers the highest value to member companies, allowing them to maximize their SAP investments. Some highlighted benefits include: Access to a year-round community for SAP customers and partners Diverse mix of educational topics and events through a variety of formats Exclusive opportunity to influence SAP future product direction Unparalleled networking opportunities with a dynamic professional network Unprecedented partnership with SAP Access to ASUG Groups and Chapters To learn more about ASUG, visit the ASUG booth in the SDN Clubhouse, or visit our Web site at www.asug.com.

SAP AG 2007, SAP TechEd 07 / CD101

Q&A

THANK YOU FOR YOUR ATTENTION !


QUESTIONS SUGGESTIONS DISCUSSION

SAP AG 2007, SAP TechEd 07 / CD101

Feedback
Please complete your session evaluation. Be courteous deposit your trash, and do not take the handouts for the following session.

Thank You !

SAP AG 2007, SAP TechEd 07 / CD101

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 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, 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 and PowerPC are trademarks or registered trademarks of IBM Corporation. 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. 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.

The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, or transmitted 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 note that 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 or completeness of the information, text, graphics, links, or other items contained within this material. This document is provided 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 consequential damages that may result from the use of these materials. This limitation shall not apply in cases of intent or gross negligence. The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages.

SAP AG 2007, SAP TechEd 07 / CD101

S-ar putea să vă placă și