You are on page 1of 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. SAP TechEd ’07 / CD101 . 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.

Key Components of a BSP Application © SAP AG 2007. SAP TechEd ’07 / CD101 .

The scripting code is interpreted on the server. BSPs can contain static HTML code and dynamic scripting code (ABAP or JavaScript).Key Components of a BSP Application Controller Controllers contain business logic and application data. SAP TechEd ’07 / CD101 . © SAP AG 2007. 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.

© SAP AG 2007. 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.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. Page fragment – These are created in the same way as normal BSPs. View – Views are used to visualize data. but are then marked as page fragments. SAP TechEd ’07 / CD101 . Other BSPs can also include these fragments using the include directive.

This class is realized by means of a global ABAP class which implements the access to business data using BAPI calls. SAP TechEd ’07 / CD101 . for example. Every page of a BSP application can directly reference the components of this class (attributes. and so on) using the predefined Object application.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. © SAP AG 2007. Application class The business logic of a BSP application is encapsulated in an application class. methods. You can also assign several BSP applications to an application class.

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

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

SAP TechEd ’07 / CD101 . 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 can’t avoid them when using BSP technology © SAP AG 2007.Differences between BSP and ABAP HTML.

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 PO’s in PDF format Creating and updating Suggested Orders Printing Shelf Labels using a MS Office mail merge © SAP AG 2007.

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 .

SAP TechEd ’07 / CD101 .Create Attributes © SAP AG 2007.

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 .

SAP TechEd ’07 / CD101 .Create BSP Application © SAP AG 2007.

Create BSP Application © SAP AG 2007. SAP TechEd ’07 / CD101 .

Create BSP Application © SAP AG 2007. SAP TechEd ’07 / CD101 .

SAP TechEd ’07 / CD101 .BSP App Created © SAP AG 2007.

Create Page with Flow Logic © SAP AG 2007. SAP TechEd ’07 / CD101 .

SAP TechEd ’07 / CD101 .Create Page with Flow Logic © SAP AG 2007.

Default Page is Created © SAP AG 2007. SAP TechEd ’07 / CD101 .

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.

Specify Layout of the Page © SAP AG 2007. SAP TechEd ’07 / CD101 .

%> </htmlb:form> </htmlb:page> </htmlb:content> © SAP AG 2007.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. but article was selected --%> <p> <htmlb:textView text = "Article not found!" /> <% endif. %> <%-. %> <p> <htmlb:textView text = "Article Description:" design = "EMPHASIZED" /> <htmlb:textView text = "<%=lv_maktx%>" /> <% elseif lv_matnr is not initial.No description. SAP TechEd ’07 / CD101 .

SAP TechEd ’07 / CD101 .Add Event Handler .OnCreate © SAP AG 2007.

Add Event Handler . SAP TechEd ’07 / CD101 .OnInputProcessing © SAP AG 2007.

Modify BSP App Properties . App Class. SAP TechEd ’07 / CD101 .Initial BSP. Stateful © SAP AG 2007.

SAP TechEd ’07 / CD101 .Activate BSP App © SAP AG 2007.

Test BSP App © SAP AG 2007. SAP TechEd ’07 / CD101 .

avi © SAP AG 2007.CD101_a. SAP TechEd ’07 / CD101 .

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

com JavaScript & DHTML Cookbook: Solutions and Examples for Web Programmers – By Danny Goodman © SAP AG 2007. SAP TechEd ’07 / CD101 .w3schools. and JavaScript www.Resources HTML. CSS.

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 Frédéric Heinemann and Christian Rau http://www.sap-press.com © SAP AG 2007.

logoff. MIME referencing. session handling ‘it00’ BSP Application – Internal Test 00(basic functions. Server-side cookies example ‘sbspext_htmlb’ BSP Application – Test Pages for HTMLB BSP Extension © SAP AG 2007.Resources SAP Sample Applications ‘system’ BSP Application – Login. BSP runtime) – Stateless/Stateful tests. SAP TechEd ’07 / CD101 .

SAP TechEd ’07 / CD101 .sap.sap.sap.com/saphelp_nw2004s/helpdata/en/5a/f8b53 a364e0e5fe10000000a11405a/frameset.com/saphelp_nw04/helpdata/en/6b/9d91d06 2cc52419f23926ff1bf2ad3/content.htm SAP Developer’s Network http://sdn.com © SAP AG 2007.Resources BSP Application Overview http://help.htm Handling Logoffs on a Stateful Application http://help.

sapdevelopment. htm © SAP AG 2007.com/Articles/SAP_WAS_BSP_App s.thespot4sap.co.uk/webapps/bsp/bsp_exam. SAP TechEd ’07 / CD101 .asp Step by step example for creating a BSP http://www.Resources The Spot 4 SAP http://www.

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 .

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

SAP TechEd ’07 / CD101 . visit the ASUG booth in the SDN Clubhouse. or visit our Web site at www. 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.000 individual members and 1. with 45.ASUG and SAP: Partners in Education ASUG. is the world’s largest. customer-run community of SAP professionals and partners. ASUG delivers the highest value to member companies.com. allowing them to maximize their SAP investments.800 companies represented. © SAP AG 2007. the Americas’ SAP Users’ Group.asug.

Q&A THANK YOU FOR YOUR ATTENTION ! QUESTIONS – SUGGESTIONS – DISCUSSION © SAP AG 2007. SAP TechEd ’07 / CD101 .

and do not take the handouts for the following session. Thank You ! © SAP AG 2007. Be courteous — deposit your trash. SAP TechEd ’07 / CD101 .Feedback Please complete your session evaluation.

Outlook. links. and/or development. IBM. XML. MetaFrame. VideoFrame. OS/400. indirect. UNIX. mySAP. i5/OS. Adobe. OSF/1. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. xApp. Informix. R/3. Please note that this document is subject to change and may be changed by SAP at any time without notice. or other items contained within this material. and MultiWin are trademarks or registered trademarks of Citrix Systems. System i. National product specifications may vary. SAP shall have no liability for damages of any kind including without limitation direct. Intelligent Miner. HTML. System z. Program Neighborhood. SAP NetWeaver. Tivoli.com. Netfinity. Oracle is a registered trademark of Oracle Corporation. pSeries. SAP. This document contains only intended strategies. POWER. JavaScript is a registered trademark of Sun Microsystems. special.. z/OS. mySAP. including but not limited to the implied warranties of merchantability. WebSphere. 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 assumes no responsibility for errors or omissions in this document. The information contained herein may be changed without prior notice. 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. MaxDB is a trademark of MySQL AB. Inc. PostScript. AFP. Windows. POWER5+. either express or implied. System p. All other product and service names mentioned are the trademarks of their respective companies. xSeries. or transmitted in any form or for any purpose without the express prior written permission of SAP AG. DB2. and functionalities of the SAP® product and is not intended to be binding upon SAP to any particular course of business. No part of this document may be reproduced. and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Acrobat. System p5. AS/400. The information in this document is proprietary to SAP. and PowerPoint are registered trademarks of Microsoft Corporation. POWER5. The statutory liability for personal injury and defective products is not affected. Data contained in this document serves informational purposes only. xApps. WinFrame. OS/390. SAP does not warrant the accuracy or completeness of the information. System i5. AIX. Parallel Sysplex. Inc. iSeries. Sweden. S/390. This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. Java is a registered trademark of Sun Microsystems. developments. product strategy. MVS/ESA. fitness for a particular purpose. World Wide Web Consortium. Inc. 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. OS/2. Massachusetts Institute of Technology. and Motif are registered trademarks of the Open Group. System x. XHTML and W3C are trademarks or registered trademarks of W3C®. or consequential damages that may result from the use of these materials. System z9. copied. ICA. Citrix. used under license for technology invented and implemented by Netscape. SAP TechEd ’07 / CD101 . Microsoft. OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. text. zSeries. the Adobe logo. X/Open. graphics. Excel.Copyright 2007 SAP AG. DB2 Universal Database. © SAP AG 2007. or non-infringement. This document is provided without a warranty of any kind. This limitation shall not apply in cases of intent or gross negligence.