70_DevAndExtGuide



Comments



Description

Development and Extension GuideSAP E-Commerce 7.0 – Landscape, Basics and Concepts. Document Version 1.0– August, 2008 SAP AG Dietmar-Hopp-Allee 16 69190 Walldorf Germany T +49/18 05/34 34 24 F +49/18 05/34 34 20 www.sap.com © 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 , NT , EXCEL , Word , PowerPoint and SQL Server® 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 , Informix and Informix Dynamic Server IBM Corp. in USA 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. ® ® TM ® ® ® ® ® ® JAVA® is a registered trademark of Sun Microsystems, Inc. J2EE™ 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. MarketSet and Enterprise Buyer are jointly owned trademarks of SAP AG and Commerce One. SAP, SAP Logo, R/2, ERP, mySAP, mySAP.com, xApps, mySAP Business Suite, 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. are trademarks of Disclaimer LINUX is a registered trademark of Linus Torvalds and others. Citrix , the Citrix logo, ICA , Program Neighborhood , MetaFrame , WinFrame®, VideoFrame®, MultiWin® and other Citrix product names referenced herein are trademarks of Citrix Systems, Inc. HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. ® ® ® ® Some components of this product are based on Java™. Any code change in these components may cause unpredictable and severe malfunctions and is therefore expressively prohibited, as is any decompilation of these components. Any Java™ Source Code delivered with this product is only to be used by SAP’s Support Services and may not be modified or altered in any way. Documentation in the SAP Service Marketplace You can find this documentation at the following Internet address: service.sap.com/instguides Typographic Conventions Type Style Example Text Represents Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths and options. Cross-references to other documentation Example text Emphasized words or phrases in body text, titles of graphics and tables Names of elements in the system. These include report names, program names, transaction codes, table names, and individual key words of a programming language, when surrounded by body text, for example, SELECT and INCLUDE. Screen output. This includes file and directory names and their paths, messages, names of variables and parameters, source code as well as names of installation, upgrade and database tools. Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation. Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries. Keys on the keyboard, for example, function keys (such as F2) or the ENTER key. Icons Icon Meaning Caution Example Note Recommendation Syntax EXAMPLE TEXT Example text Example text <Example text> EXAMPLE TEXT Development and Extension Guide – SAP E-Commerce 7.0 Contents Contents ...........................................................................................................4 Development and Extension Guide – SAP E-Commerce 7.0: Landscape, Basics and Concepts ....................................................................................14 General Introduction 14 Where the Current Version of this Document is Located ......................................14 Naming Conventions.................................................................................................14 Terminology......................................................................................................................................14 Variables...........................................................................................................................................15 Structure of this Document ......................................................................................16 Available Courses, Literature, Links, Notes............................................................16 Courses ............................................................................................................................................16 CR800: CRM E-Commerce ............................................................................................................................16 Course Goals ..............................................................................................................................................16 Course Content ...........................................................................................................................................16 CR870: CRM Channel Management ...............................................................................................................17 Course Goals ..............................................................................................................................................17 Course Content ...........................................................................................................................................17 CR850: Internet Sales ERP Edition .................................................................................................................17 Course Goals ..............................................................................................................................................17 Course Content ...........................................................................................................................................18 CR555: CRM Technology...............................................................................................................................18 Course Goals ..............................................................................................................................................18 Course Content ...........................................................................................................................................18 Literature ..........................................................................................................................................19 Links.................................................................................................................................................19 Java in General ...............................................................................................................................................19 Java Tutorials .................................................................................................................................................19 Java Newsgroups ............................................................................................................................................19 Introduction to SAP J2EE.............................................................................20 SAP Web Application Server Java Web Container 21 21 E-Commerce Framework ..............................................................................22 E-Commerce Architecture Overview 23 Layered Architecture.................................................................................................25 Interaction and Presentation Layer....................................................................................................26 Business Object Layer (BO Layer) ....................................................................................................26 Business Logic Service Layer (BLS Layer) ........................................................................................27 Presentation Layer Details 28 JSPs............................................................................................................................28 Custom ISA Tags..............................................................................................................................28 MimeURL ......................................................................................................................................................29 WebappsURL .................................................................................................................................................30 translate..........................................................................................................................................................31 iterate .............................................................................................................................................................32 contentType....................................................................................................................................................32 June 2008 4 Development and Extension Guide – SAP E-Commerce 7.0 moduleName ..................................................................................................................................................33 message..........................................................................................................................................................33 imageAttribute................................................................................................................................................33 Dynamic Field Control ..............................................................................................34 Definition...........................................................................................................................................34 The structure of the UI element object .............................................................................................................35 The structure of the UI element group object ...................................................................................................35 Configuration of fields via XCM admin...............................................................................................35 Add field to the xcmadmin-config.xml ............................................................................................................36 Add field to the conf-data.xml.........................................................................................................................37 Usage ...............................................................................................................................................37 JSP .................................................................................................................................................................37 Action ............................................................................................................................................................38 Interaction Layer Details 38 Overview ....................................................................................................................38 UI Components ..........................................................................................................38 Interaction Components ...........................................................................................39 Actions..............................................................................................................................................39 Threads in Actions..........................................................................................................................................40 ActionForms......................................................................................................................................41 Interaction Configuration..........................................................................................41 ActionServlet.....................................................................................................................................42 ActionFormBean ...............................................................................................................................42 ActionMapping ..................................................................................................................................43 ActionForward...................................................................................................................................43 ISA extension of Struts .............................................................................................44 ISA Actions .......................................................................................................................................44 com.sap.isa.core.InitAction .............................................................................................................................44 com.sap.isa.core.BaseAction ...........................................................................................................................45 com.sapmarkets.isa.isacore.action.EComBaseAction .......................................................................................45 com.sapmarkets.isa.isacore.action.EComExtendedBaseAction.........................................................................46 com.sap.isa.isacore.action.IsaCoreBaseAction.................................................................................................47 com.sap.isa.core.UserSessionData...................................................................................................47 Changing language dependand resource keys ..................................................................................47 Additional Information ..............................................................................................48 Secure Programming 48 Input Validation..........................................................................................................48 Guideline ..........................................................................................................................................48 HTTP Header Information .........................................................................................50 Guideline ..........................................................................................................................................50 Persistent Cookies ............................................................................................................................50 Guideline ..........................................................................................................................................50 Cross Site Scripting ..................................................................................................51 Guideline ..........................................................................................................................................51 Error Handling...................................................................................................................................52 Solution ............................................................................................................................................52 User Session/Authentication....................................................................................52 Guideline ..........................................................................................................................................52 Logging/Tracing ................................................................................................................................52 Guideline ..........................................................................................................................................52 Comments in HTML Code.........................................................................................52 Guideline ..........................................................................................................................................53 Support of Web Standards (only B2C) 53 Introduction ...............................................................................................................53 August 2008 5 Development and Extension Guide – SAP E-Commerce 7.0 Frameless JSP pages................................................................................................53 Introduction.......................................................................................................................................53 Structure of the layout-config.xml ......................................................................................................55 The structure of the UILayout tag....................................................................................................................55 The structure of the Form tag ..........................................................................................................................56 The structure of the HTML attribute tag ..........................................................................................................56 The structure of the UIArea tag .......................................................................................................................56 The structure of the UIAreaContainer tag ........................................................................................................57 The structure of the UIComponent tag.............................................................................................................57 The structure of the UIConfiguration tag .........................................................................................................58 Create your component actions.........................................................................................................58 Create your JSP includes..................................................................................................................58 Control the layout..............................................................................................................................59 UILayout ........................................................................................................................................................59 Layout Processing...........................................................................................................................................60 UIArea ...........................................................................................................................................................60 UIInclude .......................................................................................................................................................61 UIJSInclude....................................................................................................................................................61 Dynamic change of HTML title...........................................................................................................62 Dynamic changes of the layout..........................................................................................................63 Support of navigation issues .............................................................................................................64 UIStoreLayout & UIStoreForward ..................................................................................................................64 UIStoreAction ................................................................................................................................................65 UIAction ........................................................................................................................................................65 UIGetLayout & UIGetForward .......................................................................................................................66 Summary of the UI Commands .........................................................................................................67 Global Commands ..........................................................................................................................................67 Commands while Layout processing ...............................................................................................................67 Browser Back Support..............................................................................................67 Usage of context values ....................................................................................................................68 Registration of context values .........................................................................................................................68 Getting and setting context values ...................................................................................................................69 Overruling context values in an url..................................................................................................................70 Rules for UI components.................................................................................................................................71 Redirect after form submit .................................................................................................................71 General Guidelines ...........................................................................................................................72 Bookmark Support ....................................................................................................72 Business Object Layer Details 74 Design Considerations ......................................................................................................................74 Additional Information ..............................................................................................76 Business Logic Service Layer Details 77 Design Considerations .............................................................................................77 Backend Objects .......................................................................................................77 Lifecycle of Backend Object ..............................................................................................................78 Initialization of the Backend Object ................................................................................................................78 Destruction of Backend Objects ......................................................................................................................79 Backend Context...............................................................................................................................79 BackendObjectManager............................................................................................80 Connection Management ..........................................................................................80 Design Considerations ......................................................................................................................80 Working with JCo Based Connectivity ...............................................................................................80 Connection Types ...........................................................................................................................................81 Working with JCoConnections........................................................................................................................83 Getting Default Connection Associated with a Backend Object....................................................................83 Getting a Modified Connection ...................................................................................................................84 Getting a New Connection from a ConnectionFactory object .......................................................................85 August 2008 6 ..............................................................................................................................................jsp ...........................................................................96 Action Layer..............................................................................................................................................................................................................Functions .........................................................................................................................................................................................................................................................................................................................................................................................................92 MessageListDisplayer.............................98 Pre Condition check in the EComExtendedBaseAction.......................................................119 Initializing Location...............................................................87 JCo Function Cache ................................117 Tracing ...............................................................................................jsp.............................................................................................................................................................................................................................................96 appbase\panicexception.............................................................................................94 Backend ..............................................................................................................96 appbase\relogin\invalidsession.......................................... MessageList and MessageListHolder Class .......................................................................85 Executing JCo Functions....................................................................................................................103 Details of component “GenericSearchBaseAction” .....................................................................................................................................................................................................................................................................................................jsp .......118 APIs for Tracing: SAP Logging API ..............................................................................................97 How to integrate the global message pages in an application ........................................117 Entering/exiting non trivial method ...................Functions ......................................................................................................................................................................................................96 Error Pages........................117 Initializing Location.....................................................................................................................................................................................................................................................................xml” ........................................................92 Message............................................91 Message classes ............92 Adding messages from a CRM backend ...............................................101 Architecture of the Generic Search Framework ...............................................................................................................................................0 Working with JCO........................................86 Configuration of BLS Layer....................................................................................115 Tracing...................................117 Throwing exception .87 Configuring Connection Management..........118 ERROR ............................................................................................121 August 2008 7 ............................................................115 Logging......................113 Logging/Tracing ........96 appbase\backenderror....................................................................................................85 Creating JCO...............................................................................................................................................103 Details of component “generic-searchbackend-config.........................................................................................................................................................................................................................................................................................................120 Logging...............115 Difference between Logging/Tracing ................................................................................120 Throwing exception ........................................................................................................................116 Summary Types of log messages..........120 Entering/exiting non trivial method ......................................................................97 Message handling in accessibility mode ...................................................................................................93 Message Tag ...................................................................................................................99 Generic Search Framework .................................................................................jsp ............................................................................................................................................................................................................................................................................................................................97 appbase\message............102 Main Components of the Generic search framework..........................................................................................................97 appbase\jspruntimeerror...............................................................................................................................................95 Business Object Layer ...........118 Coding Examples..................................................................................110 ESelling specific implementation of the Generic Search Framework ......................................87 Configuring Backend Objects ..................................................................................................................................................................Development and Extension Guide – SAP E-Commerce 7.....................................................................................................................................................................................................................................................................................................119 DEBUG .................................................jsp..............121 Usage of Categories ................97 appbase\accessibilitymessages..115 Design Consideration........................................................................inc.........................117 APIs for Tracing: ISALocation..................................................................................................................................................119 ERROR ....................................jsp....................................................................................................................................................96 appbase\runtimeerror........................................................................................................................................................................................................89 Further Services 91 Message Framework ..............118 DEBUG .............110 Details of component “CRM_ISALES_SEARCH”...........................................................................................................................................................94 Exception Handling ...............................jsp............... .................135 XCM Extension Mechanism ..............................136 Web Application Configuration and Components...................................................139 Development Tools and Concepts 140 External documentation.........................................................................................................150 Create your own Enterprise Applications....................132 Extended Configuration Management (XCM) 134 Separation of Customer and SAP Configuration Files........................................................................................................................................................................................................122 INFO .131 Working with the Cache ..........................149 Import the checked in archives into the Development system...........................................140 Overview of process .............................................................................................................................................................................123 APIs for Logging: SAP Logging API ........................145 Basic concept .............Development and Extension Guide – SAP E-Commerce 7...............124 FATAL...................................................................................................................................................151 August 2008 8 ..........................................................................................................150 Test the CRM Java application on a local Web AS Java Engine............................................................................................................................................................................................................................................................................................................................144 Handling of duplicate files .................................141 Modifications and Extensions of the Web User Interface...................................................................................................0 APIs for Logging: ISALocation ...................138 Technology 138 Development Environment.........................................................................................................................123 Coding Examples...............................................................................................................144 Restrictions.........122 Detailed Message Descriptions........................................124 INFO .134 Separation of Configuration Data and Modification Data ..................................................................................................122 ERROR .........................................................................................140 Software Component Architecture of the CRM or Extended Ecommerce Java Applications ......................................................................................................................................................................................................................................................................................................................................................146 Create a new Track using the Landscape Configurator..............................142 Extensions of the Java Code................................................................................................................................................................................................................................................................................................................................................................................125 All purpose Cache ............................................................................................131 Initialization Handler .................................................................................................................................................144 Initial Configuration of the NWDI Creating a project specific Web Application with own context root 145 145 Pre-requisites............................................................................................................................................................................................................................................................................................................................................146 Step by step process ..................................................................................................122 WARNING............................................................................146 Add Software Components to track .......................................149 Check-In archives .............................................................................................................................................................................................................................................................................................................................................................................................................................147 Configure Runtime Systems in the track.......................................124 WARNING..................................................................................................................124 ERROR .....................143 Merged Web Applications ..............................................148 Import Software Components into this track ..................................................................137 SAP Java Remote Function Call (JRFC)................................146 Check SLD content and create a new Software Component ......................................................................................................................................................149 Download Archives .............................122 FATAL..............................................................124 How to Log/Trace: Usage patterns ..........150 Import the checked in archives into the Consolidation system ................................. ........................................................195 Accessing Business Objects from Actions .......................................................................................................164 Starting Remote Debugging ................................................................................................172 Extensions to Exchange Additional Data .............................................................................................................163 Enabling/Disabling Debug Mode Permanently ...............................................................................0 Creation or Extensions of Java Classes ..................................................................................190 Create a Customer Action .........................................................................................................................................................................197 Version.......................................174 Extensions to Exchange Data with Backend-Systems .......................................................165 ABAP Debugging 166 Prerequesites...............................197 Version...........................................................................................................................160 Starting and Stopping the WebAS Java.............159 Directory Structure of the Web AS Java 7..................................197 Storing Additional Data ..................................................................................................................162 Remote Debugging 163 Setting up remote debugging for SAP WEB AS Java 7........................167 Java Debugging 167 Introduction to Extension Concepts ......................................................................................Extension Mechanism .....................168 Extensions in the ISA Framework 168 Finding the Appropriate Extension Concept .................................................2 .................................................................................................................................................170 Extensions to the UI Layer ..................................................................170 How to use these diagrams....................................................................................................................................................................................................................170 Overview.......................198 Example ........................................................................................................................................190 Extensions in the Action Flow......................163 Enabling/Disabling Debug Mode Temporarily ..............................157 Developer Workplace for SAP NetWeaver 2004s........151 Importing Modifications and Extensions from older Releases .......................................................................................................................................................................................162 Configuration of the web application...197 Modifications in the Struts Configuration.................................................................157 Installation of JDK 1..............................................166 Activating ABAP Debugging ................191 Standard Actions providing User Exits ..........................................152 Developer Workplace 156 Required tools and versions .........................196 Accessing the Request Context.......160 TCP-Ports........................................................................................0 .................Development and Extension Guide – SAP E-Commerce 7..........................................................................................................................171 Extensions to the Action Flow.......................................0...............................................................................................................................................................................157 Java Development Kit .....4....................................................................................................................................................................................................................................................................................................................................................................................159 Installing the Developer Workplace for SAP NetWeaver 2004s....................................................0.........................................................................................................................................................................................................................................................................................................161 Uninstalling the Developer Workplace for SAP NetWeaver 2004s ......................190 Accessing the Session Context ................................................................................................................................................................................................................................................................................................161 Configuration of SAP WebAS Java 7......193 Accessing the Session Context .............................162 Configuring and Working with Developer Studio .............................................................................................................................................199 August 2008 9 .173 Extensions to Exchange Data with the UI-Layer ....................................................................................................................................197 Business Object Layer.....197 Example ......179 Extensions to the UI layer.......190 Accessing the Request Context............................................................................................................................................199 Extending existing Business Objects ............................................... ..227 Replacing Calls to Standard Function Modules (Backend System) ..........................................................................................................................................................217 Version...............228 August 2008 10 .........................................203 Example ................................................... .......................................224 Version .........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................227 Example.......................................................................................................................218 Order ................................................................................................................................................................................................................................................................................................204 Standard Backend Objects providing User Exits ...................209 Register Backend Object in backendobject-config..............................................204 Creating new Customer Backend Objects .........220 Configuration of the Web Application...............204 Business Logic Service Layer...............................................221 Writing Data to the Backend ...223 Adding additional Function Modules (Backend System)......208 Create an Implementation of Backend Object ...............201 Version......................................200 Create a Customer Business Object..................................................................................................................................................................................................................................................................223 Example .............................................................................................................................................................................................................................................................................................216 BAPIs/SAP ERP-Extensions .........................209 Version................................................................................................................................................................218 Modification of Communication Structures in SAP ERP...221 Example ....217 Supported Function Modules and Business Objects......................................................................................................................................211 BADIs/SAP CRM Extensions .......................................................................................................................213 Complaint (E-Service)...............................................................................213 Shop ..................................................................................................................xml..............................................................................................................215 Example ...................................................211 Version..............212 Contract....................................Development and Extension Guide – SAP E-Commerce 7...........................210 Example .........................................................................................................................225 Interception of Calls to Standard Function Modules..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................214 Writing data to the backend.................................222 Request Context ...........................................................................................................201 Example ...............................................222 Version..................................................................................................................212 ABAP Extension Structure....................................................................................................212 Supported Function Modules and Business Objects ........................208 Design Considerations when Creating Backend Object Interfaces .............................200 Version................201 Create a Customer Business Object Manager ..........................................213 Reading data from the Backend...................................................................................................................................................................................................................................................................................................................................................222 Example ..................................222 Java Basket-Extensions ..............................................................................................................................................................................................................................................212 Order ...........................................................................................................213 ComplaintItem (E-Service)..........................................................................0 Version...........225 Thread Safety in Execution Listeners ...........................................................................................................................217 ABAP Extension Structure (BAPIPAREX) ...........................................................................................................215 Enhancements for the Dynamic UI of ECO B2B .................................................................................................................................204 Create a Customer Backend Object ........................................................................................................................................................................................................208 Create an Interface of Backend Object........................212 User..............................................................222 Version..............................................................................................227 What to Do......................................213 ComplaintHeader (E-Service)....................................................................................................................................................................................................................................................................................................227 Version .....................209 Accessing Backend Objects from Business Objects .................................................................................................................................................................................220 Reading Data from the Backend..................................................................................................................................................................227 Version .......................................................................................................................................................................................................................................................................................................................................................................... .............................................................................................................................Development and Extension Guide – SAP E-Commerce 7........................................................................................231 Loading additional Product Attributes from the SAP ERP Backend to the Memory Catalog ...............................................................................................................................................................................255 Extensions of the Document Handling 256 Overview ..............................................................................247 Example: Adding Customer Tab To Multifunctional Area ......260 PrepareNewDocAction..................233 Version .....................................................................................................248 Example: Display Characteristic Header And Values In One Line ...............................0 UI in CRM Order Scenario .............................................232 Loading additional Product Attributes from the SAP ERP Backend to the TREX .................................................231 Version ......239 UI Areas.................................................................236 Example.......................................................................237 Action Flow ....................252 Create Customer Backend Object.................................................................................................................258 Integrating own documents..............................................................................235 Version .....................0 What to Do.........................229 Preparation ............................................................................................................................................................................................................................................................................................................247 Change UI Components ..............239 Use of the E-Commerce Layout Framework .................................................................................246 Create New Layout Or Change Standard Layout .............................................................................246 Changing Stylesheets ..........................................256 Example.................................................................................................................................................252 Extensions In The Action Layer ..............................................................231 New Fields in the Web Catalog (SAP ERP Backend and Memory Catalog) ..........................................................................................236 Extensions of the IPC 237 Architecture of the IPC 5........247 Example: Customer Buttons and Actions..........................241 Low level layouts.........................................................................228 Example.....................................................................................................................................................................................................................................................244 UIBeans ...............................................233 Customer Specific Views in the Web Catalog (SAP ERP Backend and TREX)............................................240 Tiles.........................................................................................................................................................................254 SCE user functions .................................................................................251 Extensions To The UIBean Layer............................................................................................................................................................................255 Exchange additional data with ECO ....................................................229 Show Additional Attribute in Product Details and in Compare Products......229 Extension of the Web Catalog 229 New Fields in the Web Catalog (SAP CRM Backend)..239 UI Layouts ..................................................................................................................................................................256 Implementation ..............242 Extension To Transfer Data To JSP ...........................................244 Client Object Layer..........................................................................................................................................................................231 New Fields in the Web Catalog (SAP ERP Backend and TREX)...................................................................................................................................................231 Example..........................................................................................................................261 August 2008 11 ................................................................239 UI Components..........230 Show Additional Keys for Extended Search in B2B...............................................................................................................................................................................241 Dynamic Includes ..............................245 Finding The Appropriate Extension Concept For IPC.......................................................233 Example...............................................................................................................245 Static extension to UI layer........................................................................................................................................................................................................................................................................................................................................229 Show Additional Attribute in Product List .......................................................................................................................................... .........289 Example ..265 Source Code ................................................................................................................................................................................278 Adding Meta data of XCM parameters ...........................................................................................................................................................................................282 Configuration of Dynamic fields in E-Service .........................................................................................282 Generic Search Framework...........293 Additional Request Parameters 294 General Request Parameters .......................................................................................................................................270 Java.........................................................274 Changes in backendobject-config.......................................................275 Adding new Backend Object ........................xml ..............................................................................................................................................................................................................................................................................271 Packages.................................................................................................................................................................................................................................................................................................274 Common Configuration Changes ....................................................267 Conventions when Enhancing the E-Commerce Application 268 Separation of SAP-Software / Customer Extensions ..........................................................xml ........................................................................289 Getting Information about the Application 289 Getting Information about JSPs.................................................295 August 2008 12 ..................................................................................................................................................................................................................289 Displaying Text Keys While Running the Application .............273 Changes in Configuration 274 Application Configuration and Component Configuration ................................286 Checking configuration during runtime ...............................................................292 Tracing Function Modules ........................................................261 PrepareNewDocAction .................268 Java Server Pages........................................................................................................................................289 Displaying Names of JSPs while Running the Application............................................Development and Extension Guide – SAP E-Commerce 7.......................264 Configuration files .........................................................................267 General Package Structure of an E-Commerce application ..................................264 Enterprise Application Archive (ear file) ............................................................................................................................................................291 Analysing the config...............................................................294 ECO Version........xml ........................................................................291 Session Tracing 292 Configuring session tracing...........268 Naming Conventions......................................................................................................................................................................................................................................................................................277 Adding Parameter Name and default Value .....................................................................................................276 Extending XCM with Customer Settings ...........................................................290 Example ..........................................272 Java Classes...............................................................................................................................268 Changes in bom-config................275 Changing existing Backend Object ..............................279 API for reading XCM parameter Values...............................................................................................................................................................................................xml (or other Struts configuration files).....................................274 Changes in init-config..........................................................................................................................272 Resource Files ..............................................................................................................................................................................................................285 E-Service Extended Complaints and Returns specific implementation of the Generic Search Framework.................268 Changes in config....................................................................277 What to Do...............................................................................................................................291 Finding out Information about the Process Flow ...................................................0 Creating a ManagedDocument ...............................................................................................................................................................................................264 Web Archive (war file) ........................288 Best Practices.................292 Enabling session tracing ...........................................................................263 Structure of the Internet Sales application .................................................................................................................................................xml File (or other Struts configuration files) ................. ...................................................................................................................................................................295 Example...........................Display Order Status 301 302 303 304 References ...........306 Figure Index .....................................................................Create Basket B2B ............................................................................299 Getting Application Version .........................................299 Updating Application 300 Web Diagrams .................................................................305 Update History.................296 Passing Data between Actions 296 Action Flow Remains on the Server ....................................................................................309 August 2008 13 ..........................295 Single Session Trace ...............................Development and Extension Guide – SAP E-Commerce 7.........................................................................................................................................................................................................0 Example.......................................................................................................................299 Logging ................................................................................................297 Working with Request Parser Writing Thread Safe Code Administration Console 297 298 299 Java Connector Pools ..............................................295 Request parameters for B2C ...........................................................................295 ECO Version................................................................301 Syntax of Web Diagrams B2B ..............................................................................................................................................................................................................................296 Action Flow is Interrupted by a JSP .............................................................................305 Table Index...Start Page B2B ............ The term E-Service is the same as Internet Services (ICSS). The term SAP E-Commerce for mySAP ERP is used. when the E-Commerce application is connected to an ERP or R/3 system (ECO ERP). when the E-Commerce application is connected to a CRM System (ECO CRM). August 2008 14 .Development and Extension Guide – SAP E-Commerce 7.sap.0.0 CRM Core and Standalone Components can be downloaded from there. how to setup the development environment and explains the extension concept of SAP E-Commerce. They are enhanced by new ones and still valid for E-Commerce 7. Basics and Concepts contains information about how the SAP E-Commerce applications are designed.0.0.0 Development and Extension Guide – SAP E-Commerce 7. The term command shell is the same as command prompt. Enter ‘cmd’ and press enter. Open a command prompt in windows by pressing Start -> Run. Naming Conventions Terminology The term SAP Service Marketplace is the same as Marketplace. The term E-Commerce (ECO) embraces E-Selling and E-Service.0: Landscape. The term Web Channel (WEC) embraces E-Selling and E-Service. The term SAP E-Commerce for mySAP CRM is used. The term E-Selling is the same as Internet Sales (ISA). the Development and Extension Guide for SAP E-Commerce has been splitted into two documents. The document Landscape. Basics and Concepts In SAP CRM 7.com/crm-inst) SAP CRM 7. The term SP is an abbreviation for support pack. The document Examples and Tutorials contains examples and extension tutorials for SAP E-Commerce 5. General Introduction Where the Current Version of this Document is Located The current version of this document is located on the SAP Service Marketplace quick link CRM-INST (https://service. on which the JAVA runtime is installed (e.g. Instance number of your SAP Web AS. 4.g ‘03’). Drive on which the software was installed (e.g. C:\isa_build_tool) <SERVER> <PORT> Server on which your Internet Sales application is installed.0). which you entered during installation with the SAPInst. System ID you entered during installation of the SAP Web Application Server Java with the SAPInst.0). Number of the service pack (two decimals). Directory.0 TCP-Ports' on page 160 Table 1: List of the variables used in this guide August 2008 15 . please refer to the chapter Additional Information 'Figure 32: Directory Structure of Web AS Java 7. Directory where the application is deployed. b2b or b2c).com\crm~b2b servlet_jsp\b2b\root) <BUILDTOOL_HOME> Directory where the ISA build tool is located.Development and Extension Guide – SAP E-Commerce 7. (e. <J2EE_HOME>\cluster\server0\apps\sap. c:\jdk1. c:).g. Port on which the deployed application can be reached. Installation directory for the SAP system.g. Variables <RELEASE> <SP_NUMBER> <DRIVE> <J2EE_REL> <JAVA_HOME> <SAP_SID> <INSTANCE_NUMBER> <INST_DIR> Description SAP CRM release you have installed (e. SAP J2EE Engine release (e.g.g.2).0 Variables The following table contains a list of the variables. (e. which are used in this guide. Web AS 7. If you have installed the SAP Web AS with the SAPInst. you want to upgrade to (e. the default installation path is: C:\usr\sap\<SAP_SID>\JC<INSTANCE_NUMBER> <J2EE_HOME> <SDM_HOME> <APPLICATION> <APPLICATION_HOME> <INSTDIR>\j2ee <INSTDIR>\SDM Name of the deployed Internet Sales application (e.4. For more details on the SAP J2EE Ports.g.0 or 5. you should be able to make changes to both the local E-Commerce application and perform customer installations. Cross Selling o Bestsellers August 2008 16 . In particular. ECommerce versions.Development and Extension Guide – SAP E-Commerce 7. Unit four provides an introduction to handling and installing the tools required for running the E-Commerce application and modifying it. Courses CR800: CRM E-Commerce Course Goals This course will prepare you to Apply CRM E-Commerce process knowledge Perform the customizing settings for CRM E-Commerce Course Content E-Commerce scenarios E-Commerce architecture and components E-Commerce in the Solution Manager Web shop management SuperUser / User Management Product Catalog (Views. names important literature sources. it introduces the standard courses available at SAP University. Available Courses. and lists several interesting links about Java. After you have read this extension guide. Dokuments. and who want to understand the concepts of the E-Commerce 7.0 Structure of this Document Before we start the general introduction to the various subjects covered in this document. Notes This unit provides an overview of important sources of Java knowledge. It also contains introductory information on switching platforms in the frontend area. external Catalogs. BAdIs. web-based maintenance …) Price determination using the Internet Pricing Configurator (IPC) Marketing Features o Up/Down.0 J2EE solution and wish to set up their own local development environment. we would like to explain a few things about its structure and handling. Links. This cookbook is intended for consultants who have knowledge of the SAP CRM (ERP) environment. Export. The next unit gives an introduction to the SAP Java Remote Funciton Call required by the E-Commerce application when communicating with an SAP system. and basic Java skills. The first unit provides a short general introduction to SAP J2EE that is needed in order to understand the concepts of the E-Commerce framework discussed in the next unit. Best practices useful when extendion the application can be found in the last unit. Literature. 0 o Personalized Product Recommandations E-Service o Solution Search o Service Request Management o Complaints and Returns Management Additional Features o Ebay Integration o ATP Check o E-Analytics o Contract Negotiation o Live Web Collaboration o Guided Selling o Batches.Development and Extension Guide – SAP E-Commerce 7. o Product determination. o Request for Quotation CR870: CRM Channel Management Course Goals This course will prepare you to: Apply CRM Channel Management process knowledge Perform the customizing settings for CRM Channel Management Course Content Channel Management scenarios Channel Management architecture and components Channel Management in the Solution Manager Portal Roles in Channel Management Authorizations Partner Management Channel Marketing o Customer Segmentation o Lead Management o Opportunity Management o Content Management Channel Sales o Order Management o Business on behalf Channel Commerce o Collaborative Showroom o Hosted Order Management o Set up Partner & Channel Analytics CR850: Internet Sales ERP Edition Course Goals To enable the course participants to set up business processes with the ERP Internet Sales solution and to tailor them according to their needs. August 2008 17 . J2EE Engine. The data flow will be analyzed with respect to the different business scenarios by addressing the following questions: o Which technology is used in the scenario? o Which configuration or technical Customizing affects the data flow? o How can the data flow be monitored? Course Content Introduction to the architecture of SAP CRM Connectivity between the SAP back-end system and the CRM system: o CRM Middleware/administration console o Messaging BDoc o Initial load / delta load o Data flow. Index Server. Webserver) How to set up the front-end of ERP Internet Sales o J2EE-Specification. IPC.Development and Extension Guide – SAP E-Commerce 7. configuration and monitoring Architecture und technical configuration of Internet Sales Architecture und technical configuration of the Interaction Center o WebClient/WinClient Architecture and technical configuration for Field Sales o CRM Middleware: Synchronization BDoc and Consolidated Database o CRM Communication Station o Mobile Clients August 2008 18 . positioning and benefits How to set up Internet Sales in ERP o User Concept o Features of the ERP Product Catalog o Shop maintenance System landscape (ERP Plug-In. The main focus is the technical system landscape and the connectivity between the systems and software components. upgrade path from one solution to the other and outlook.and Shop XML-File Comparison to SAP Online Store and to mySAP CRM Internet Sales. JSP-Templates o Configuration of Web XML.0 Course Content Overview. CR555: CRM Technology Course Goals To provide the course participants with an understanding of the system architecture for the most important SAP CRM Business Scenarios. General Java topics.lang.sun.comp.jguru.com Institution SUN jGuru.sun.0 Literature Title Thinking in Java ISBN number 0-13-659723-8 Publisher Summary Book can be downloaded from http://www.com Content Jave home Source for any kind of Java information Java Tutorials Link http://java.lang.java Group German Java Newsgroup International Java Newsgroup Content General Java topics.Development and Extension Guide – SAP E-Commerce 7.net/ Links Java in General Link http://java.com/ Institution Sun Microsystems Content There are various tutorials for Java 2 Standard Edition as well as J2EE Java Newsgroups News-Link de.java comp. August 2008 19 .mindview.com/ http://www. Middle tier Web container and EJB container run on the SAP J2EE application server.Development and Extension Guide – SAP E-Commerce 7. and so on) Figure 1: SAP J2EE three-tier architecture The main benefits of the multi-tiered distributed application model are: Components can be reused Availability of a unified security model Flexible transaction control August 2008 20 . Third tier Enterprise information system (EIS) software runs on the EIS server (ERP systems. offers different services. database systems. This means that the application logic is divided into different components according to function. serves as a user interface. These various application components are installed on different machines depending on which tier in the multi-tiered SAP J2EE environment the application component belongs to. SAP J2EE multi-tiered applications are generally considered to be three-tiered applications because they are distributed over three different locations: Client machines SAP J2EE application server Database or legacy systems at the backend The next figure shows a SAP J2EE three-tier architecture described in the bullet list below. First tier Client components run on the client machine.0 Introduction to SAP J2EE The SAP J2EE architecture consists of a multi-tiered distributed application model. but allow a more natural approach to creating static content. the Web container consists of Servlets and JSPs. the EJB container.Development and Extension Guide – SAP E-Commerce 7. completion of a URL. The Web container is responsible for server-side presentation and for flow control. that access database functions or some other business logic. are offered by the service component of the SAP J2EE application server. Our Internet Sales application uses these custom tags for certain purposes. These tags can be used to access components. security. The EJB container is not used by our Internet Sales application. translation. Java Server Pages simplify dynamic page development with tags. you can create a set of custom tags. This means that Web application developers can concentrate on developing components while content developers build the HTML presentation. The EJB container is responsible for server-side business logic and therefore contains Enterprise Java Beans. Servlets are Java programming language classes. HTTP Servlets receive a request in the form of an HTTPServletRequest object and return a response in the form of an HTTPServletResponse. Java Server Pages technology encapsulates much of the functionality required for dynamic content generation in easy-to-use. download applets and perform other functions that would be difficult to develop with programming code. JSP pages are text-based documents that execute as Servlets. and so on. Servlets are request/ response oriented. Java Servlets allow clients to execute programming code on the SAP J2EE Application Server. A Servlet can be thought of as an applet that runs on the server side.0 SAP Web Application Server Java The SAP Web Application Server Java is part of the SAP Web Application Server platform and consists of the Web container. because in our case the business logic is included in the SAP CRM (ERP) system. Java Server Pages cleanly separate Web content (HTML and XML) from programming code by allowing Web developers to move programming logic into components. It contains Java Server Pages and Servlets. and so on. iteration. SAP J2EE based services. JSP-specific XML tags. naming. Furthermore. and services. without a user interface. for instance resource pooling. Figure 2: Components of the SAP J2EE Application Server Web Container As mentioned before. August 2008 21 . for example. for instance. Additionally. SAP J2EE provides component-based.0 and so on. on the SAP J2EE platform designed to support the requirements of modern. in which each layer is discussed in more detail.0 E-Commerce Framework E-Commerce 7. as the prio CRM releases 5. e-business oriented. scalable application architecture. You need this information to understand the programming model of the ECO application. August 2008 22 . This is a prerequisite for the following paragraphs. as well as possible customer-extensions to the standard application.Development and Extension Guide – SAP E-Commerce 7. enterprise application systems. extendable.0 is based. This chapter gives you a rough overview of the E-Commerce Framework to help you to understand the main framework concepts. . SAP E-Commerce for mySAP CRM TREX Firewall CRM System XI BW IPC Engine Web AS ABAP ABAP Stack Web Server Web Browser CRM Java Components SAP EP Web AS Java Firewall Java Stack ERP OLTP APO BW Optional Backends Figure 3: SAP E-Commerce for mySAP CRM architecture August 2008 23 .Development and Extension Guide – SAP E-Commerce 7.0 E-Commerce Architecture Overview The picture below shows the SAP E-Commerce for SAP CRM architecture. since the IPC Engine has to be installed in an SAP Web Application Server ABAP 7. It might be possible that some components are not required in your system landscape. which has to be installed seperately. the architecture of SAP E-Commerce for mySAP ERP might be different. SAP E-Commerce for mySAP ERP TREX Firewall ERP System XI BW IPC Engine Web AS ABAP ABAP Stack Web Server Web Browser ERP Java Components SAP EP Web AS Java Firewall Java Stack APO BW Figure 4: Architecture of SAP E-Commerce for mySAP ERP 2005 In case you use an older ERP or R/3 release.0.0 The picture below shows the architecture of SAP E-Commerce for mySAP ERP 2005. The ECO architecture pictures above containe some components that are only required for special processes or are optional.Development and Extension Guide – SAP E-Commerce 7. August 2008 24 . Development and Extension Guide – SAP E-Commerce 7. Internet Sales Application Internet Sales Framework JSPs Actions Business Objects Backend Objects Connection Handling JCo UI / Interaction / Custom Tags BO-Layer BLS-Layer Backend Objects Socket JDBC . As mentioned above. A SAP J2EE Servlet Engine processes the dynamic generation of the HTML data as a server-side process.. The HTML data is dynamically generated via Servlets and Java Server Pages (JSPs). and so on.0 With SAP J2EE the presentation of data in E-Commerce is carried out exclusively on the client layer via the Web Browser. to layout design and the interaction logic of the Web shop.. For example. text determination. Logging / XCM CRM / R3 Catalog IPC DB . which generates the pages to be displayed by the browser. Communication between the SAP J2EE platform and the SAP CRM (ERP) system takes place via the SAP Java Connector. Java technology is limited to the front-end area.. connection parameters. Figure 5: Layered Architecture August 2008 25 . The Web browser is merely responsible for presenting the generated data. Other runtime environments have not been tested and are therefore not supported. Business Logic Service layer (BLS) Manages the backend depended part of the application. The server-side interaction layer processes user requests and calls the server-side business logic and the respective business applications. Layered Architecture The ISA application architecture consists of the following layers: Server-side interaction and presentation layer Business Object layer Provides business functionality backend Business Objects not aware of backend system details. Internet Sales is a full SAP J2EE compliant application but has been released on SAP J2EE Engine only.. Business logic (such as order processing with partner determination. and so on) remains in the SAP CRM (ERP) system. Additional generic services are used throughout all layers: Loggon/Tracing Extended Configuration Management Used for configuration of the various layers. that is. The resulting data is then forwarded to the server-side presentation layer. backend object implementation classes. The user interface is realized using Java Server Page technology. This layer represents the view and the controller in a Model-View-Controller programming model. After calling the appropriate Business Object(s) the process control returns to the ActionServlet. because Business Objects are not aware of any backend-specific details. Actions represent a server-side processing unit and are accessed via a common interface.org/struts/userGuide/index.apache. August 2008 26 . Business functions are either completely provided by these objects or are located in an Enterprise Information System (EIS). which is not aware of any user interface. routing all incoming requests to appropriate Actions.Struts is an open source controller framework providing the Model-View-Controller programming model in a JSP/Servlet environment. It acts as an interface between the HTTP world and the business logic. Business Objects provide business functionality via well-defined interfaces in a backend-independent manner. in order to present the result of the calculation to the user. Business Object Layer (BO Layer) The Business Object layer hosts Java-based Business Objects used by the Interaction and Presentation layer.0 Interaction and Presentation Layer This layer is responsible for providing the user interface as well as the navigation within the application. an appropriate JSP (or other Action) is called.html). The dispatching mechanism is configured externally. The Interaction and Presentation Layer is realized using the Struts framework (see [3] Struts documentation: http://jakarta. If they have to communicate with a backend they do so using a set of generic interfaces provided by corresponding Backend Objects. After mixing the static HTML content with the dynamic content the result is sent back to the client. An EIS is never accessed directly from the BO layer. Depending on the return value of the called Action and the external configuration. The implementation of these interfaces is backend-specific but the interfaces themselves are not.Development and Extension Guide – SAP E-Commerce 7. This Servlet acts as a central dispatcher. All client HTTP requests are routed through the central controller Servlet ActionSevlet. Interaction Layer "Controller" Controller ActionServlet (Servlet) r u eq t es Business Object Layer "Model" dispatch Actions BO forward te da up config BO Browser BO re s po ns e View JavaServer Pages JSPs "View" retrieve BO Figure 6: Internal processes within the interacton and presentation layer The above diagram gives an overview of the internal processes within the interaction and presentation layer when an HTTP request is sent to the ISA application by a client (usually web browser). They act as a mediator between the HTTP world and the Business Objects. Development and Extension Guide – SAP E-Commerce 7.0 Business Objects are managed by Business Object Managers (BOM). A BOM is used as a central access point for accessing Business Objects. When Actions are accessing a Business Object they have to obtain a reference to it from the BOM. Session Context Action BO Layer Business ObjectManager <<creates>> Order Basket <<creates>> Item Figure 7: BO Layer and the Business Object Manager Business Logic Service Layer (BLS Layer) This layer provides access to business functions located in the various Enterprise Information Systems (EIS) (e.g. CRM, ERP) Many Business Objects (for example, basket) in the Business Object layer have a corresponding Backend Object in the BLS layer. The functionality of a Backend Object is accessed via a well-defined Java interface (for example, BasketBackend). The implementation of such an interface is backend-dependent (for example, BasketCRM). A Business Object obtains a reference to a backend object from the Backend Object Manager (BEM). The BEM takes care of the lifecycle of backend objects and returns their references to the BO layer. The ISA Framework can handle communication to various backend systems simultaneously. Depending on the used backend, different backend object implementations have to be instantiated (for example, BasketCRM, or BasketR3). Additionally, the framework takes care that the correct connection data is used. All this is configured in Extended Configuration Management. August 2008 27 Development and Extension Guide – SAP E-Commerce 7.0 Business Object Layer BO Basket <<communicate>> Business Logic Service Layer XCM Backend Object Manager BEM <<configure>> <<reference>> << interface >> BasketBackend <<create>> BasketCRM BasketR3 Connection Management JCo Enterprise Application System CRM R3 Figure 8: Business Logic Service Layer (BLS Layer) Presentation Layer Details The Presentation layer is a relatively thin layer in the ISA framework. It consists basically of the SAP J2EE compliant JSP functionality and some ISA specific custom tags. Struts tags are not used and are not supposed to be used in customer projects. JSPs This chapter covers the server-side aspects of the ISA framework. Besides custom tags there are no ISA specific extensions which can be discussed here. Custom ISA Tags Since the ISA tags are not supposed to generate HTML code (to facilitate UI adjustment), the ISA application will not use this group of tags. Non UI tags, however, are provided. These are described in the following section. The functions of all the tags described are packaged as static functions in the class com.sap.isa.core.util.WebUtil. This means that you can use the functions of the tag library from any Scriplets. August 2008 28 Development and Extension Guide – SAP E-Commerce 7.0 MimeURL The mimeURL is used to completely resolve the location of a Web resource (such as a script, or image).The application context contains the ‘front’ part of the mime location (host: Port possibly directory structure). If no explicit theme is specified, the system checks the session context to determine whether it contains a theme. (see below to find out how a theme gets into the session context). If this is not the case, the theme of the application context is used. Mimes are searched using the following pattern: %mimeServer%/%theme%/%language%/%name% Parameters Attribute name theme language Description Resource name Theme (default: session context / application context) Language Table 2: Parameters of the MimeURL Required yes no no The information on the name of the mime server is declared in the web.xml file (or in XCM in ISA 4.0 SP06 or higher): %mimeServer%/%theme%/%language%/%name% <context-param> <param-name>mimes.isa.core.sap.com</param-name> <param-value>http://p54909:1080/isa/mimes</param-value> </context-param> If no mime server is defined the path to the current web application context is used. There are two additional possibilities to specify the theme parameter: As context parameter in web.xml file: <context-param> <param-name>theme.core.isa.sap.com</param-name> <param-value>summer<param-value/> </context-param> As request parameter: http://localhost:50000/b2b/b2b/init.do?theme=<name of theme e.g. summer> Example: <isa:mimeURL name=‘logo.gif’ /> August 2008 29 Development and Extension Guide – SAP E-Commerce 7.0 logo.gif is located in <APPLICATION_HOME>/b2b/mimes/images/logo.gif after deploying application. No mimes server was specified. When calling the application using the following URL http://host:50000/b2b/b2b/init.do&theme=summer The mime is searched in the following location http://host:50000/b2b/summer/b2b/mimes/images/logo.gif WebappsURL A Webapps URL is used to specify a URL for the current application, and, if cookies are not used, encode the session ID using the additional jsessionid request parameter. Whenever you have to specify an HREF in your JSP make sure to always use this tag. Only this tag will make sure that session handling still works if cookies are turned off. Parameters Attribute Name Secure Description Significant part of the URL Triggers the de-/activation of https protocol in an SSL environment. Values: ON | OFF If you work with HTTP/HTTPS switch make sure to define the appropriate ports in the XCM Administration UI (“General Application Settings” “Customer” “<APPLICATION NAME>” “<APPLICATION NAME>config”): http.port.core.isa.sap.com Needed when switching from HTTPS to HTTP https.port.core.isa.sap.com Needed when switching from HTTP to HTTPS Required yes no For information about the secure request parameter refer to chapter General Request Parameters on page 294. This parameter is needed if you have the following infrastructure: web browser => HTTPS => web server => HTTP J2EE engine Anchor completeUrl Appends an anchor to the URL Always generates the complete URL Values: ON | OFF Table 3: Parameters of the WebappsURL no no If you have to add a number of URL parameters you have to use embedded <isa:param> tags. The values of the used parameters are coded for HTTP. August 2008 30 Development and Extension Guide – SAP E-Commerce 7.0 Example: <isa:webappsURL name =‘catalog/logon.do’ anchor=‘Mark1’> <isa:param <isa:param name=‘para1’ name=‘para2’ value=‘value1’ /> value=‘value2’ /> </isa: webappsURL> Never use the following (concatenating request parameters): <isa:webappsURL name =‘catalog/logon.do?para1=value1&para2&value2’ anchor=‘Mark1’> </isa:webappsURL> translate This tag is used to represent a language-dependent text. The value of the key and attributes are determined with the actual language-dependent text at runtime. Parameters Attribute key arg0 arg1 arg2 arg3 arg4 Description The key in the resource file First argument Second argument Third argument Fourth argument Fifth argument Table 4: Parameters of the translate Tag Required yes no no no no no The language keys are maintained in language-dependend resource files located is WEB-INF\classes\. Placeholders within the keys of type {0...4} are replaced by the content of the arg attributes. For further information related to this custom tag refer to chapter 'Displaying Text Keys While Running the Application' on page 290. Example: <isa:translate key=‘system.initFailed’ arg0=‘logging configuration’/> Key in your XLF file (see chapter “Changing language dependand resource keys” for more details): system.initFailed=Initalization of {0} failed The result at runtime is as follows: Initalization of logging configuration failed August 2008 31 Development and Extension Guide – SAP E-Commerce 7.0 iterate Iteration via a collection. The object that contains the elements to iterate has to implement com.sap.isa.core.Iterable, or has to be one of the standard Java collection classes (List, Set), a standard Java collection iterator, a JDBC ResultSet, or any one dimensional Java language array. When working with tables in Internet Sales you can use the classes located in the com.sap.isa.core.util.table package. Objects of type com.sap.isa.core.util.table.ResultData can be used together with the iterate tag. Parameters Attribute Name Id Type resetCursor Description Name of object that contains data. Implements com.sap.isa.core.Iterable Scripting variable to create. Type of scripting variable. Used in scenarios where the iteration is based on ResultSets value: true|false Determines the behavior if an entry in the iteration set is null (default false; a null-entry will terminate the iteration without any other notification). value: true|false Table 5: Parameters of the iterate Tag Required yes yes yes no ignoreNull no Example: <isa:iterate name=‘userObj’ id=‘cursor’ type=‘com.sap.isa.User’ > <TR><TD> <%= cursor.getName() %> </TD></TR> </isa:iterate> contentType Specifies the character encoding of the JSP based on the session locale. This tag is needed in order to display double-byte character encoding correctly. This tag should always be entered on top of each main JSP. This is not necessary in JSPs included by the main JSP. Parameters Attribute type Description Specifies the content type (default text/html) Table 6: Parameters of th contentType Tag Required no August 2008 32 do?showmodulename=true message Please refer to chapter ‘Message Framework’ on page 91.jsp’ /> If the application is started as follows the name of the JSPs (/b2b/logon. For usage of this custom tag refer to chapter 'Displaying Names of JSPs while Running the Application' on page 289 Parameters Attribute Name Description Name of the JSP Table 7: Parameters ot the moduleName Tag Required yes Example: <isa:moduleName name=‘/b2b/logon. This tag should always be entered on top of each main JSP.Development and Extension Guide – SAP E-Commerce 7. imageAttribute This tag offers the option of either displaying an image associated with a product in the product catalog which is stored on the image server. or displaying a default image. August 2008 33 . It displays the name of the current JSP if the application was started with the additional showmodulename=true request attribute.jsp) is shown: http://host:50000/b2b/b2b/init. which is considered to be a mime image.0 Example: <isa:contentType /> moduleName This tag is useful in the development process. and is taken from the path where the other mimes are. August 2008 34 . the image specified as defaultImage is displayed as a mime Taking account that the defaultImage is a mime component.0 .xml file.Displaying additional Document Type on User Interface in ISA CRM” of the “Development & Extension Guide: E-Commerce 5. All information which is necessary is hold within the so called UI Element. On the JSP you could ask the UI class about visibility and changeability of the element(s) or fragments. it may be language-dependent Table 8: Parameters of the imageAttribute Tag Required yes yes defaultImg yes language no Example: Refer to chapter “Extension Demo 6 . disable or generate fields or more generally page elements dynamically on JSP’s. You can arrange page elements in groups. You could access the UI elements via UI class in a direct way. The UI elements and groups will be managed within the UI controller.Development and Extension Guide – SAP E-Commerce 7. which allows the access to the UI objects in actions and the UI classes. Dynamic Field Control The dynamic field control offers a general functionality to hide.0 Parameters: Attribute name guids Description The name with which the current item may be retrieved from the session A list of comma separated attribute guids. Definition The UI element and fields will be defined in the uicontrol-config. The functionality allows also customizing the UI with the help of the XCM admin application. Additional the UI Field object could hold all information to generated fields or a group of fields on the JSP. The needed information will be stored static in XML or the XCM configuration or could be changed dynamic in actions or UI classes.Examples and Tutorials”. There is a fully integration within the base UI class. At least one of these guids may be associated with an attribute which store a URL for an image In case no guid can be identified as an attribute holding a value. The customer could change between the following values: Hidden: the screen element is not visible Visible: the screen element is visible but could not be changed Editable: the screen element is visible and could be changed August 2008 35 . (Default: false) Table 9: The structure of the UI element object The structure of the UI element group object Field name element Description Name of element group. if a value is allowed.Development and Extension Guide – SAP E-Commerce 7. With this flag you control. (Default: true) With this flag you change the visibility of an object. Name of the elements included Table 10: The structure of the UI element group object Configuration of fields via XCM admin The framework allows also that the UI elements could be controlled via the XCM admin tool. Only allowed field could be set visible.0 Example <UiElement name = "ShipTo" allowed = “false” disabled = "false" /> <UiElemet name = "BillTo" allowed = “true” hidden = “false” disabled = "false" /> <UiElementGroup name=”Header”> <elememt name=”ShipTo”/> <elememt name=”BillTo”/> </UiElementGroup> The structure of the UI element object Field name allowed hidden Disabled Description Name of UI element. In the XCM admin we have only restricted possibilities to control the fields. (Default: false) With this flag you could set a flag to read only. Add the field to the conf-data. Example <param name="ui. Add field to the xcmadmin-config.xml) you have to add a parameter with the name ui.<name of the element>.order. Note: This field is not available in the Collabrative Showroom at all! </longtext> <constraint> <allowedvalue value="hidden" shorttext="The screen element is not visible"/> <allowedvalue value="visible" shorttext="The screen element is visible but could not be changed"/> <allowedvalue value="editable" shorttext="The screen element is visible and could be changed"/> </constraint> </param> August 2008 36 .xml Figure 9: Component configuration within XCM Add field to the xcmadmin-config.xml (normally you have to maintain the isa-xcmadminconfig.xml 2.fields.deliveryPriority" type="singleselect" shorttext="Visibility and availablitity of the field delivery priority"> <longtext> Visibility and availablitity of the field delivery priority.fields.0 To allow the control via XCM admin you have to perform two steps 1.xml To add a UI element to the xcmadmin-config.Development and Extension Guide – SAP E-Commerce 7. ask UI class --%> <% /* first example..fields.deliveryPriority" value="editable"/> <param name="ui.fields.xml To add a UI element to the conf-data. Example <component id="ui"> <configs> <config id="default"> <params id="ui-settings"> <param name="language" value="en"/> . August 2008 37 .getElementDisable(”itemName”) /> .order.fields. how to calculate “col span” */ int numCol = ui..latestDeliveryDate" value="editable"/> </params> </config> </configs> </component> Usage JSP The BaseUI class provides access to the UI elements: isElementVisible return the visibility of an element isElementEnabled.shippingCondition" value="hidden"/> <param name="ui.isElementVisible(”itemKey”) { %> <input type=”Text” id=”key” name=”key” value=”<%=item.fields.getNumberOfVisibleElements (“Group1”).isVisible(”itemName”) { %> <input type=”Text” id=”name” name=”name” value=”<%=item.order. /* output of the fields */ if (ui. </params> <params id="ui-fields"> <param name="ui.getName()%>” <%=ui.getKey()%>” <%=ui.xml you have to add a parameter with the name ui. getElementDisabled return if a element is changeable getUIGroup return the group with the given name Example <%-.<name of the element> in the ui component in the parameter list with the name ui-fields.subitemDetailView" value="hidden"/> <param name="ui.order.0 Add field to the conf-data..Development and Extension Guide – SAP E-Commerce 7.fields..fields.getElementDisable(”itemKey”) /> <% if (ui.bomExplosion" value="visible"/> <param name="ui.order.order. 1 (in older releases Struts 1. E-Commerce 7. For hands-on guidelines are covered in various other chapters of this guide. or visualization. The following paragraphs introduce the main components of the Struts framework and ISA specific extensions to this framework. Whereas the model is mapped by one or more Java Beans (Business Object in ISA framework). Defining the interaction of these Actions with any existing data container. Some Internet-Sales-specific extensions have been added to this framework. no Struts custom tags are used).0 Action In action you could access UI elements with the getUIElement method of the UI controller. The view is mapped via the JSP files. This chapter describes how this layer works. It is therefore not planned to upgrade to a current version of the Struts framework.setAllowed(true. In the MVC (Model View Control) paradigm. UIELEMENT. rarely used in ISA) Assuming the handling of these objects and calling the appropriate follow-on processing. It enables the development of Web applications in which presentation is separate from the process flow. Struts represents the controller part through the ActionServlet. Besides using ISA specific custom tags no additional Struts functions are used here.PR_AUTHORITHY). Individual components and the interaction between them are described in an XML-based configuration files. Interaction Layer Details The ISA Interaction Layer consists mainly of the Apache Struts Framework. Different (independent) parts of the application have on configuration files (new feature of Struts 1. ECO uses only a limited set of Struts functionality (for example. Overview The Struts based ISA Interaction framework helps you to develop web applications based on Servlets and Java Server Pages. The Struts framework supports the following: Dividing an application into logical sub-steps (Actions).getController(userSessionData).1). through the provision of an ActionServlet.getUIElement("catalog.general". // disable the field for output: uiElement. userSessionData). Example UIController uiController = UIController.0 uses Struts version 1.Development and Extension Guide – SAP E-Commerce 7. UIElement uiElement = uiController. Since this chapter focuses on server-side capabilities there is nothing further to say than what is common knowledge in the area of JSP. August 2008 38 . (ActionForm. Further details about extension of the ISA user interface can be found in chapter 'Introduction to Extension Concepts' on page 168.0 has been used). UI Components UI components are realized using Java Server Pages and HTML files. the current Action initiates the forwarding in this case.Development and Extension Guide – SAP E-Commerce 7.action.BaseAction +doPerform() com.isa.isa..acme.isacore.sap. or com.b2b +isaPerform() Figure 10: Actions within ECO Framework Each Action ends by returning an ActionForward instance. you will never derive directly from an Action. This method contains the actual code sequence executed when an Action is called by the ActionServlet.) method.isa.core. and therefore defines what is done next.Action +perform() Struts Framework ECO Framework com.struts.0 Interaction Components In addition to writing the JSP and HTML files for visualization.IsaCoreBaseAction +isaPerform() (ISA) Application com.isa.apache. Actions describe the process flow that is required to respond to a related request.action.or by extending a customer exit from an ISA application action (see chapter 'Accessing the Session Context' on page 190) org.action.IsaCoreBaseAction). Several Actions can also be combined to process a request.isacore. which makes it possible to access Web application resources from within any Action. Each Action that is to be created is a specialization of class org.sap. an Action is the smallest possible unit that is run in response to a request.BaseAction.isacore.core. Therefore.Action contains a reference to the ActionServlet..isa.action. Actions In the Struts environment. but from ISA specific base actions (com.sap. The base class of each org.sap. Each Action has to overwrite the ActionForward perform(.isa.action.sap.Action. Nevertheless. a web application developer is responsible for supplying the individual Actions as well as declaring the flow sequence between the Actions.MyAction +doPerform() com.action.action. The declaration of an Action is explained under ActionMapping below.struts.apache.struts. August 2008 39 .apache. HttpServletRequest request.Development and Extension Guide – SAP E-Commerce 7. so there is no need to worry about sharing them. you need to code your Action class so that it operates correctly in a multi-threaded environment. and uses it for all requests. // doing something with array // no problem because array is a local variable and only visible for a single thread } } August 2008 40 . Design issues to remember when coding Action classes include the following: The controller servlet creates only one instance of your Action class. public ActionForward doPerform( ActionMapping mapping. just as you must code a servlet's service() method safely. This means that you have to pay special attention to thread safety when implementing an Action.0 Threads in Actions In the ActionServlet context a maximum of one instance of each Action type exists. ServletException { ArrayList array. ServletException { // doing something with mArray // problem because mArray is an instance variable and shared among several threads } } Solution: do not use instance variables! public class myAction extends BaseAction { public ActionForward doPerform( ActionMapping mapping. ActionForm form. not instance variables. HttpServletRequest request. ActionForm form. Example: The following action is not thread safe: public class myAction extends BaseAction { private ArrayList mArray. Local variables are created on a stack that is assigned (by your JVM) to each request thread. HttpServletResponse response) throws IOException. You should not use instance variables or static variables in an Action if their content is session dependent. but can be processed simultaneously by multiple threads. HttpServletResponse response) throws IOException. in your Action class. The most important principle that aids in thread-safe coding is to use only local variables. Thus. or by using the RequestParser provided by IsaCoreBaseAction (see chapter 'Working with Request Parser' on page 297). In most cases data is retrieved from the HttpServletRequest directly.0 If there is no way to omit an instance variable you should synchronize the access to it: public class myAction extends BaseAction { private ArrayList mArray. Each ActionForm specializes the abstract class org. ActionsForms are rarely used in ISA. Interaction Configuration The interaction flow in a Struts based application is configured in an XML based configuration file declaratively.struts.) method. The declaration of an ActionForm is described in more detail under ActionFormBean below.. public ActionForward doPerform( ActionMapping mapping. August 2008 41 . the respective ActionForm has to redefine the ActionError validate(.Development and Extension Guide – SAP E-Commerce 7. ServletException { synchronized(mArray) { // do something with mArray } // synchronized(mArray) } // public ActionForward doPerform } // class myAction ActionForms The ActionForm is an optional component. the ActionForm must provide appropriate get and set methods. When validation of the data is requested. This chapter discusses which framework components are controlled by this file. It is used to accept user inputs and (optionally) save them. when declared accordingly. that of the session. the request parameters of any existing ActionForm are set automatically. HttpServletResponse response) throws IOException. HttpServletRequest request.ActionForm and defines its own set of data. In the Struts framework..action. As is the case with the Action. The lifetime of an ActionForm usually corresponds to that of the request or.apache. the base class of every ActionForm contains a reference to the ActionServlet. ActionForm form. To achieve this. The ActionForm can be used to validate this data. struts./WEB-INF/config_lwc_b2b.xml.apache.isa.xml declaration: <!-.do</url-pattern> </servlet-mapping> In the above example an extension mapping is declared that calls the ActionServlet to process every request whose URL ends with .sap.do (and runs in the corresponding Web application).struts.0 ActionServlet The ActionsServlet is the central controller instance in a Struts based application./WEB-INF/ipcpricing-config. you have to tell the Web application which requests are to be processed by the ActionServlet. /WEB-INF/ccmsims-config.xml.Development and Extension Guide – SAP E-Commerce 7. For further information. You can use the <initparam> technique to specify additional information for configuring the ActionServlet.action. This is achieved using the usual web.sap. ActionFormBean The ActionFormBean is an auxiliary construct that you can declare as follows in the configuration file: <form-beans> <form-bean name=‘logonForm’ type=‘com.xml </param-value> </init-param> </servlet> The config attribute informs the Servlet about the name of the configuration file. /WEB-INF/scheduler-config./WEB-INF/xcmadmin-config. under which an ActionForm is addressed in the configuration file.xml.xml.isa. In addition.ActionServlet mapping --> <servlet-mapping> <servlet name>action</servlet name> <url-pattern>*.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/config. August 2008 42 .xml. The ActionServlet is defined using the usual Servlet declaration: <!--ActionServlet declaration --> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.struts.LogonForm’ /> <form-bean name=‘catalogForm’ type=‘com. and the implementation class./WEB-INF/ipc-config.xml.CatalogForm’ /> </form-beans> The ActionFormBean forms the assignment between the name.xml. /ipc/customer/config. see the Struts documentation [3]. You can use the optional attribute input to declare a form or the call of another Action that will be displayed or run if the validation fails. It only makes sense to use the optional attribute validate when an ActionForm is used. the required attributes path and type. Possible values for the scope are request or session. a reference to the surrounding ActionMapping instance through a call like: ActionForward actionForward = (mapping. The optional attribute unknown with value true can only be declared once. ActionForward As explained under ‘Action’ above. </action> </action-mappings> /> Each ActionMapping possesses. This attribute tells the Struts environment to perform a validation. and thus assigns the implementing class to a URL. at least. every Action tells the Struts environment which successive step to call. The ActionMappings are described fully in the configuration file and follow the pattern of the example below: <action-mappings> <action path = ‘/logon’ type = ‘com.do’ . You can use the optional attributes prefix and suffix to control the automatic mapping of the request parameters to the ActionForm properties.isa. To do this.jsp’ scope = ‘request’ validate = ‘true’ > <forward name = ‘success’ path = ‘/showShops. An Action type can be assigned to different URLs. the optional attribute scope declares the scope of the ActionForm.. If global and local names are identical. but only one instance of this Action is used in the context of the ActionServlet.do’ /> <forward name = ‘register’ path = ‘/register. the Action tells the ActionServlet how to ‘logically’ continue when it exits the perform routine.struts.0 ActionMapping Every Action is embedded in an ActionMapping instance. The forward tags can be used both in the individual Action tags and globally for all Actions. the local declaration overrides the global one. This attribute emphasizes an Action that is used when an Action is called that has not been implemented and/or declared.findForward(‘logon’)). The optional attribute name assigns an ActionForm to the current ActionMapping.LogonAction’ unknown = ‘false’ name = ‘logonForm’ prefix = ‘isa_’ suffix = ‘_isa’ input = ‘/Logon.Development and Extension Guide – SAP E-Commerce 7. Finally. The forward tag in the configuration file declares the actual direction for the execution flow. The default value of this attribute is false.sap.. August 2008 43 . InitAction is a special Action with the following tasks: Checks if the given XCM configuration is already loaded o o If not. You can use the request parameter nextAction to pass the logical forward on to the InitAction. the client is given a URL and is transferred to it via a request.sap.InitAction The InitAction should always be the first Action when starting an application. If no session exists yet: o o Initializes the session. ISA Actions The following Actions are used when developing or extending an ISA application. In the latter case.Development and Extension Guide – SAP E-Commerce 7. BLS layer for the given configuration is initialized (Backend Objects and connections).isa.do?nextAction=logon performs the initialization and branches to the logon forward (a corresponding forward must be defined in the configuration file).jsp’ /> </global-forwards> The optional attribute redirect controls whether the server will perform the forwarding (value false) or whether the client browser has to (value true). This will give you a better understanding about the application as well as possible extensions. Sets up/initializes specific objects. Notifies the Business Object layer about clean up.jsp’ redirect=‘true’ /> path=‘/error. This action ensures that the ISA framework is initialized correctly when a new session is initiated. then XCM configuration is loaded. For example: http://localhost/isa/b2c/init. The default setting is server-side forwarding.0 Example: Global declaration <global-forwards> <forward <forward name=‘logon’ name=‘failure’ path=‘/logon. If a session already exists: o o Cleans up the session. This is dependent on the language request parameter.core. ISA extension of Struts This chapter discusses some Internet Sales specific extensions to the struts framework. August 2008 44 . respectively the language entry from the web. com. The URL http://localhost/isa/b2c/init.do performs the initialization and branches to the success forward defined in the InitAction.xml file. Sets the session locale. BaseAction is responsible for checking whether or not the current session is valid. The perform routine is specified with final in the BaseAction to prevent it from being inadvertently overwritten. In addition.sapmarkets. ActionForm form.action.sap. { // some logic return mapping. it is forwarded to session_not_valid. If it is not.EComBaseAction This Base class provides easy access to Meta Business Object Managers. public class A1Action extends BaseAction { public ActionForward doPerform( ActionMapping mapping.. This check and any forwarding are transparent for the A1Action. Example: General example for using BaseAction. If the session is not valid. HttpServletRequest request.) routine.isacore... and contains an abstract method doPerform from the signature of the Action::perform(. HttpServletResponse response) throws . it is forwarded to ‘session_not_valid’.Development and Extension Guide – SAP E-Commerce 7. August 2008 45 .. All ISA Actions implement the doPerform routine. BaseAction has an auxiliary method: protected ActionForward isStateValid(ActionMapping mapping. then doPerform (. If the state is OK. HttpServletRequest request) This method checks the state of the application and returns a forward to state_not_valid should any problems arise.findForward(‘success’). If the session is valid.core. BaseAction itself specializes the Struts Action. A1Action::perform() Checks the session state.BaseAction All application-specific ISA Actions specialize the abstract class BaseAction.0 com.isa.isa. Process flow: ActionServlet ---> calls A1Action::perform() This method is implemented in BaseAction..) is called. then doPerform() is called and the action-specific statements are executed. } } com. jsp"/> <forward name="user_no_login" path="/appbase/error. /** * Initialize the action.action.sapmarkets.do"/> </global-forwards> This leads to the following error message: Figure 11: Error Message user_no_login Extended actions can use the property checkUserIsLoggedIn to change the behavior dynamically e.0 com.ActionForward"> <forward name="login" path="/b2b/login/login.apache.isacore. If the user is not logged in the action returns the logical forward Constants.EComExtendedBaseAction The EComExtendedBaseAction extends the EComBaseAction with a check if the user is logged in.equals(CONSTANTS. } } August 2008 46 .B2C)) { this.isacore.checkUserIsLoggedIn = false.USER_NO_LOGIN (user_no_login) Example: <global-forwards type="org. A UserBase object must exist in one of the used business object manager and the corresponding business object manager must implement the UserBaseAware interface.isa.action.Development and Extension Guide – SAP E-Commerce 7.g. * In B2C this action could be used by anonymous user.action. depending from the application in the initialize method. * * @see com.IsaCoreBaseAction#initialize() */ public void initialize() { if (getApplication().sap.isa.struts. getUserSessionData(request.g. com. that you added the file to a source folder (e. Changing language dependand resource keys Using the struts message resource concept.g. Open WEB-INF/config. and this instance is recorded in the session scope.core.action. The following changes need to be done to add a project specific resource file to a web application: 1. it is very easy to change or add resource keys in a way which minimizes integration collision when applying patches or new service packs.crm~isa~web~user~isar3. the IPC.sap. This action is usually used when developing new functions related to the existing functions.sap.g.sap. E.crm~isa~accessibility~resources. The attributes are recorded under a modified key in the session scope through this object.isa. 3. Create a new xlf file for the customer project in the web applications development component or in a shared web component. A separate project specific xlf file instead of modifying the standard file avoids integration conflicts completely. Check in the config file.crm~isa~xcmadmin~resources.xlf 2.properties file. Make sure.isa.core. or when extending existing functions.isa. crm~isa~xcmadmin~resources" null="false" factory="com.crm~isa~shopadmin~resources. An instance of this type is created for each session the first time the InitAction is run. crm~tc~user~resources. The following code sequence within an Action retrieves a reference to a UserSessionData object: // get user session data object UserSessionData userSessionData = UserSessionData.Development and Extension Guide – SAP E-Commerce 7. projectfile. src/packages or src).crm~tc~appbase~resources.0 com. Add the filename of the xlf at the first position of the message-resource elements attribute E. Check in this file and the .MessageResourcesFactory"/> 4. and can therefore only be read again via this specific object.getSession()).IsaCoreBaseAction This Base class provides easy access to Business Object Managers of the ISA core functionality. Edit the struts config file of all applications which need to use resources from that xlf file. You have to overwrite the isaPerform() method when using this Action as base action.isacore. August 2008 47 .xml in crm/isa/web/shopadmin and add projectfile to the filename list of the parameter attribute <message-resources parameter ="projectfile.UserSessionData All the ISA attributes created in the session scope have to be addressed via an object with type UserSessionData.customizing. crm~tc~core~resources. and the catalog. Attackers can manipulate fields and hidden fields.sap. Additional Information For additional information about working with the Interaction Layer refer to chapter 'Introduction to Extension Concepts' on page 168.isa. This is usually data shown/manipulated after logging on to the application (which in in B2C rather late) Identify the actions in your coding which trigger creation of this data Identify the actions in your coding which are used to show this data.util. Most of the protection techniques mentioned in this chapter are not related to Internet Sales and well coverd in books and on the web. Secure Programming This chapter gives some programming guidelines which help you to write robust and secure code.core. to try to bypass the applications security mechanisms Guideline Validate ALL parameters before using them! It does not matter whether these are fields or hidden fields Parameters should be validated against a positive value: Minimum and maximum length Whether null is allowed Whether the parameter is required or not Numeric range Specific legal values (enumeration) Specific patterns (regular expressions) First focus on data in your area which is sensitive from the security point of view. It merely shows the most common attacks and guidelines how to and make the life of a hacker harder.DataValidator class provides some methods for validation (isInRange. Look at the Netweaver IDE’s online help for more details about xlf files. This chapter contains neither a complete list of possible attacks nor a comprehensive tutorial how to prevent them. The com. matchRegexp) Check what happens if content of data has invalid values (see next table). Input Validation Web applications use input from HTTP requests (and occasionally files) to determine how to respond. You will possibly have to do further more complex checks depending on your application logic If all validations are handled by the backend you do not need to do the check in Java again. Take a look at this actions: If data is not passed directly to JCo but further processed in Java you have to check if the data is correct. August 2008 48 .0 The message-resources will search a certain resource key in the first entry of the filename list first.Development and Extension Guide – SAP E-Commerce 7. idEmail. Development and Extension Guide – SAP E-Commerce 7.01.2004 31-Feb-2003 Error Message Error Message Error Message All data none or all "test" or 'test' Message. it will tend to not show up at times. Table 11: Input Validation August 2008 49 .0 Input Field Semantics Number Field Number Field Number Field Incorrect Data / Boundary Data Alphabetical Entries Wrong Number Formats Numbers out of normal application range Example qwert 123. specially when encoded. either error or truncation warning valid. but input field same as limited lenght The character <Enter> (Based on application) The basic handling of the <Enter> character.123 4711 if range: 1 to 10 Possible Expected Result Error Message Error Message Error Message Date / Time Date / Time Date / Time Search Field Criterion Search Field Criterion Search Field Criterion String of limited length String of limited length Mandatory Field Alphabetical Entries Wrong Date Formats Invalid Dates * empty string Quotes Very long string 1234567 01/01/04 if date format 01. possibly Error Message (Based on application) Empty String Blank String Field represents an id Field is not a text area.123. ” Or a “#” May be required under certain circumstances of address entry. Introduce an additional level of check in the cookie usage where critical data is involved Do not store sensitive data in cookies. XSS attack The following string: "><script>window. This type of data includes. encoding etc.alert('Hello' ).0 Input Field Semantics General Input Fields Incorrect Data / Boundary Data Special characters Example ~!@#$%^&*()=+{}\|[ ].) is read and processed by application Guideline Please omit using HTTP header information Persistent Cookies Persistent Cookies are stored in an un-encrypted format on the client side. Header information (e.g.Development and Extension Guide – SAP E-Commerce 7./?<>"':. If you plan to use persistent cookies in your extension make sure that no action accepts cookie data without validating it. but is not limited to: User specific data Internal Data Application critical data August 2008 50 . <tab><enter>\u Possible Expected Result Error Messages (Based on application) Omit some characters if there are cases where some characters are allowed. mime type.. Cookies are not validated by the back-end. for example a “. Content of cookies can be accessed or manipulated by unauthorized persons Guideline Please omit using persitent cookies.” or a “.</script> Table 12: Input Validation No pop up after submiting the request HTTP Header Information Similar to Input Validation (because part of HTTP request). 0 Cross Site Scripting Cross site scripting (XSS) is a technique.) into Web pages in order to steal user data. etc. ActiveX.Development and Extension Guide – SAP E-Commerce 7. injects malicious script in guestbook 5 e. where an attacker tries to insert scripting (JavaScript. encapsulate the outputted string by the method JspUtil.g. identify the dynamic output. Identify JSPs for potential XSS vulnerabilities.g. session cookies are send to attacker's web server hijacks session 6 victim Web Server / J2EE Engine 2 In case of stored attack injected code is permanently stored Shop 3 Requests infected page Malicious code is executed 4 Figure 12: Possible Attacks Guideline The fundamental issue is that XSS can happen when an unauthorized script is executed on the client side out of a generated page on a server. Most severe attacks (general): Disclosure of the user’s session cookie. allowing an attacker to hijack the user’s session and take over the account Redirecting the user to some other page or site. Within the JSPs. typically marked by <%= %> To protect against such an attack. and modifying presentation of content Exploitation of browser vulnerabilities by executing malicious Script The following figure depicts a possible attack: attacker Web Server Shop 1 Triggers XSS attack e.encodeHtml(String input) August 2008 51 . Guideline Do not trace sensitive data in your application coding neither during normal operation nor in case of an error Use the nolog_ prefix when naming parameters containing sensitive data e. Any comments in the generated HTML can turn out to be meaningful to hackers.0 Error Handling If the application encounters an error no data must be shown exposing application/infrastructure details (e. An attacker can scan through log/trace files and get this information.Development and Extension Guide – SAP E-Commerce 7. stack-traces. Guideline Your action should extend the class EComBaseAction which makes sure that a session is valid and the user is logged on. nolog_myAccountNumber Comments in HTML Code You do make HTML comments in JSP. exceptions. => If this is overlooked. This makes quality assurance and testing of this functionality easier.g. Do not develop your own authentication mechanism (e. On the other hand showing such information can be useful while testing the application. Logging/Tracing Sensitive data is traced in the application coding. potentially a user could type in the URL and look at data not intended for him/her. password change etc) The application has to make sure that the user has a valid session and is authenticated before executing code. See chapter Message Framework on Page 91. August 2008 52 .g. User Session/Authentication Functionality for authentication has to be centralized.g. trace/log messages). Solution Use the central error page. Which information is show in case of error should be controlled in a central place by one code base. August 2008 53 . %> user name --%> Support of Web Standards (only B2C) Introduction This chapter gives you a guideline how to write web standard compliant application which includes a frameless page structure. basket. <%-. product detail etc. It is obvious that we have to render one page with four screen areas.).Development and Extension Guide – SAP E-Commerce 7. Frameless JSP pages Introduction The following is the screen layout of the current B2C solution. The layout structure will be defined declarative in a XML-File managed by XCM.println(name). workarea header work area minibasket navigator Figure 13: Layout areas of frameless JSP pages So a given layout with the used components in the layout areas defines a possible screen design.0 Guideline Use JSP Comments or java comments. browser back and bookmark support. Each layout area includes one active component (like header. We call such an arrangement of screen areas a layout.print <% // print user name out. The layout will be controlled in the struts configuration file with a set of commands.jsp”> <UIArea name ="header" <UIArea name ="workarea" <UIArea name ="miniBasket" defaultComponent="header" cssIdName=”header” /> defaultComponent="basket" cssIdName =”workarea” /> defaultComponent="miniBasket" cssIdName=”minibasket” /> </UILayout> <UILayout name="catalogLayout” path=”/appbase/layout/genericLayout.inc.jsp”> <UIArea name ="header" <UIArea name ="navigator" defaultComponent="header" cssIdName =”header” /> defaultComponent="catalogcategories" controlledArea="workarea" cssIdName =”navigator” /> <UIArea name ="workarea" defaultComponent="catalogentry" cssIdName=”workarea” /> <UIArea name ="miniBasket" defaultComponent="miniBasket" cssIdName=”miniBasket” /> </UILayout> <UIComponent name="header" <UIComponent name="basketEmpty" <UIComponent name="basket" <UIComponent name="miniBasket" <UIComponent name="checkout1" <UIComponent name="confirmation" page="b2c/header.inc.do"/> action="catalog/showproductdetails.do"/> action="b2c/showconfirmation. These commands allow to set the layout or to set components or component pages.do"/> action="catalog/showcatalogentry.do"/> <UIComponent name="catalogcategory" <UIComponent name="catalogentry" <UIComponent name="productDetail" </UILayouts> action="catalog/showcatalogentry. which can used in the forward tag. If you migrate an existing web application it is maybe necessary to separate the data displaying for the processing in new action. August 2008 54 .Development and Extension Guide – SAP E-Commerce 7.0 Example: <UILayouts> <UILayout name="basketLayout" path=”/appbase/layout/genericLayout.do"/> Beside the layout information also components will be defined.do"/> action="b2c/showcheckout1.do"/> action="b2c/showminibasket.do"/> <UIComponent name="catalogcategories" action="catalog/showcategories.jsp"/> action="b2c/showbasket. With this we got a strict separation between data processing and data displaying. A component includes either directly a JSP or an action which provide all the data necessary on the JSP and defines then the used page include (see the UIInlude command for details).jsp"/> page="b2c/basketEmpty. The last action which is called must extend the com.Development and Extension Guide – SAP E-Commerce 7. This character is used as a hot spot for the top of the layout.0 Example: <action path="/base/start. You can add or extend the available layout data in the WEB-INF\xcm\sap\modification\layout-config.1 form tag 1.n html attribute tags 0. In this case the title of current component in this area is used.b2c.xml file The structure of the UILayout tag Field Name Path Title titleArea hotSpot navigationText hotSpotBottom navigationTextBottom action Description Name of the layout. which is used in the HTML title tag..n area tags Table 13: Structure of the UILayer Tag BodyAttribute Form UIArea August 2008 55 . This character is used as a hot spot for the top of the layout. Define your components in the layout-config.core. The HTML title can also depend on the component in the here defined area.ControlLayoutAction.xml file Create your action for your components Create the jsp includes Control the layout and the components within the struts config.sap.action.. 0. Resource key for title.xml file Structure of the layout-config. You find this file under WEB-INF\xcm\sap\modification.StartAction"> <forward name="success" path="UILayout:catalogLayout[header=header.. The forward to the corresponding layout jsp.sapmarkets.do" type="com...workarea=error]"/> . Action which is called before layout is displayed and all component action are performed.action. Contains a resource key to give a short explanation for the accessibility mode.xml The layouts are defined in the layout-config. </action> At all you have to process five steps to reach a frameless layout: Defining layout in the layout-config.workarea=catalogentry]"/> <forward name="error" path="UILayout:catalogLayout[header=header.isa.isacore.xml file.xml file. Contains a resource key to give a short explanation for the accessibility mode.isacore. Table 16: Structure of the UIArea Tag cssIdName hotSpot navigationText August 2008 56 .. Contains a resource key to give a short explanation for the accessibility mode. a navigator area controls the work area). Action which is used in the HTML form.Development and Extension Guide – SAP E-Commerce 7. UI component which used in this are by default. Table 15: Structure of the HTML Attribute Tag The structure of the UIArea tag The layout object includes a list with the existing layout area. Allows to define an area which is controlled by this area (e. Id of the HTML form. Field name id action method Attribute Description Name of the HTML form. The value could be used on JSP to provide the “uitarget” parameter. Field name value Description Name of the HTML tag.n html attributes tags Table 14: Structure of the Form Tag The structure of the HTML attribute tag The html attribute object describes a HTML attribute. 0. Method attribute of the HTML form tag.g. Value of the HTML tag.0 The structure of the Form tag The form object includes a global HTML form which is using for the complete layout. Id used within the CSS file to format the screen area This character is used as a hot spot for this area. And each layout area holds the information over the currently used component Field name defaultComponent controlledArea Description Name of the layout area. jsOnload Name of a Java script function which should be call.Development and Extension Guide – SAP E-Commerce 7. You have to put your java script coding in parentheses in the include file. to control the appearance and the position. Field name cssIdName startArea endArea Description Name of the area container. Table 18: Structure of the UIComponent Tag August 2008 57 . while the onload event. For this container an own style sheet can be defined. The name of the last area in the container. Resource key for title. which is used in the HTML title tag. Page to be displayed in this component Action to perform before display the page.jsp”> <UIArea name ="header" defaultComponent="header" cssIdName =”header” /> <UIArea name ="navigator" defaultComponent="catalogcategories" controlledArea="workarea" cssIdName =”navigator” /> <UIArea name ="miniBasket" defaultComponent="miniBasket" cssIdName=”miniBasket” /> <UIArea name ="workarea" defaultComponent="catalogentry" cssIdName=”workarea” /> <UIAreaContainer name ="toolBar" cssIdName="toolbar" startArea=”navigator” endArea=”miniBasket” /> </UILayout> The structure of the UIComponent tag Field Name page action title jsInclude Description Name of the component. Id used within the CSS file to format the area container The name of the first area in the container. The page will be set with the UIInclude command. Could also be set with the UIJsInclude command in the struts configuration file. Table 17: Structure of the UIAreaContainer Tag <UILayout name="catalogLayout” path=”/appbase/layout/genericLayout. which includes only java script coding. Name of a JSP include.0 The structure of the UIAreaContainer tag A UIAreaContainer allows grouping a sequence of areas into one „div” container. Prefix which could be used for an alternative alt key generation. This flag allows to avoid problems with other layout versions.sap. If you plan to use the UIArea (see Control the layout on Page 59 _Control_the_layoutfor detail) you have to add the request parameter com. The action should never process data. Use always the constant instead of the value. The JSP include will be set in the struts configuration file.inc.getUiTarget()%>"/> </isa.core.Development and Extension Guide – SAP E-Commerce 7.js.) Please use the following name conventions for the includes: JSP: <jspname>. (Contact our JavaScript representative if you maybe can reuse some existing functionality. Example: <% MyUIClass ui = new MyUIClass() %> <isa.isa.0 The structure of the UIConfiguration tag The UIConfigurationobject includes a global configuration data which is valid for the complete layout. Version key for bookmark support. Remove now the HTML header and body tag.jsp If the JSP already exists make a copy or rename the file regarding the naming convention.Constants.inc.RP_UITARGET%>" value="<%=ui.webappsURL name="catalog/switchToBestseller"> <isa:param name="areaId" value="<%=aeraGuid%>"/> <isa:param name="<%=Constants. Table 19: Structure of the UIConfiguration Tag altKeyPrefix Create your component actions Keep always in mind that the action should only provide the data so it can displayed within the JSP. Create your JSP includes If you create new JSP you should separate HTML and JavaScript coding in different includes.webappsURL> August 2008 58 . Remove also the isa:contentType and the isa:include tag. If necessary split existing actions in two parts if they are including data processing and data providing. Field title version Description Title to be used for all HTML pages.jsp JavaScript: <javascriptname>. where no other title is defined. Therefore it is possible to reuse the action also in frame application. You have also to adjust the links which are used in the page.RP_UITARGET. Bookmarks could only be reactivated if the version of the layout is equal. Use always this method instead of hard coded values.area2=componentX] You could pass the name of the layout and also a list with all areas and the names of the components which should be used within the area. Example: <action path="/base/start. </action> August 2008 59 .StartApplicationAction"> <forward name="success" path="UILayout:catalogLayout[header=header.action..0 Use the method getUiTarget of the BaseUI class to get the name of the current displayed layout area or the name of the controlled area (see The structure of the UIArea tag on Page 56 for details). </action> 2.isacore.do" type="com.action.isacore.. Example: <action path="/base/start.Development and Extension Guide – SAP E-Commerce 7.workarea=error]"/> ..workarea=catalogentry]"/> <forward name="error" path="UILayout:catalogLayout[header=header.workarea=error]"/> .workarea=catalogentry]"/> <forward name="error" path="UILayout:[header=header.sapmarkets.StartApplicationAction"> <forward name="success" path="UILayout:[header=header.do" type="com..area2=componentX] You could pass also only a list with all areas and the names of the components which should be used within the area. If an area is not listed the currently used or the default component will be used. The complete layout could be defined: UILayout:layoutName[area1=componentX. if it is defined.sapmarkets. If an area is not listed the currently used or the default component will be used. Define only the areas in the current layout: UILayout:[area1=componentX. Control the layout The layout and the components will be controlled with commands in the struts configuration file: UILayout The UILayout command set the layout in the struts configuration file: There will be the following possibilities: 1. action. But it is also possible to overrule the context value for the used target area. Example: <action path="/base/navigate.sap. August 2008 60 .Constants. Layout Processing While the layout processing the current layout will be prepared for the display. The current layout area will be set automatically within the webappsURL tag.UpdateBasketAction"> <forward name="success" path="UILayout”> </action> The UILayout also starts the Layout processing.isa.CV_UITARGET instead of the value.action.core. Use always the constant com..do" type="com com. The value is set to the name of the current area or the name of the controlled area if it is defined. Update the current layout. Therefore the action assigned to the layout and all actions which are assigned to the current valid components will be performed. UIArea The UIArea command set the current layout area in the struts configuration file. Only the layout will be defined: UILayout:layoutName If you pass the name of the layout with the areas the currently used or the default component will be used.isa.Development and Extension Guide – SAP E-Commerce 7.core.0 3. See the example how to do it.sapmarkets.isacore.isa. </action> 4.. Example: <action path="/base/updateBasket" type="com.EComGetForwardAction"> <forward name="catalog" path="UILayout:catalogLayout"/> <forward name="basket" path="UILayout:basketLayout"/> .sapmarkets. After this preparation the page assigned to the layout will be displayed. UILayout In this case no parameter will be passed to the command. webappsURL name="catalog/switchToBestseller"> <isa:param name="areaId" value="<%=aeraGuid%>"/> <isa:param name="<%=Constants.marketing.do" type="com.isacore. %> <isa.action.core. UIInclude If a component uses the action instead the page the used page must be delivered within in the struts configuration file using the UIInclude command.action.. UIJSInclude If a component uses the action instead the page the used JavaScript include could be set within in the struts configuration file using the UIJSInclude command.jsp"/> </action> It is not allowed to combine the UILayout.sapmarkets.webappsURL> The next example shows how the UIArea command looks like in struts configuration file: Example: <action path="/base/switchToArea.ShowCatalogEntryAction"> <forward name="showcatalogentry" path="UIInclude:/b2c/marketing/catalogentry.isacore.sapmarkets.CV_UITARGET%>" value="<%=ui. Example: <action path="/b2c/catalogEntry" type="com.b2c.Development and Extension Guide – SAP E-Commerce 7.0 Example: <% String workarea = " workarea ".inc.SetCatalogArea"> <forward name="success" path="UIArea:catalogcategories"/> <forward name="error" path="UIArea:error"/> .isa. August 2008 61 .. </action> The UIArea also starts the Layout processing. UIArea and the UIInclude commands.getUiAreaKey(workarea)%>" contextValue=”true”/> </isa. Dynamic change of HTML title There is the possibility to change the title of the HTML page depending of the content of a defined layout area. titleArg1. for confirmation b2c.marketing.do" title="b2c.title.jsp" /> <Component name="basket" action="b2c/showbasket.general"> <UIArea name ="header" defaultComponent="header" cssIdName="header" /> <UIArea name ="workarea" defaultComponent="basket" cssIdName ="workarea" /> <UIArea name ="miniBasket" defaultComponent="miniBasket" cssIdName="minibasket" /> </UILayout> <Component name="basketEmpty" page="b2c/basketEmpty.title. confirmation"/> </UILayouts> If the component basket is displayed the title b2c. If this title is empty the layout title is used.jsp "/> </action> After the UIJSInclude command must follow always a UIInclude command.basket"/> <Component name="checkout1" action="b2c/showcheckout1.js. UIInclude:/b2c/marketing/catalogentry.do" title="b2c.sapmarkets.ShowCatalogEntryAction"> <forward name="showcatalogentry" path="UIJSInclude:/b2c/marketing/catalogentry. This can be done with the titleArea attribute of the UILayout object. If this attribute is set. Example: <UILayouts> <UILayout name="basketLayout" path="/appbase/layout/genericLayout.basket is used.inc.inc.general of the layout object is used.title. titleArg2 and titleArg3.jsp" titleArea="workarea" title="b2c.title.action.title.confirmation and if the component is basketEmpty the default title b2c. This attribute could be used in the layout as in the component tag.checkout"/> <Component name="confirmation" action="b2c/showconfirmation. the title is taken for the current component in this area.Development and Extension Guide – SAP E-Commerce 7.title. In addition it is possible to define up to 4 arguments which could be used in the title with the attributes titleArg0. August 2008 62 .isa.isacore.inc.jsp.do" title="b2c.0 Example: <action path="/b2c/catalogEntry" type="com.title. title.getDocNumber()).ControlLayoutAction class.checkout=Checkout order with number:{0} The attributes describes the name of request attributes.do" title="b2c.action.checkout" titleArg0=”order_Number”/> With b2c. Therefore the attributes must be filled with reasonable values in actions.jsp" action="/b2c/ajustBasketLayout.Development and Extension Guide – SAP E-Commerce 7. Layout changes are valid only for the current request.0 Example: <Component name="checkout1" action="b2c/showcheckout1. It these cases one can define a controller action for the layout.do"> <UIArea name ="header" defaultComponent="header" cssIdName="header" /> <UIArea name ="workarea" defaultComponent="basket" cssIdName ="workarea" /> <UIArea name ="miniBasket" defaultComponent="miniBasket" cssIdName="minibasket" /> </UILayout> </UILayouts> August 2008 63 . Dynamic changes of the layout Under some circumstances it is reasonable to change the layout dynamically.isacor. (At least the last action which is called in an action chain should extend this class).sap. Example: <UILayouts> <UILayout name="basketLayout" path="/appbase/layout/genericLayout.isa. order.title. This action must extend the com. request.setAttribute(“order_Number”. g. UserSessionData userSessionData.CheckLoginAction"> <forward name="login" Path="UIStoreLayout.UIStoreForward:profile.setHidden(true).isacore. the catalog layout) and then switch to the login layout to perform the layout. } } Support of navigation issues The layout and the components will be controlled with commands in the struts configuration file Sometimes the transition from one layout to the next will be interrupted e. This allows to store an arbitrary layout. The UIStoreForward stores a given the logical forward (e. The context values used in this layout will be lost! Use this command only with layouts which doesn’t use context values (see chapter Usage of context values on page 68 for details).action. HttpServletResponse response. Beyond the UIStoreLayout command supports also the full syntax of the UILayout. For this case we will provide an easy mechanism to handle such issues. After that the developer pops the needed layout from the stack. CommunicationException { // hide header layout.0 public class AdjustBasketAction extends ControlLayoutAction { public void controlLayout( ActionMapping mapping.b2c.sapmarkets. MetaBusinessObjectManager mbom. The developer could now push the current layout to the stack (e. which demonstrates how to handle the login before the marketing profile will be displayed: Example: <action path="/b2c/gotoProfile" type="com. ActionForm form. UIStoreLayout & UIStoreForward With the UIStoreLayout command the current layout will be stored for later use. Unfortunately there is big restriction.isa.UILayout:loginLayout"/> <forward name="success" path="UIArea:marketingProfile"/> </action> August 2008 64 .getUiArea("header").g. for a login request or for the display of an error message.Development and Extension Guide – SAP E-Commerce 7. Following an example. HttpServletRequest request. The idea is to introduce a stack of layouts and logical forwards. profile). UILayout layout) throws IOException. ServletException.g. DisplayLoginAction"> <forward name="succes" path="UIStoreAction:/b2c/display.UILayout:loginLayout"/> </action> Example for the fallback (see UIGetLayout & UIGetForward on Page 66) <action path="/core/forwardToAction" type="com. But there is a restriction. Beyond the UIStoreAction stores the current context. August 2008 65 . This is very useful in combination with the UIStoreLayout and UIStoreForward commands. UIStoreAction With the UIStoreAcrtion command the current processed or a given action will be stored for later use. UIArea. UIInclude or the UIAction command.do.0 The UIStoreLayout and UIStoreForward can’t be the last command. Following an example.sapmarkets.isa. UIArea. There must always follow the UILayout.isacore.action.b2c.Development and Extension Guide – SAP E-Commerce 7.isacore. UIInclude or the UIAction command.isa. There must always follow the UILayout.EComGetForwardAction"> <forward name="default" path="UILayout:catalogLayout[workarea=catalogentry]" /> </action> The UIStoreAction can’t be the last command. The information is not stored stateless and therefore the information is lost if you set a bookmark. Therefore you have to provide the fallback action “default” if the context is lost. which demonstrates how to handle the login before the marketing profile will be displayed: Example: <action path="/b2c/showLogin" type="com.action.sap. UIAction With the UIAction command you could combine a normal path value with the UI commands. isa.CheckLoginAction"> <forward name="login" path="UIStoreLayout.isacore.sapmarkets. The UIGetForward command gets the logical “forward” and passes it to the “/base/getCoreForward” action.isacore.isa.Development and Extension Guide – SAP E-Commerce 7.do"/> <forward name="success" path="UIArea:marketingProfile"/> </action> UIGetLayout & UIGetForward The UIGetLayout take the layout which is stored with the UIStoreLayout and use this as current layout.sapmarkets.UIPopForward calls always the base/getCoreForward action --> <action path="/base/getCoreForward" type="com.isa.0 Example: <action path="/b2c/gotoProfile" type="com.EComGetForwardAction"> <forward name="profile" path="/b2c/gotoProfile.isacore.action.b2c.LoginAction"> <forward name="success" path="UIGetLayout.b2c.sapmarkets.action. Beyond the command restore the action stored with UIStoreAction In our example this calls the marketing profile action again: Example: <action path="/b2c/login" name="loginForm" type="com.UIStoreForward:profile.UIAction:/b2c/secureLogin.UIGetForward"> </action> <!-.do"> </action> The UIGetForward commands must be the last command in the line. August 2008 66 .action. Development and Extension Guide – SAP E-Commerce 7. You must not take care of storing the context values in the request and getting the context values from the request. The context values must provide all information which is necessary to recover the page entirely. The framework allows putting and getting context values to/from the request context. if last command No No No No No Redirect allowed no no no yes yes Table 20: Global UI Commands Commands while Layout processing Command UIInclude UIJSInclude Position in the Path Last command Not the last command Continued Layout Output yes No Redirect allowed no no Table 21: Commands while Layout Processing Browser Back Support Typically problems with the browser back button occur because the context on the client differs from the context on the application server after the customer has pressed the back button one or several times. catalog). which allows storing context information within the request context. the basket) and stateless objects (e.0 Summary of the UI Commands Global Commands Command UILayout UILayout:name UIArea UIAction UIStoreForward UIStoreLayout UIGetLayout UIGetForward Position in the Path Last command Everywhere Everywhere Always last command. Never provide context information to JSP’s without the framework. which is necessary to recover the state of the page.g. Not the last command Not the last command Not the last command Always the last command Start Layout Output yes Yes. August 2008 67 . For the stateless approach it is necessary to hold all information on the page. Our Browser Back Support provides with the Context Values such a framework.g. The user does not expect that his basket will be changed while he navigates with browser back and forward button. But he expects that the catalog hold no information about his state (That means if the user presses the refresh button he expect to see the same content which was already displayed on the page). Therefore we have to ensure that the contexts are in “sync” when the request will be processed. First we have to distinguish between state full objects (e. if last command yes. InitB2BAction Table 22: Registration of Context Values Example /** * Initialize Context values.registerValue(Constants. true. GlobalContextManager. There is no support of optional context values in the 7. because the size restriction of the HTTP header.CV_LAYOUT_STACK.registerValue(Constants.InitAction com.sap.0 release.action. In this case it is possible to store a list of values under the same name.isacore.b2b. Therefore you have to register your context values first (see chapter ‘Registration of context values’ below).xml.sap. Try to use as less obligatory context values as possible. August 2008 68 .CV_FORWARD_STACK. <br> */ Static public initContextValues () { GlobalContextManager. true). GlobalContextManager.isacore.isa. true).Development and Extension Guide – SAP E-Commerce 7. Registration of context values The registration should be done in the static method initContextValues of some central action classes: Usage Used in all Ecommerce Applications Used in B2B and B2C Only used in B2C Only used in B2B Action com. false).0 Usage of context values It is possible to define a multi context value. true.registerValue(Constants.b2c.isa.isa.action. true.sap.CV_LAYOUT_NAME.action.InitB2CAction com.isacore. This allows to control which Context value should be used in which application. All classes which should be used in an application must be defined in int-config.isa.core.sap. } The constants for the context value names should be defined in one central file in the surrounding development component.IsaCoreInitAction com. sap. August 2008 69 . With the changeContext method it is also possible to modify the existing context.InitB2CAction"/> </initialization> Use always the constants instead of the value name directly.isa.sap. Delete all existent multiple values. Example String productKey = getContextValue (Constants.ui.core.isacore.sap.Development and Extension Guide – SAP E-Commerce 7.action. Add a value to the context values. Return the list of context values from the already existing context.Initialize Context values used by the application --> <initialization className="com. Change the context value in already existing context. Set the given value for the context value. changing and getting context values (see Java Doc for details).actions. This ensures that only needed information is stored within the context.isa.sap. have to provide its context value again to the context. The method allows changing exiting values in one action (data processing) and use them while the data displaying. The constants should have always the prefix CV_. productKey). Name getContextValue setContextValue changeContextValue getContextValues resetContextValue addContextValue Single Value X X X X X X X Multi Value Description Return the context value from the already existing context.InitAction"/> <param name="2" value="com.catalog.CT_PRODUCT_KEY.ISAEntryAction"/> <param name="3" value="com. Getting and setting context values The BaseAction will have methods which allow the setting.core.b2c.CV_PRODUCT_KEY). which prepare the display of data.isa.ContextInitHandler"> <param name="1" value="com. Table 23: Overview Context Values There will strictly distinguish between the old and the new context.0 Example <!-. The value will also automatically transfer to the new context to allow a redirect between processing and display. Therefore all actions.isa. … setContextValue(Constants.context. getUiAreaKey(workarea)%>" contextValue=”true”/> </isa. %> <isa. changeContextValue(Constants. This is by default set to false. In the following example the catalogue area will be changed only by Example: <% String workarea = " workarea ".sap.CV_UITARGET%>" value="<%=ui. Therefore one defines a param tag with the name of the context value and set the contextValue attribute to true. Overruling context values in an url It is also possible to overwrite obligatory context value in a URL generate with the webappsURL tag. Example: Action 2: displaying the current product String productKey = getContextValue ("CV_PRODUCT_KEY").do" redirect=”true”/> </action> String productKey = (String)request.0 Example: Action 1: getting new product id to display Here some examples how to introduce redirects: <action path=”/b2c/display” forward=”UILayout” /> <action path="/b2c/addtobasket" type="com.CV_PRODUCT_KEY.AddToBasketAction"> <forward name="success" path="/b2c/display.order. setContextValue("CV_PRODUCT_KEY".webappsURL name="b2c/display.Development and Extension Guide – SAP E-Commerce 7.action. productKey). productKey).do"> <isa:param name="areaId" value="<%=aeraGuid%>"/> <isa:param name="<%=Constants.webappsURL> August 2008 70 .getParameter("PRODUCT_KEY").isacore.isa. Example: Here some examples how to introduce redirects: <action path=”/b2c/display” forward=”UILayout” /> <action path="/b2c/addtobasket" type="com.SavePersonalDetailsAction"> <forward name="success" path="UIArea:addressConfirmation. E. it is useful to introduce a redirect after some action. If you use the post method you have to introduce a redirect in any case.order. Implement a fallback.do" redirect=”true”/> </action> <!—last action called after the succesful login --> <action path="/b2c/addBusinessPartner" type="com.order.isa.sap.sap. display a message using MessageDisplayer object. In contradiction the context values will be available after redirect because they are encoded in the redirected URL.isa. To perform a redirect the redirect flag in the struts forward have to be set to true. if the context values could not be found.action.action.) Set context values only in component actions.b2c. Redirect after form submit To avoid strange effects if the user presses the F5 button to refresh the page.isacore. Be aware that all request parameter will be lost if you perform a redirect.UIAction:/b2c/display" redirect="true"/> </action> August 2008 71 .AddToBasketAction"> <forward name="success" path="/b2c/display.AddBusinessPartnerToBasketAction"> <forward name="main_inner" path="UIGetForward" redirect=”true”/> </action> <action path="/b2c/savePersonalDetails" type="com.isa. (E. the user adds a product to the basket.Development and Extension Guide – SAP E-Commerce 7. He rather expected that the current page will be refreshed.isacore.g.action.isacore. He doesn’t expect to add the product again if he presses the F5 button.0 Rules for UI components If you create a new component take care of the following rules Set only context values in your component you really need.sap.g. Bookmark Support We offer additionally a support for bookmarks.Development and Extension Guide – SAP E-Commerce 7. If you offer back buttons use browser back to enable the functionality. Bookmark Request Session is invalid Store context and re invoke application Process Action Figure 14: Bookmark Support We introduce the new ReInvoke command. August 2008 72 . The main problem is that we have to re invoke the application because normally the session is lost when the bookmark is chosen. The command store also the available context and request parameter and provide this information later on to the re invoked action.0 Redirect could be used if the last UI command is UIAction or UIGetForward. Redirect could not be used if the last UI command is UIArea or UILayout. General Guidelines Don’t offer “back buttons”. With this command you could re invoke the session and define the action which should be called after the application is re invoked. do"/> </action> You can call the ReInvoke command also without defining an action. The action where the command is called will be used. Therefore move all necessary parameter to XCM.isa.do" type="com.sap.Development and Extension Guide – SAP E-Commerce 7.do action is called.sap.defaultShopId August 2008 73 .do" type="com.action.0 Example: <action path="/catalog/getProduct. For the example above one could use also: Example: <action path="/catalog/getProduct.GetProductAction" > <forward name="success" path="UILayout"/> <forward name="session_not_valid" path="ReInvoke:/catalog/getProduct. For example the shop id could now maintain in XCM admin: Figure 15: XCM admin .catalog. Prerequisite: Because all session information is lost for invalid session the application must be started without any startup parameter.action.catalog.isa.GetProductAction" > <forward name="success" path="UILayout"/> <forward name="session_not_valid" path="ReInvoke "/> </action> Also in this case the /catalog/getProduct. The StartApplicationBaseAction should be called after the application is initialized (e. shop is read. The Business Objects (business logic objects or BOs) use a generic set of interfaces to communicate with the backend. Therefore. This will be the done by calling a action which extends the StartApplicationBaseAction. /b2c/start. it is important that the procedure for saving objects that live longer than a request is as robust and transparent as possible.do action.do is called to restart the application.. their purpose is to represent the backend-independent part of the business logic. which is called every time not only while re invoke. In B2C this is the /b2c/start. This is achieved by dividing the business logic into a backend-independent (Business Objects) and a backend-dependent part (Backend Objects).g. August 2008 74 .do Restore Context and parameter Action stored for Reinvoke Figure 16: Prozess of re invoke of an invalid session For re invoke the session the init.g. In detail the re invoke of an invalid session looks like: Store context request parameter and the action Init Application e.do Start Application Action e. In order to be able to maintain the application. /b2c/init.This action will forward automatically to the action which is defined by the ReInvoke command. But while re invoke this action redirect to the action which should be re invoked. catalog is read etc).0 Prerequisite: The application must define the re-entry point. Business Object Layer Details Design Considerations The Internet Sales Framework is designed to be used with any backend system.g.Development and Extension Guide – SAP E-Commerce 7. the BOM functions as a data capsule and an administration instance for the Business Objects. Each BOM has to implement the BOManager interface and to extend the DefaultBusinessObjectManager. MetaBusinessObjectManager (MBOM). This can quickly lead to naming conflicts (data in the session is overwritten by mistake) and confusion. An Order. There is one of these managers for each sub-project of Internet Sales. IPC. is used. August 2008 75 . SessionConst. which passes the call through to the MBOM. A constant. can be used to retrieve the object from the session.http. you are able to add new Business Object Managers to the application. Here. the business objects at the top of the hierarchy. you can call the getBOM() method of the MBOM directly on the UserSessionData object. consists of various components (items). The MetaBusinessObjectManager is the only object that exists directly in the session context. or to replace an existing one with a specialized sub-class written by you. and is exclusively used from Actions. The disadvantage of this procedure is that the data is stored as name value pairs in a flat hierarchy (see also javax. This object acts as a factory for the BOMs and the created objects types can be configured using the xml file bom-config. of the UserSessionData object can also be used. Therefore.servlet. ISA core). the Order is the top-level object and manages the components contained within it. without changing any source code. To make the process easier. getMBOM(). all of the business logic objects are managed by a set of central objects. As already mentioned.0 The standard concept for Servlets and JSPs entails storing this data in the session context. Session Context Action Meta BOM BO Layer Business ObjectManager Catalog BOM other BOMs <<creates>> Order Order <<creates>> Item <<interface>> OrderBackend Figure 17: BO Layer Structure To avoid these problems. or a convenience method. Catalog.MBOM_MANAGER. a special object. called Business Object Managers (BOMs). for example. The BusinessObjectManager functions as a container and factory for BOs. that is.Development and Extension Guide – SAP E-Commerce 7. (for example.HttpSession). To allow the centralized creation and management of the Business Object Managers. Only the top level BOs are stored and managed here.xml. August 2008 76 .0 Additional Information For information on how to work with Business Objects and Business Object Managers. see chapter 'Introduction to Extension Concepts' on page 168.Development and Extension Guide – SAP E-Commerce 7. secondly. to provide these Backend Objects with a unified connection handling to the Enterprise Application System. This interface does not disclose any implementation details about the used backend. Base class providing Backend Object with access to framework functionality BackendBusinessObjectBaseSAP «<<interface>>» BasketBackend User defined Interface to Backend System +getDefaultJCoConnection()() +initBackendObject() +destroyBackendObject() +getContext() +myOperation() BasketCRM +myOperation() Figure 18: Design of BLS Business Objects (for example. for example. BasketCRM and BasketR3. All this is configured in Extended Configuration Management (XCM). This interface defines some generic methods for connection handling and Backend Object lifecycle. BasketCRM) and through interfaces (for example.0 Business Logic Service Layer Details Design Considerations The Backend Object Service (BLS) Layer has two main responsibilities.g. August 2008 77 . The BLS framework ensures that the correct Backend Objects are instantiated and that the correct connections are established. Firstly to manage backenddependent Backend Objects and. This interface provides type safe access to backend-specific connections. It is usually extended by a more specialized backend specific interface (e. There can be multiple implementations for a Backend Object interface.Development and Extension Guide – SAP E-Commerce 7. The BLS framework can run multiple configurations simultaneously. BackendBusinessObjectSAP). Backend Objects Each Backend Object implements the BackendBusinessObject interface. Basket) communicate with the Backend System through Backend Objects (for example. BasketBackend). for example. to SAPCRM and SAP ERP system. The properties object holds properties associated with the Backend Object in the backendobjectconfig.core.eai.eai. the initBackendObject() method is called.jdbc. The BackendObjectManager calls this method after creating the Backend Object.sap.0 Depending on the backend type different base classes are used for the backend objects: Backend type CRM. It has the following signature: public void initBackendObject(Properties props.core.sap.xml configuration file. the destroyBackendObject() method is called and gives the Backend Object the opportunity to perform some cleanup.core. BackendBusinessObjectParams params) throws BackendException. Backend Object does not exist initBackendObject() Backend Object destroyBackendObject() Ready Backend Object destroyed handle request from Business Object Figure 19: Lifecycle of Backend Object When the Backend Object is created by the Backend Object Manager.isa.sp.isa.eai. Each Backend Object must implement the initBackendObject() method. August 2008 78 . BackendBusinessObjectBaseSAP com. never by the application programmer. BackendBusinessObjectJDBCBase Table 24: Connection Types to Backend Lifecycle of Backend Object Backend is always instantiated by the framework.Development and Extension Guide – SAP E-Commerce 7. The Backend Object Manager (BEM) takes care of the lifecycle of the object.isa.sp.sap. ERP IPC Database Connection type RFC based communication using SAP Java Connector (JCo) Socket based communication JDBC based communication Base class com.jco.ipc. Before the Backend Object is destroyed. BackendBusinessObjectIPCBase com.sp. Initialization of the Backend Object The initBackendObject method is used to perform one-time initialization. Only this ensures a clear separation of the backend objects and encapsulation of data and business functions. <businessObject type=‘BASKET’ name=‘BasketSAP’ className=‘com. Backend Context One design goal of the BLS layer is to prevent backend objects from communicating directly with each other.core. then the value of the BackendBusinessObjectParams is null The params object can be an arbitrary container passed by the Business Object when the Backend Object is created. it notifies all of its Backend Objects by calling the destroyBackendObject() method.backend.Development and Extension Guide – SAP E-Commerce 7. Nevertheless. BackendBusinessObjectParams params) method. The BackendBusinessObjectParams interface is just a tag interface without any methods.isa.eai. com. sometimes there are cases where data should be made available to all backend objects.basketCRM’ connectionFactoryName=‘JCO’ defaultConnectionName=‘CRMStateless’> <params> <param name=‘init’ value=‘value’/> </params> <businessObject/> The BackendBusinessObjectParams are runtime parameters passed by the object that has requested a new Backend Object by calling the BackendBusinessObject createBackendBusinessObject(String beBOType.xml' on page 275. Destruction of Backend Objects Before the Backend Object Manager becomes invalidated (for example: When a client session is removed from memory). For information about how backend objects are registered in the ISA framework refer to chapter 'Configuration of BLS Layer' on page 87 and chapter 'Changes in backendobject-config.0 There are two types of properties passed to the Backend Object when the initBackendObject() method is called: Backend Object properties defined in the eai-config.xml file are passed using the props object. This method can be used to clean up resources allocated by the Backend Object.isa. In this case the Backend Context can be used.sapmarkets.sap. When a Backend Object is created using the BackendBusinessObject createBackendBusinessObject(String beBOType) method.crm.BackendContext +setAttribute(name : String. value : Object) +getAttribute(name : String) : Object The backend context is obtained as follows (this is provided by the base class of the BackendObject): BackendContext getContext() August 2008 79 . core. and Backend Objects. For example. it automatically passes a reference. If your BOM implements the BackendAware interface. Business Objects.core.isa.isa.BackendObjectManager +createBackendBusinessObject() You only get in touch with a BEM when writing your own BOMs. For information about how to write BOMs. this is done by the MetaBusinessObjectManager of the ISA framework. please see chapter 'Introduction to Extension Concepts' on page 168.JCoConnection. The BLS connection management takes care of the following connection types: RFC based connectivity using SAP Java Connector JDBC based connectivity to a database Working with JCo Based Connectivity Within the BLS layer you never work directly on JCo connections (JCO.sapmarkets. Connection Management Design Considerations Backend Objects communicate with the backend system using backend-specific connectors. August 2008 80 . and Backend Objects.Development and Extension Guide – SAP E-Commerce 7. Instead you work on connections of the typ com.eai. apart from configuring the connection parameters in XCM and using connections within backend objects.0 BackendObjectManager All Backend Objects are created and destroyed by a Backend Object Manager.jco. there is not much you have to do for connection handling. A Backend Object Manager is accessed using the BackendObjectManager interface. Business Objects.sap. Implementing the BackendAware interface indicates that a BOM manages Business Objects which have corresponding Backend Objects in the BLS layer. You do not create an instance of the BEM manually.sp.eai. whether JCo connections are pooled or not As you can see. The BLS layer makes sure that the connection management is fully transparent to the backend objects: Backend Objects are not aware of any connection configuration o Connection parameter configuration takes place in XCM Backend Objects do not have to cope with connection creation and cleanup Backend Objects do not have to care about connection behavior. Only this ensures that the BLS layer can take care of connection handling/cleanup correctly. This interface provides methods for creating Backend Objects: createBackendBusinessObject() com.Client). JCoConnectionStateful For further information why this is needed. please see ABAP debugging: chapter 'ABAP Debugging' on page 166 Assigning connections to Backend Objects: chapter ' August 2008 81 .core.0 BackendBusinessObjectBaseSAP JCoConnection +getDefaultJCoConnection() +getModDefaultJCoConnection(conProps : Properties) +getConnectionFactory() : ConnectionFactory 1.isa. which is the base class for all Backend Objects using JCo connectivity.) No context is kept on the ABAP system between the function calls Implementation class for this connection-type is: com.sap.eai.core. see chapter ‘Java Connector Pools' on page 299.eai.Development and Extension Guide – SAP E-Commerce 7.jco.n +getJCoFunction(funcName : String) +execute(function : JCO.sap.Function) +isValid() : boolean ConnectionFactory 0... That is after each function execution the connection is returned to the pool (pools can be monitored in the ISA administation.isa. Connection Types There are two connection types used in the BLS layer when executing the JCo function: Stateless connection o These connections are pooled.isa.jco. This connection is kept open for the duration of the user session Context is kept on the ABAP system between function calls Implementation class for this connection-type is: com..jco.JCoConnectionStateless o o Stateful connections o o o Each session has its own stateful connection.sp.sp.core.n +getConnection() MyBackendObject Figure 20: Class Diagramm about use of JCo Connection A reference to the JCoConnection object is obtained from the BackendObject of type com.eai.BackendBusinessObjectSAP.sp.1 0.sap. 0 Configuring Backend Objects' on page 89. August 2008 82 .Development and Extension Guide – SAP E-Commerce 7. . Simply call: JCoConnection con = getDefaultJCoConnection(). execute function) JCO..xml file. error handling of BLS layer } catch (JCO.Function func = con.getJCoFunction(‘RFC_PING’).AbapException) { // handling ABAP exceptions (attention!! this is a runtime exception) } finally { The following units provide information on the different ways of obtaining a JCoConnection.0 Working with JCoConnections When a remote callable function module (RFC) in the SAP system has to be called. For information how to register backend object refer to chapter ' August 2008 83 . Do some work (for example.execute(func).close(). Close the connection by calling JCoConnection.Development and Extension Guide – SAP E-Commerce 7. Obtain a connection (a reference of JCoConnection) 2. Getting Default Connection Associated with a Backend Object This is the most common case.g. you always perform the following three steps: 1. There must be a default connection associated with the Backend Object in backendobject-config. con. execute some function modules) 3. } catch (BackendException ex) { //. // Step2: Do some work (e. try { // Step1: Obtain a connection con = getDefaultJCoConnection(). This should be located in the method finally {} Example: JCoConnection con = null. You use a set of properties to overwrite/extend the connection definition properties used for the default connection. August 2008 84 .Development and Extension Guide – SAP E-Commerce 7. Getting a Modified Connection If you need a connection which is based on the configuration of the default connection but with different connection parameters.0 Configuring Backend Objects' on page 89. you can call the getModDefaultJCoConnection(Properties) method. ‘de’).0 Example: Properties props = new Properties(). ‘CRMStateless’. Creating JCO. conProps. conProps).setProperty(JCoManagedConnectionFactory. webUser). You obtain a reference to a JCO.eai.core. Working with JCO. How this is done is described in this chapter.isa. To get a connection based on a predefined and complete connection definition call: Example: JCoConnection mJCoCon = (JCoConnection)getConnectionFactory() // get connection from JCO connection factory getConnection(‘JCO’.JCoManagedConnectionFactory The connection you get is not the default connection associated with the Backend Object.getJCoFunction(String) August 2008 85 .Function object by calling the following method: JCO. JCoConnection = getModDefaultJCoConnection(props). JCoConnection mJCoCon = (JCoConnection)getConnectionFactory(). It is simply an additional connection based on the configuration of the default connection. conProps. ‘CRMStateless’).Functions A JCO. Constants which can be used to set JCo properties are located in class com.jco.sap. props. Getting a New Connection from a ConnectionFactory object Using a connection factory you can get any connection that can be served by the BLS layer.Function JCoConnection .sp.setProperty(‘passwd’.Function is used to execute remote callable function modules in an SAP system.getConnection(‘JCO’. webUserPassword). You can also extend/overwrite connection definitions by passing a set of properties to the connection factory: Properties conProps = new Properties().setProperty(‘user’.Functions.Functions After getting a JCoConnection you use it to get/execute JCO.JCO_LANG.Development and Extension Guide – SAP E-Commerce 7. This ensures the best performance. try { con.Function myFunc. Example: JCO. Besides the BackendException. } August 2008 86 .AbapException if you call ABAP function modules and you expect that the Function Module throws an ABAP exceptions. since each Backend Object does not have to create its own repository.0 The BLS layer serves the JCO.execute(myFunc). Never create an own JCO. there is only one repository per backend system.Function from a centralized JCO repository. Additionally. JCoConnection con = getDefaultJCoConnection(). Let the BLS layer do it for you Example: JCO.Repository. After executing the function(s) do not forget to close the connection by calling JCoConnection. please do not forget to catch the BackendException and JCO. JCoConnection con = getDefaultJCoConnection(). a JCO. } catch (BackendException bex) { // system error } catch (JCO.Function func) throws BackendException. Therefore. Take care of execptions when executing JCo functions: The signature of the execute method is as follows: execute(JCO.close().AbapException runtime (!) exception can be thrown if the calling function module throws an ABAP exception.Development and Extension Guide – SAP E-Commerce 7.Function).getJCoFunction(‘SAP_BASKET’).AbapException abapEx) { // application error in SAP system } finally { con.execute(JCO.Function myFunc. myFunc = con. Executing JCo Functions JCo functions are executed using the following method: JCoConnection.close(). myFunc = con.getJCoFunction(‘SAP_BASKET’). The key is represented by a String constructed from the called JCo function.xml o Configures the Connection Management WEB-INF/xcm/sap/modification/backendobject-config.xml.sap. For information how to register backend objects in customer projects refer to chapter 'Changes in backendobject-config.xml' on page 275.0 Please do not execute the JCO. 805> + <logon language to SAP system> + <string representation of import parameters> + <JCO function name> August 2008 87 . An unambiguous key recognizes each JCo function served from the cache.sp. If you think that this is necessary.Development and Extension Guide – SAP E-Commerce 7. Only this ensures that the application can fully utilize services provided by the BLS layer (for example.sap.Client.xml file: The JCo function cache.com/connectors Java Connector) in the BLS layer. create an OSS on component CRM-ISATEC explaining why do you think this is necessary.jco. The cache is useful for function modules returning static data and long execution times. The cache is only implemented for function modues executed with connection type com.Function caching. There is one exception which makes it probably necessary to touch the eai-config.xml o Registers Backend Objects to ISA framework If you do intend to change these files in customer projects you have to take the corresponding files located in WEB-INF/xcm/customer/modification and use the XCM extension mechanism. Configuration of BLS Layer The main configuration files of the BLS layer are: WEB-INF/xcm/sap/modification/eai-config. This one is explained in the next paragraph. Configuring Connection Management This guide assumes that you do not have to change the connection management configured in eai-config. Always use JCoConnection.eai. JCO.Function (for further information about JCo see [4] SAP Java Connector: On the SAP Service Marketplace: http://service.JCoConnectionStateless. the result of the call can be either served from the SAP system or from a cache maintained by the BLS layer. There are two key types: Key Type A: <logon client to SAP system e.core.g. connection lifecycle). JCo Function Cache When executing a JCO.isa.Function directly on a JCO. . 805> + <logon language to SAP system> + <logon user-name to SAP system> + <string representation of import parameters> + <JCO function name> The JCo functions that have to be cached by the BLS layer are defined as name/value parameters of the managedConnectionFactory element in the eai-config. After the change the file looks as follows: <backend version=‘5. FUNCTION_MOD2.w3.Cache and configured using the cache-config..xml file located in web-inf\cfg.org/2001/XInclude’ xmlns:xml=‘http://www.config’ xmlns:xi=‘http://www.0 Key Type B: <logon client to SAP system e..g.isa. If you want to change any cache settings..’/> Example: In this example you register the function 'BAPI_CUSTOMER_GETSALESAREAS to the cache in the customer version of eai-config.xml#xpointer(backend/configs/*)’/> <config isa:extends=‘. you must apply these changes in the region named JCO (all numbers are in minutes).sap.cache.org/XML/1998/namespace’> <configs> <xi:include href=‘${sap}/modification/eai-config.isa.’/> Cache type B: <param name=‘cacheType_B’ value=‘ FUNCTION_MOD_A./config[@id='default']’> <managedConnectionFactories> <managedConnectionFactory name=‘JCO’> <params> <param name=‘cacheType_A’ value=‘BAPI_CUSTOMER_GETSALESAREAS’/> </params> </managedConnectionFactory> The cache functions are provided by the com.sap. .core.w3.core. FUNCTION_MOD_B.xml using the XCM extension mechanism.xml file: Cache type A: <param name=‘cacheType_A’ value=‘FUNCTION_MOD1.0’ xmlns:isa=‘com.. .Development and Extension Guide – SAP E-Commerce 7. You can check if functions have been cached in the ISA Administrator area => Java Connector Statistics => JCo Cache Statistics. August 2008 88 . You can register new objects or extend existing objects. In that case refer to chapter 'Changes in backendobject-config.Development and Extension Guide – SAP E-Commerce 7. Table 25: Attributes of BusinessObject elements Required Yes name className connectionFactoryName Yes Yes No August 2008 89 .xml using the XCM extension mechanism. Backend Objects are registered using the businessObject XML element. Name of Backend Object. Name of implementation class of Backend Object. Name of the connection factory that provides the default connection used by the Backend Object.xml' on page 275. Currently not used by framework. This file is located in WEBINF/xcm/customer/modification/backendobject-config. (for example.xml. The possible values are: JCO: for RFC based connectivity with the SAP system using SAP Java Connector IPC: for socket based connectivity to the IPC Server JDBC: for JDBC based connectivity to a database Connection parameters for all these types are defined in XCM. If you omit this parameter. The businessObject element has the following attributes: Attribute type Description Specifies the type of the Backend Object. BASKET). then null is returned when calling getDefaultConnection(). The value of the type attribute must be passed to the BackendObjectManager when a Backend Object is created. Each BackendObject provides methods like getDefaultConnection() returning a connection of the specified type.xml. If you do this in customer projects you have to register your objects in the customer version of backendobject-config.0 Configuring Backend Objects SAP standard Backend Objects are registered in the file WEBINF/xcm/sap/modification/backendobject-config. Development and Extension Guide – SAP E-Commerce 7.0 Attribute defaultConnectionName Description Name of connection used as the default connection. There must be a connection with this name defined in the connection factory whose name has been specified by the connectionFactoryName attribute. The common values are: JCO connection factory: o o ISAStateful for stateful connections (type JCoConnectionStateful) ISAStateless for stateless connections (type JCoConnectionStateless) Required no IPC connection o IPC_SOCKET JDBC connection o JDBC_CON Table 26: Attributes of BusinessObject elements The body of the businessObject element can contain any number of name/value pairs. These properties are passed to the Backend Object via the initBackendObject() method when it is initialized. Example taken from B2B: <businessObject type=‘CatalogSite’ name=‘CatalogSite’ className=‘com.sap.isa.catalog.impl.CatalogSite’ connectionFactoryName=‘JCO’ defaultConnectionName=‘ISAStateless’> <params> <param name=‘distributable’ value=‘NO’/> <param name=‘catalogSiteConfigFile’ value=‘WEB-INF//cfg//catalog-site-configR3.xml’/> The parameters (e.g. name=‘distributable’ value=‘NO’) can be obtained when the initBackendObject() method is called. August 2008 90 Development and Extension Guide – SAP E-Commerce 7.0 Further Services This chapter introduces generic services used in the SAP E-Commerce 7.0 solution. Message Framework This document gives you a guideline, how to use the generic message framework in your application. The framework consists also of global message and error pages, which should be included in own application. The message and handling consists of three parts Message, MessageList Class and MessageListHolder Interface MessageTag to use on own Java Server Pages Standardized Message and Error Pages Business Object can be implemented as Message Holder with no effort. The Message class handles a message similar to R3 message. It consists of Type (Success, Error, Warning, Info) Description Key (language independent resource key) Arguments Property (for example „Street“ for BusinessObject User) The MessageList object manages a list of messages. A message can be added to every object which implements the MessageListHolder interface. Here a list of objects which already implement this interface: MessageList, MessageListDisplayer, BusinessObjectBase BusinessObjectException. There are some steps necessary one-time to integrate the global message pages in your application. See chapter ’How to integrate the global message pages in an application’ (page 98) for details. August 2008 91 Development and Extension Guide – SAP E-Commerce 7.0 Message classes Message, MessageList and MessageListHolder Class The Message class handles a message similar to R3 message. It consists of: Type (Success, Error, Warning, Info) Description Key (language independent resource key) Arguments Property (for example „Street“ for BusinessObject User) The MessageList object manages a list of messages. A message can be added to every object which implements the MessageListHolder interface. Here a list of object which already implement this interface: MessageList, MessageListDisplayer, BusinessObjectBase and BusinessObjectException. A business object can either hold the messages to display it in the front end or log messages to provide it in log files. In both cases the business object will be set to “invalid” if the message is of the type “error”. Example Message message = new Message(Message.ERROR,"shop.loadError",args,null); Shop.addMessage(message); Adding messages from a CRM backend For the CRM backend the class MessageCRM is used to create messages from the ABAP Structure CRMT_ISALES_RETURN or BAPI_RETURN. Example String returnCode = exportParams.getString("RETURNCODE"); JCO.Table messages = profTemplCharGet.getTableParameterList().getTable("MESSAGES"); attributeSet.clearMessages(); if (returnCode.length() == 0) { MessageCRM.addMessagesToBusinessObject(attributeSet,messages); } else{ MessageCRM.logMessagesToBusinessObject(attributeSet,messages); throw (new BackendRuntimeException("Error while read attribute set")); } August 2008 92 Development and Extension Guide – SAP E-Commerce 7.0 A message could be logged or add to the business partner depending the field TARGET of the structure CRMT_ISALES_RETURN “” “A” “B” not defined user message message for log file “C” message for user and log file The method splitMessagesToTarget take care of the field. Example String returnCode = exportParams.getString("RETURNCODE"); JCO.Table messages = profTemplCharGet.getTableParameterList().getTable("MESSAGES"); attributeSet.clearMessages(); MessageCRM.splitMessagesToTarget(attributeSet,messages); MessageListDisplayer The MessageListDisplayer class is a helper class to display a message or a list of messages with the corresponding message page. The class allows controlling the interaction flow after displaying the message. Example String args[]= {shopKey.getIdAsString()}; MessageListDisplayer messageDisplayer = new MessageListDisplayer(); messageDisplayer.addToRequest(request); messageDisplayer.setOnlyLogin(); messageDisplayer.addMessage(new Message(Message.ERROR,"shop.loadError",args,null)); return mapping.findForward(“message”); In this example a message page with the created message and a login button will be displayed. See the JavaDoc of the corresponding class for further details. August 2008 93 Development and Extension Guide – SAP E-Commerce 7.0 Example MessageDisplayer messageDisplayer = new MessageDisplayer(); messageDisplayer.addToRequest(request); messageDisplayer.copyMessages(salesDoc); // the action which is to call after the message messageDisplayer.setAction("/b2b/documentstatusdetailprepare.do"); messageDisplayer.setActionParameter("techkey="+salesDoc.getTechKey().getIdAsString() +"&objecttype="+mandoc.getDocType() +"&objects_origin=&object_id=" ); return mapping.findForward("message"); Message Tag The MessageTag can display messages of a MessageListHolder on JSP with the dependencies from type and property. Example <!–– all User error --> <isa:message id=„error“ name=„User“ type=„<%=Message.ERROR%> <%=error%> </isa:message> <!–- errors without a property --> <isa:message id=„error“ name=„User“ type=„<%=Message.ERROR%> property=„“> <%=error%> </isa:message> <!–- error for a given property --> <input type=text name=„Street“>street<input> <isa:message id=„error“ name=„User“ type=„<%=Message.ERROR%> property=„street“> <%=error%> </isa:message> Exception Handling Exceptions could be thrown in all level of the application. To prevent to mix up the exception in different level the exception should always be converting between different levels. There exist some helper class to convert exception from a lower level to the according exception. August 2008 94 Development and Extension Guide – SAP E-Commerce 7.0 Backend Encapsulate the call of a function module always in an own function module. Example log.entering(“call()”); try { JCO.Function function = connection.getJCoFunction(moduleName); ... return new JCoHelper.ReturnValue(null, ""); } catch (JCO.Exception ex) { JCoHelper.splitException(ex); } finally { log.exiting(); } Use the method JCoHelper.splitException(ex) to convert a JCO exception to an ECommerce Backend Exception. Ensure that the JCO Connection will be closed if you create backend exceptions. Example JCoConnection connection = getDefaultJCoConnection(); JCoHelper.ReturnValue retVal = crmIsaProfTemplCharGet(attributeSet, shop, shopConfig, connection); connection.close(); if (retVal.getReturnCode().length() > 0) { // bring errors to the error page MessageCRM.logMessagesToBusinessObject(attributeSet, retVal.getMessages()); MessageCRM.addMessagesToBusinessObject(attributeSet, retVal.getMessages()); throw (new BackendRuntimeException("Error while read attribute set")); } else { MessageCRM.addMessagesToBusinessObject(attributeSet, retVal.getMessages()); } August 2008 95 Because this action handles all ECommerce action in appropriate way and forward to the correct error pages (see next chapter). The exception should be stored in the request under the name ContextConst.jsp This page should be displayed after a CommunicationException is thrown. Best you uses also the EComBaseAction as a base class for your own actions because this action handles the common exceptions and forward to appropriate pages (see global forwards in chapter ’How to integrate the global message pages in an application’ on page 98).jsp This page should be displayed after a RuntimeException is thrown. The exception should be stored in the request under the name ContextConst.isUserAuthorized(user). } return false. August 2008 96 . appbase\backenderror. appbase\runtimeerror.0 Business Object Layer Use the method BusinessObjectHelper.EXCEPTION. } catch (BackendException ex) { BusinessObjectHelper. If you want to check also if the user is logged in use the class EComExtendedBaseAction (see chapter ‘Pre Condition check in the EComExtendedBaseAction’ on page 99). Action Layer Use the EComBaseAction class as a base class for your own actions.splitException(ex) to convert a backend exception to an ECommerce Front end Exception. The exception should be stored in the request under the name ContextConst.Development and Extension Guide – SAP E-Commerce 7.EXCEPTION. Error Pages The framework provides a set of error and message pages which could easily use in other application. appbase\panicexception.splitException(ex).jsp This page should be displayed after a PanicException is thrown.EXCEPTION. Example try { return getMyBackendService(). inc.location. Additionally with the property position it is possible to describe the absolute position of the message in the page. appbase\jspruntimeerror. See chapter ‘Message handling in accessibility mode’ (page 97) for details. Without this page the J2EE engine displays only a white screen with no information that an error occurs.setPageLocation(ITEM). <%@ page errorPage="/appbase/jspruntimeexception.<yourLocation> for each of your page location.do action (see global forwards in chapter ’How to integrate the global message pages in an application’ on page 98) should be called before the page is displayed.0 appbase\relogin\invalidsession.Development and Extension Guide – SAP E-Commerce 7. message. message.setPageLocation(SalesDocumentDataUI.get(i). The information about the page and the message will be handled by the MessageListDisplayer class.getNumberInt())%>"></a> August 2008 97 .message.jsp This page can be used to display all kind of messages. message.jsp" %> appbase\accessibilitymessages.jsp This page should be displayed after the session is invalid. appbase\message. Message handling in accessibility mode There is some support to generate messages in the accessibility mode.setPosition(items.jsp This page displays runtime error on a JSP’s. With the following HTML Coding: <a href="#" name="[location]_[position]"></a> Example <a href="#" name="item_<%=JspUtil.removeNull(item.HEADER). This position will be interpreted as an anchor in the HTML page. Insert the following line in your JSP to get a message page instead of a white screen. Please define a resource key access.jsp This include should be used to display messages in accessibility mode at the top of the page. With the property pageLocation of the Message object is possible to describe on which area of the page the error occurs. The /base/relogin/getcookie.getNumberInt()). setPageLocation(HEADER).xml: <!-. i++){ Message message = messagelist.size().sap.SetReloginCookieAction"> <forward name="success" path="/user/performLogin.base actions end --> August 2008 98 .GetReloginCookieAction"> <forward name="success" path="/appbase/relogin/invalidsession.jsp" <% } %> %> The messages which should be displayed could be added with method addAccessibilityMessages of the BaseUI class. Overwrite this method if you want to use this method to build up your messages. */ public void generateAccMessages() { MessageList messagelist = header.0 The message could be displayed with the help of the include appbase\accessibilitymessages.isa.Development and Extension Guide – SAP E-Commerce 7. } addAccessibilityMessages(messagelist).sap.action.core.inc.do"/> </action> <action path="/base/relogin/getcookie" type="com.getMessageList().Show accessibility messages --%> <% if (ui. i<messagelist. /** * Generates all messages for accessibility.base actions start --> <action path="/base/relogin/setcookie" type="com.EComDisplayErrorPageAction"> </action> <!-..inc.action.action. <%-.isacore.core. Within this include the generateAccMessages method of the BaseUI class will be called..isa.isAccessible) { %> <%@ include file="/appbase/accessibilitymessages.get(i).. How to integrate the global message pages in an application There are only a few steps to include the global message pages in an application. for(int i=0. message.sap.isa. Define the used actions in your config.jsp"/> </action> <action path="/appbase/error" type="com.jsp. do. starts your application: <!— support of the global init action --> <action path="/init.inc.Initialize UI --> <initialization className="com.jsp"/> </initialization> Pre Condition check in the EComExtendedBaseAction The EComExtendedBaseAction extends the EComBaseAction with a check if the user is logged in.USER_NO_LOGIN (user_no_login) Example: <global-forwards type="org.action. “/b2b/init.ActionForward"> <forward name="login" path="/b2b/login/login.xml under the parameter initAction.jsp"/> <forward name="user_no_login" path="/appbase/error. A UserBase object must exist in one of the used business object manager and the corresponding business object manager must implement the UserBaseAware interface.ui.core.0 Define the used global forwards in your config.xml: <!-.========== Global Forward Definitions ========================= --> <global-forwards> <forward name="error" path="/appbase/error.do" forward "/b2b/init.jsp"/> <forward name="backenderror" path="/appbase/backenderror.do"/> If an header should be included in the message page the header include must be defined in the initconfig.jsp"/> <forward name="session_not_valid" path="/base/relogin/getcookie.struts.com (e.isa.sap.isa.sapmarkets.apache.xml: <!-.Development and Extension Guide – SAP E-Commerce 7.jsp"/> </global-forwards> Define the init action you use to start the application in the web.do"/> </global-forwards> August 2008 99 .do"/> <forward name="message" path="/appbase/message.do"/> <forward name="runtimeexception" path="/appbase/runtimeexception.UIInitHandler"> <param name="simple-header" value="/shopadmin/simpleheader.do”) or insure that the action /init.g. If the user is not logged in the action returns the logical forward Constants.jsp"/> <forward name="panicexception" path="/appbase/panicexception. B2C)) { this.g. } } August 2008 100 .equals(CONSTANTS.sap.action.Development and Extension Guide – SAP E-Commerce 7.0 This leads to the following error message: Extended actions can use the property checkUserIsLoggedIn to change the behavior dynamically e.checkUserIsLoggedIn = false. Example: /** * Initialize the action.isacore.isa.IsaCoreBaseAction#initialize() */ public void initialize() { if (getApplication(). * In B2C this action could be used by anonymous user. depending from the application in the initialize method. * * @see com. B2B Document Selection Screen: Search screen Result list August 2008 101 .0 the document selection and the customer selection (B2R scenario) are created using the Generic Search Framework.0 Generic Search Framework The Generic Selection Framework provides a mechanism to build a Selection screen out of an XML description. In CRM 7.Development and Extension Guide – SAP E-Commerce 7. Development and Extension Guide – SAP E-Commerce 7.0 Architecture of the Generic Search Framework JSP Selection Criteria UI Class Maintenance Object (and helper classes) XCM JSP Result list UI Class Class handling the dynamic content Request Context Action & Businessobjects Search / GenericSearchC ommand CRM Or JDBC … August 2008 102 . g.GenericSearchUIFactory..action.. <screen-group name="search_criteria" description="search.java com.java CRM_ISALES_SEARCH CRM_ISA_GEN_DOCUMENT_SEL CL_ISA_GEN_DOC_SEARCH_HELP Application layer Web server Web server Web server Web server Web server Web server Application server (Dev. the creation date.GenericSearchSortAction.genericsearch. .isacore. See section “Examples of Extensions -> Extension of the Document Search Screen“ on how to use the generic search framework to manipulate the document search screen.isa.THIS IS THE BASKETTYPE LEVEL (e. <configs id="crmdefault"> <!-./ baskettype combination..GenericSearchBaseAction.xml” Location: xcm \ sap \ modification \ generic-searchbackend-config.isa.GenericSearchBaseUI.uiclass.xml com.g CRM.genericsearch. …) Next part describes all search screens and result lists which are defined for a backend.uiclass.ui.list" type="result"> <property-group>salesdoc_resultlist_B2B_itemlist</property-group> <property-group>order_resultlist_B2B</property-group> </screen-group> August 2008 103 .criteria" uiClassName="com.) <config id="crmbasket_crmtemplate"> <!-.jsp \xcm\sap\modification\generic-searchbackend-config.THIS IS THE BACKENDTYPE LEVEL (e.isa. First entry for each backend is the declaration of the available search screens and the result lists. Once the web-user starts a search request the result list defines the fields which should be returned for each found object (e.sap.Development and Extension Guide – SAP E-Commerce 7. JavaBasket). Mod) Application server (class) Details of component “generic-searchbackend-config.java com.isa.0 Following describes the structure of the xml and the relations of the attributes.sap.java com.sap.sap. Main Components of the Generic search framework Component \appbase\genericsearch.genericsearch.ui. The search screen describes which fields should be offered to the web-user and how do they depend from each other.uiclass.xml The xml is separated for each backend and basket type (CRM.isacore.isa.g crmbasket.ui.class) Application server (func.GenericSearchISAUI" type="search"> <property-group>SearchCriteria_B2B_Sales</property-group> <property-group>SearchCriteria_B2B_Contracts</property-group> … </screen-group> <screen-group name="result_list" description="result. R/3. for orders this could be the order no.action.sap. show.stat.status.me"/> <property name="document_types" type="box" implemenationFilter="true" requestParameterName="rc_documenttypes" resultlistName="dummy" maxHitsToSelect="100" UIJScriptOnChange="GSloadNewPage(this). It describes the fields which should be retrieved from the backend and being displayed on the screen. <!-.key1val1" resultlistName="quot_resultlist_B2B"/> IMPORTANT !! For the CRM backend all search criteria are logically linked together with AND.doc."> <allowedValue value="ORDER" description="b2b. For example.cust.Development and Extension Guide – SAP E-Commerce 7.sales.backorder" resultlistName="order_resultlist_B2B" maxHitsToSelect="0"/> <allowedValue value="QUOTATION" description="b2b.attr.status.type.shuffler. A search screen is packed within a <property-group> tag.shuffler.key1val2" resultlistName="order_resultlist_B2B" default="true"/> <allowedValue value="BACKORDER" description="gs. But the same search criteria are logically linked together with OR. The definition of a result list is also surrounded by the <property-group> tag.0 Next part defines a search screen.status. For example.***************************************************************************** * START of the search criteria definition for B2B Sales Documents ******************************************************************************* --> <property-group name="SearchCriteria_B2B_Sales" useSearchRequestMemory="true"> <property name="show_me" type="text" value="gs. show me all ORDERS where partner is “4711” AND status is “open” OR status is “completed” AND purchase order number is “PO 0815”. <property-group name="order_resultlist_B2B"> <property name="GUID" type="hidden" parameterType="rowkey" /> <property name="STATUS_SYSTEM" columnTitle="b2b. show me all ORDERS where partner is “4711” AND status is “open” AND purchase order number is “PO 0815”.shuf.key102" translationPrefix="status."/> August 2008 104 . e for enhanced "max hits" event occurred See also <propert-group> describing a result list. UIJScriptOnStartButton sendRequest(). Attribute Default Remark useSearchRequestMemory false If set to true. This allows splitting the search criteria into several areas. cssBodyClassName documentCSS class which will be added to the <body class=”<…>”>. bodyInclTop Defines the path/name of an include which will be placed right after the <body> tag of the <html> page.1 for exactly 1 document found . Attribute Default Remark name Name of the property which will be used for searching in a backend. To separate properties with the same name add an index in form of (1).msg. CREATED_AT_DATE(2). linkTargetFrameName Name of the frame where the result list should be placed. The class must implement Interface GenericSearchUIData or more easily extend class GenericSearchBaseUI. Resource key prefix for message of how many objects have been found The key will be extended either by .n for more than one documents found .evt. Defines the type of the search screen property: box (= drop down list box) radio (= radio button) type - August 2008 105 . Allowed attributes for tag <property-group> describing a search screen. The areas are <div> blocks and can be controlled by the Cascading Style Sheet (CSS) file. Name of the JScript function which will be called at the 'onclick' event of the “GO!” button. search tag.result. (2) to the property name (e. maxScreenAreas 1 Number of screen areas for this search screen. input fields) will be stored and after a performed search represented to the web user. …) The index will be automatically removed by the framework. The name MUST be unique within one search screen definition where the property appears on the screen. This can be used if the result list should be located into another frame as the search screen. Allowed attributes for tag <property> describing a search screen. the search screen will always be displayed according to default settings. If set to false.Development and Extension Guide – SAP E-Commerce 7. msgKeyObjectFound gs.g.0 Allowed attributes for tag <screen-group> Attribute Default Remark uiClassName Defines the UI class which should be used to build up the search and result list screen.s for simple "max hits" event occurred . CREATED_AT_DATE(1). bodyInclBottom Defines the path/name of an include which will be placed right before the </body> tag of the <html> page.evt.0 for no document found . the last search request parameters (drop down boxes. daterange (= input fields for a date range in one line) .g onBlur=’dosomething().0 .daterange2L (= input fields for a date range in two lines) Allows also defining a subtype in form of a token. If set to true the value send with the request will be used to first identify an backend object (see file sap\modification\backendobject-config. Since there is no further processing on this attribute. See also attribute “maxScreenAreas” of tag <property-group> This will allow tagging a label to the property.g. Identifies a help value method defined in file sap\modification\helpvalues-config.hidden (= hidden input field) . Defines a JScript function and event for this property (e.top (= above the property) This attribute will be passed on to the backend where the selection takes place.text (= simple output text) .g. Only meaningful if flag “implemenationFilter” is set to “true”. to identify the partner function type of an business partner) Name which should be used for this property to build up the URL. Adding the name of an <helpValuesSearch> will bring up an binocular beside of an input field. this property will only be used on the screen. if not otherwise specified (see <allowedValue> tag.g. Alignment of the label . but not send to the backend. The Framework will only return this amount of result list entries.dark (= programmable property) . an token from the CRM 1order reporting framework like “RAN”) Additionally describing attribute for the property which will be passed on to the backend in attribute “param_func_type” (e.Development and Extension Guide – SAP E-Commerce 7. The information “datetoken” will be passed on to the backend in attribute “param_function” (see details of component “CRM_ISA_GEN_DOCUMENT_SEL”) By appending “UI” to the type.date (= input field for single date) . type=”box(datetoken)”. to identify where the entity in the CRM 1order reporting framework will search for this property) To identify an token on how to be search (e. helpValuesMethod - implemenationFilter - resultlistName - entityType - tokenType parameterType - requestParameterName - UIJScriptToCall UIJScriptOnChange - screenArea label labelAlignment 1 left maxHitsToSelect -1 August 2008 106 . The function will be called BEFORE the standard JScript function of the framework will be triggered. Database entity where the search will performed. The value will be interpreted as an resource file key. MUST be unique within the URL which will be sent to the web server.left (= left of the property) .xml) and second to select the ABAP class performing the search. Setting the value to “-1” will return ALL result list entries. Therefore add the word “token” to your subtype (e. (e.xml.input (= simple input field) .g. Screen area to which this property belongs. the name could be freely chosen (to be unique).’) Defines a JScript function which should be called on the “onchange” event. Default name of the result list which will be used. For the found order.0 Special Values for the Attributes Some values of the attributes are having a special meaning. Value Value of the property of which this one should depend on. CONTRACT. that a search by reference documents via a BAdI implementation has to be performed. See Details of component “CRM_ISALES_SEARCH”. Attribute entityType token Value NOT_FOR_RF REF Remark Properties having this value for entityType are not recognized by the reporting framework. The <depending> tag allows defining UI dependencies between search screen properties. The document flow of the delivery is read to get the appropriate order. that have no assignment to the campaign. QUOTATION and others. The implementation CRM_ISA_FLT_DOCFLOW_CAMPAIGN is an example for a filter before and after the selection. To add additional filters before and/or after the selection in such a document type specific implementation. implemented for ORDER only) Calls the BAdI implementation for the search by a delivery. First the given campaign is read and additional select options are generated so that only orders in the time range of the campaign are selected by the reporting framework. This provides a method to manipulate the given select options as well as a method to manipulate the list of the selected objects. By defining this dependency this property will only be visible to a web user if the corresponding property is set correctly.Development and Extension Guide – SAP E-Commerce 7. (BAdI CRM_ISA_HLP_FILTER. Allowed attributes for tag <depending> describing a search screen. the BAdI CMR_ISA_HLP_FILTER was introduced. Possible values are e. August 2008 107 . Calls the BAdI implementation for the search by campaign id.g. Attribute Default Remark propertyName Name of the property of which this one should depend on. Assuming entityType is set to NOT_FOR_RF. Attribute Default Remark value Static value which will be added as select option to a <html> select box (e.g. The implementation is selected by a filter value. The dependency is ONLY valid for UI and not for backend selections!! Allowed attributes for tag <allowedValue> describing a search screen. an additional select option is generated. ORDER. After the selection the document flow is read and all orders are filtered out. The implementation CRM_ISA_FLT_DOCFLOW_DELIVERY is an example for a filter before the selection. (BAdI CRM_ISA_HLP_FILTER. implemented for ORDER only) parameterType CAMPAIGN DELIVERY How to implement additional filters in the backend The generic search framework is using different BAdI implementations of CRM_ISA_GEN_DOC_SEL to perform a document type specific search. this indicates. that is controlled with the attribute implementationFilter. August 2008 108 . Hide this value (not included on the <html> page) If this attribute is set to value ‘dynamic’ the attributes “contentCreateClass” and “contentCreateMethod” will be used to instantiate and perform the defined method. <select id…> <option value=”value” >description</opt… If the <property> where this <allowedValue> tag is assigned to. (e.Development and Extension Guide – SAP E-Commerce 7. this property will not appear on the final <html> page. Within this method the entries of the drop down box can be generated. and by that reflecting user settings. shop settings or other customizing.g. Full qualified class name Method in class given by “contentCreateClass” description - resultlistName - default hidden content false false - contentCreateClass contentCreateMethod - This tag is only allowed for properties of type “dark” and “box” !! If a <property> of type “box” has no select option after the evaluation of the <allowedValue> tag. an specific result list is assigned.g. an order document has other fields within its result list as an quotation) Defines this entry as default (“selected”). has flag “implemenationFilter” set to “true”.0 <select id…> <option value=”value” …) Language dependent description of the value (e. evt. “date” and “number” mark properties which are not meant to be sorted as String! “nosort” marks properties which should not have the possibility to be sorted be the web user. must be rendered by using the custom includes (see attributes “bodyInclBeforeResult” and “bodyInclAfterResult”) Render the field as input field is set to “false”.“hidden” . .“nosort” . Attribute Default Remark name type Name of the property which will be requested in the backend for the result list. the value of the property will be concatenated with this prefix.msg.0 for no document found . Type of the result list property. “number”. expandedResultlist false Allowed attributes for tag <property> describing a result list.“number” . Attribute Default Remark bodyInclBeforeResult bodyInclAfterResult msgKeyObjectFound gs. If set to true. See also <property-group> describing a search screen.s for simple "max hits" event occurred . “text” in conjunction with attribute “readOnly” (=false) will render a <input> tag allowing the web user to enter some data (a surrounding <form> tag to process the data.“checkbox” Set this attribute to “hidden” if the value is just needed for internal purposes and not intended to be visible to the web user. If this attribute is set. This is possible for properties of type “date”. Language dependent header title of the property.Development and Extension Guide – SAP E-Commerce 7.n for more than one documents found .1 for exactly 1 document found .“date” .0 Allowed attributes for tag <property-group> describing a result list. value from search screen will take place. Defines the path/name of an include which will be placed right after the result list. the web application will be instructed to expanded the search area. Resource key prefix for message of how many objects have been found The key will be extended either by .“text” .result. Allows marking this property as “rowkey”.e for enhanced "max hits" event occurred If not set on the result list level. and translated before issued on the <html> page Assigns a special CSS class to this property. Defines the path/name of an include which will be placed right before the result list will be issued. By that it is readOnly parameterType columnTitle translationPrefix false - cssClassName - August 2008 109 . “text” and “checkbox”.evt. The function module itself is not responsible to handle the search request.“DESCENDING” . To communicate with the CRM or the JavaBasket the standard classes .OrderTemplateStatusDB should be used. Details of component “CRM_ISALES_SEARCH” This part of the description explains how an incoming search request will be processed in the CRM backend. It only determines the right BAdI implementation and hands over the control to it.sap. hyperlink - linkParamClass linkParamMethod linkTargetFrameName writeUnderProperty defaultSortSequence - fieldOutputHandlerClass - fieldOutputHandlerMethod - Details of component “GenericSearchBaseAction” This Struts action is responsible for processing the search request. Defines a hyperlink for this property value. See attribute “fieldOutputHandlerClass”. Determined for the backend is the value of the property where attribute “implemenationFilter” is set to “true”. Defining this class and method allows controlling the value output by program code.isa. Basically this function module can handle multiple search requests with one call. one of the search August 2008 110 . By that it is possible for example to issue the value as an icon.order. Allows to sort the initially issued result list to be sorted either .isa.“ASCENDING” It is only allowed marking one property to be sorted by default. While this action is processed it will be decided where the search request should be processed. From the <html> page generated by the genericsearch. All search request options are linked together with a handle.backend. The object with this type will be picked up from the xcm\sap\modification\backendobject-config. Full qualified class name Method in class given by “linkParamClass” Defines the target frame where the hyperlink should point to. This could either be the CRM Application server or the JavaBasket.xml file.jsp only ONE search request at the time will be send. This property will be written right under the <property> specified here.com.crm.com. Allows creating multi-line result lists.do) To create the parameter for the hyperlink use attributes “linkParamClass” and “linkParamMethod”.g. (e. In Internet Sales the GenericSearchISAAction is derivated from this base action to deliver ISales specific objects like BOM or UserSessionData. The value will be created with this hyperlink. b2b/documentstatusdetail.GenericSearchCRM .db. To determine this BAdI implementation.0 possible to control the layout of the value via the CSS class.Development and Extension Guide – SAP E-Commerce 7.backend. All communication from Java to CRM is handled by function module CRM_ISA_GEN_DOCUMENT_SEL.sap. Known standard implementations for CRM Internet Sales are: Filter Value ORDER ORDERTMP CONTRACT QUOTATION BILLINGDOC ABAP class CL_IM_CRM_ISA_GDS_ORDER CL_IM_CRM_ISA_GDS_ORDERTMP CL_IM_CRM_ISA_GDS_CONTRACT CL_IM_CRM_ISA_GDS_QUOT CL_IM_CRM_ISA_GDS_BILLDOC Remark This implementation is exclusively used to select order documents. It returns items instead of header objects. The reporting framework only return the main key (GUID) of the found documents. It returns items instead of header objects. Enhancing these by other attributes like document description. It returns items instead of header objects. quotations and contracts are documents from the CRM 1order application.0 request entries (import table IT_SEL_OP) with key SELECT_PARAM = ‘LIST_FUNCTION’ is picked up and its value used to instantiate the BAdI. This implementation is exclusively used to select order templates. the help class provides also an appropriated method. This implementation is used to select billing documents. August 2008 111 . This implementation is used to search for items in 1Order order documents. credit memo or down payment). document creation date and so on. This implementation is used to search for items within CRM billing documents. To select documents from the CRM 1order the application provides the CRM 1order reporting framework. This implementation is exclusively used to select quotations. order templates. It returns items instead of header objects. This implementation is exclusively used to select backorder documents This implementation is used to search for items within one sales document (1Order documents). BACKORDER 1O_ITEMS CL_IM_CRM_ISA_GDS_BACKORD CL_IM_CRM_ISA_GDS_1O_ITEMS BILLINGITM CL_IM_CRM_ISA_GDS_BILLDOCI ORDERITM CL_IM_CRM_ISA_GDS_ORDERITM ORDTMPITM CL_IM_CRM_ISA_GDS_ORTMPITM QUOTITM CL_IM_CRM_ISA_GDS_QUOTITM RETURNITM CL_IM_CRM_ESRV_RET_ITEMS COMPLITM CL_IM_CRM_ESRV_COMPL_ITEMS All of these BAdI implementations make usage of the powerful helper class “CL_ISA_GEN_DOC_SEARCH_HELP”. It returns items instead of header objects. To communicate with the reporting framework the helper class provides various methods to format the incoming search request and convert it into a reporting framework query. This implementation is used to search for items within CRM return transactions. This implementation is exclusively used to select contract documents. Orders. It returns items instead of header objects.Development and Extension Guide – SAP E-Commerce 7. It first decides where to read the documents (R/3 or CRM) and also what type of documents (invoice. This implementation is used to search for items in 1Order order template documents. This implementation is used to search for items within CRM complaint transactions. It returns items instead of header objects. All methods related to the reporting framework have the prefix ONEORDER_. This implementation is used to search for items in 1Order quotation documents. August 2008 112 .Development and Extension Guide – SAP E-Commerce 7. If none of the prefixes is used the method has common character and can be used for reporting framework and billing.0 Same applies to the billing documents except the prefix of the methods is BILLING_ and the selection is covert by the function module “/1BEA/CRMB_BD_O_GETLIST” or “CRM_ISA_INVOICE_LIST_GET” for R3 billing documents. down payments Even sales documents are defined.order templates Even billing documents are defined.credit memos . order template items. For 1Oder document search “SearchCriteria_B2B_Sales”.quotations . To search for 1Order document items (order items. Forwarding to “SearchCriteria_B2B_Items” if items should be searched.Development and Extension Guide – SAP E-Commerce 7. Known search definitions in ESelling Search Screen Definition SearchCriteria_B2B_Sales Scenario B2B Remarks To search for sales documents. via JScript search definition “SearchCriteria_B2B_Sales” is called. but the actually search is not done by the Generic Search Framework To search for sales documents To search for customers in a BOB scenario SearchCriteria_B2B_Items B2B (CRM) SearchCriteria_B2B_Contracts SearchCriteria_B2B_Sales_OrderStatus_Items B2B B2B SearchCriteria_B2B_Billing B2B SearchCriteria_B2B_Billing_BillingStatus_Items B2B SearchCriteria_B2B_Auction B2B SearchCriteria_BOB_Sales SearchCriteria_BOB_Customers Business on Behalf Business on Behalf August 2008 113 .0 ESelling specific implementation of the Generic Search Framework The section before gave a detailed overview of the different components of the Generic Search Framework. once one of those is selected. To search for billing document items (used to find items in case of large document handling is enabled in the shop) Only describes the search criteria.orders . . once one of those is selected. independent from an application.invoices . via JScript search definition while for Billing documents “SearchCriteria_B2B_Billing” is called To search for contract documents To search for sales document items (used to find items in case of large document handling is enabled in the shop) To search for billing documents . quotation items). The components are designed to work in a generically way. 1. This section now focuses on the integration of the Generic Search Framework into the CRM ESelling web application. via JScript search definition “SearchCriteria_B2B_Billing” is called. * @return ResultData containing file names */ public ResultData getJScriptFilesTab() { ResultData retObj = super.ui. Adding JScript file to the genericsearch.insertRow().Development and Extension Guide – SAP E-Commerce 7. Definition of the first search screen to come up in the B2B scenario on the left side of the application (Shuffler / Navigator).isa. Therefore method “getJScriptFilesTab” is implemented the following way.jsp"). TableRow tabRow = tab.getJScriptFilesTab(). extending the base one.getTable(). Dynamically disabling document types which are not allowed by shop settings or user permissions. Table tab = retObj. on the <html> page only appear the once allowed by the shop settings.jsp. xcm\sap\configuration\config-data. Even in a search definition.uiclass. 4.jsp The UI class mentioned in 3. /** * Returns the name of JScript files which should be included.criteria" uiClassName="com.setValue("FILENAME".GenericSearchISAUI" type="search"> For the standard search definitions.xml <component id="shop"> <configs> <config id="crmshop_b2b"> <params id="shopsettings"> <param name="shopscenario" value="B2B"/> <param name="documentsearch.genericsearch. also allows to add new JScript files to the genericsearch. all Internet Sales known document types are defined. August 2008 114 . "b2b/jscript/showSoldTo. for example “SearchCriteria_B2B_Sales”.0 SearchCriteria_HOM_Sales Hosted Order Management To search for order document in a HOM scenario 2.name" value="SearchCriteria_B2B_Sales"/> 3. tabRow. this class takes care to remove all document types which are not allowed by shop settings or where users permission are insufficient.sap. <screen-group name="search_criteria" description="search. In the <screen-group> it is possible to define a UI class. g. Selling via Ebay). Design Consideration When the first Java version of E-Commerce was released there was neither a logging API within the Java Development Kit. Instead.logging. It is therefore recommended to stay with ISALocation in already existing coding (e. SAP Logging API is only used for new applications in E-Commerce (e.0 exclusively the SAP logging API below the ISALocation API is used.IsaLocation.core. In order to be able to switch to this logging API without changing the application coding it was decided to introduce an own logging facade (API) over the existing log4j API. an open source LOG4J logging API was well accepted within the Java community. a console.0 Logging/Tracing Logging/Tracing provides a means for the user to write structured data into a file.sap.g. For new customer projects it is recommended to use the SAP Logging API directly. or some other output destination. Most of the E-Commerce coding is still using ISALocation.isa.0 to ECO 5. nor an SAP logging API. B2B). Difference between Logging/Tracing Tracing Trace messages are: Usually turned off (trace level ERROR) A Mechanism for development/support o Target group: developers and support Traces write using Locations => where did something happen? August 2008 115 . Extensions on existing customer coding already using ISALocation New Customer Project Application classes ISALocation SAP Logging API Figure 21: Design of Logging / Tracing The used logging facade is represented by the class com. not for extensions on existing applications (e.g.0).Development and Extension Guide – SAP E-Commerce 7. This chapter gives background information on how to use and configure logging/tracing within the Internet Sales application. customer projects migration from ECO 4. Since SAP E-Commerce 4. When designing the E-Commerce architecture it was clear that there would be a time when a new logging API (either from SUN or SAP) would be released. August 2008 116 . ..isa..sap.0 A trace message can have the following content: Information about execution steps Value of important variables Important return codes Information about thrown Exceptions Logging Log messages are: Always turned on (log level INFO) Mechanism of normal operation o Target group: Administrators Logs write using Categories => what has happened? A log message can have the following content: Description of Message Possible Impact? Possible reasons? Information about further information (notes.core.) Logs are usually read by system administrators.LogUtil for constructing log messages.Development and Extension Guide – SAP E-Commerce 7. It is therefore important to provide enough information in order to enable the administrator to understand the message or to solve a potential problem. documentation. In order to have a uniform log output there are some helper methods in the class com.logging. admin developer. Exception meaningful for developer Table 28: Types of Tracing PATH ERROR APIs for Tracing: ISALocation You should only use the ISALocation if you already enhanced the E-Commerce 4. support customer. support What to use log record trace record log record trace record trace record Table 27: Types of Log Messages Tracing Use the following severities to write trace messages: Severity DEBUG Description Developer trace. Entering/exiting non trivial method public void entering(String method) public void exiting() August 2008 117 .Development and Extension Guide – SAP E-Commerce 7. please use the SAP Logging API instead.class.getName()). Initializing Location private static final IsaLocation log = IsaLocation. or if you do enhancements for new applications. support developer. Any information useful for a developer in order to understand program execution path For Information on entering/exiting methods.getInstance(ClassName. Useful for important methods.0 Summary Types of log messages Message Type message message exception exception entering/exiting method Interested Party customer or admin developer. If you don’t have enhancements.0 solution. This makes it easy to use the exiting() trace as well as debugging. Throwable th) public void throwing(Throwable th) DEBUG Use the following methods to write trace messages with the severity level “DEBUG”: public void debug(Object message) public void debug(Object message. Throwable t) Coding Examples Strings are traced as passed to the methods (no resource keys). Throwing exception Use the following methods to write trace messages with the severity level “ERROR”: public void throwing(String message. Object params[]. Throwable t) public void error(Object message.0 Try to use only a single return statement in methods.Development and Extension Guide – SAP E-Commerce 7. August 2008 118 . Throwable t) ERROR Use the following methods to write trace messages with the severity level “ERROR”: public void error(Object message) public void error(Object message. exception".lang. // with some additional information log.lang.lang. // simple developer trace log. PATH is internally used as severity.Object[] args) August 2008 119 .getInstance(ClassName. Contrary to the IsaLocation you pass the class object instead of a string DEBUG Use the following methods to write trace messages with the severity level “DEBUG”: debugT(java. APIs for Tracing: SAP Logging API Initializing Location private static final Location loc = Location.String msg) debugT(java. ex). Trace only if relevant for support log.String subloc. java.lang.class.lang. // No stacktrace is printed log. log.lang.Object[] args) debugT(java.String msg.throwing("exception trace for support".exiting().lang.0 protected static IsaLocation log = IsaLocation.lang.class). java.Development and Extension Guide – SAP E-Commerce 7.debug("This is a trace message").error.getLocation(Node.String msg) debugT(java.throwing(ex).String msg.getName()).entering("myMethod()").error("isatest. java.String subloc. // entering exiting method log. // catching exception. java. // Tracing when throwing exception for dev/support. ex). lang.Throwable exc) Trace message with stack trace of given exception. java.lang.lang.String subloc.lang.Throwable exc) August 2008 120 . that is only relevant for developers or the support: throwing(java.lang. java.lang. java.String msg. java. java.lang.lang. java.String msg.String msg) errorT(java.lang.Throwable exc) traceThrowableT(int severity.Development and Extension Guide – SAP E-Commerce 7. java. into this location.lang.lang.String subloc.lang.String subloc.lang.0 ERROR Use the following methods to write trace messages with the severity level “ERROR”: errorT(java.String msg.Object[] args) exiting() exiting(java.lang.Throwable exc) throwing(java.Object res) Throwing exception Use the following methods to write trace messages when an exception is thrown.Object[] args) Entering/exiting non trivial method Use the following methods to write trace messages with the severity level “PATH”: entering(java.lang. traceThrowableT(int severity.String subloc) entering(java. java. isa.sap.core.core.a.core.isa.LogUtil com.core.LogUtil com.logging. but later follow-up activity by people responsible for the specific category is necessary to avoid error situations in the future. The application is still usable.sap.LogUtil com. Information of how to solve the problem in the future should be available. The application processing terminates without completing the desired tasks.logging.g.a. Struts actions) Defined in com.log/applications.LogUtil /Applications/Interaction com.e.sap.core.LogUtil com.isa. cache.core.isa.LogUtil Table 30: Categories for Logs August 2008 121 .) User Interface Layer (e.core. in ECO everything related to (mis-)configuration everything related to security everything related to infrastructure i. If not. It should help to understand the normal operation or could provide further information for later reviews. Customers will normally need to open problem messages to solve the problem.logging. The application processing can and will proceed. which does not have and also does not need any follow-up activity. etc.isa. JSPs) functionality dealing with business logic (e.logging.logging.sap. generic services (JCo. in ECO n.isa. The application is not usable anymore and cannot be started without corrective actions by experts.core. E-Commerce Business Objects) classes controlling the interaction with the user (e. database.isa.LogUtil com.g.Development and Extension Guide – SAP E-Commerce 7. The application processing terminates without completing the desired tasks.isa. customers will need to open problem messages to solve the problem.sap.logging.sap. Table 29: Log Levels Warning Error Fatal Usage of Categories Application categories for messages related to application operation tasks.logging.sap. Category /Applications/Common/Backup /Applications/Common/Archiving /Applications/Common/Configuration /Applications/Common/Security /Applications/Common/Infrastructure When to use n.0 Logging Use the log levels according to the following table: Severity Info Description Informational text to record an event. audits or investigations.g. Information of how to solve the problem should be available. but corrective actions need to be performed to avoid the erroneous termination in the future.LogUtil /Applications/UserInterface /Applications/BusinessLogic com.logging. Predefined Application categories are written to .sap. Object key) public void error(Category category. Object key) public void info(Category category. Object key. Object key. Object key) public void warn(Category category. Object key. Object[] args) public void warn(Category category. Object key.Development and Extension Guide – SAP E-Commerce 7. Object key. Throwable t) INFO Use the following methods to write log messages with the severity level “INFO”: public void info(Category category. Object key.0 APIs for Logging: ISALocation ERROR Use the following methods to write log messages with the severity level “ERROR”: public void error(Category category. Object key) public void fatal(Category category. Object key. Object[] args. Throwable t) public void error(Category category. Object key. Object[] args) public void error(Category category. Object key. Object[] args. Object[] args) WARNING Use the following methods to write log messages with the severity level ”Warning”: public void warn(Category category. Object[] args. Object[] args) public void fatal(Category category. Throwable t) public void warn(Category category. Object key. Throwable t) FATAL Use the following methods to write log messages with the severity level “FATAL”: public void fatal(Category category. Throwable t) public void fatal(Category category. Throwable t) August 2008 122 . String reasonKey.description.user.failure.failure.description.Development and Extension Guide – SAP E-Commerce 7.locked". // logging using detailed descriptions // example of a log entry indicating that a user was locked log.getLogMessage( "logon.info(Category. String furtherInformationKey) If null is passed as a parameter the parameter is omitted in the log output.logon. August 2008 123 .description". "isa. String furtherInformationKey) public static LogMessage getLogMessage(String descriptionKey. new Object[] { userName }). "logon.description.failure". String impactKey.APPS_COMMON_SECURITY.wronglogon". These messages can be created using the following methods in the class LogUtil: public static LogMessage getLogMessage(String descriptionKey.security. String reasonKey.0 Detailed Message Descriptions It is recommended to use detailed message descriptions. String impactKey.failure. "logon. Coding Examples When logging it is necessary to use resource keys: // log with parameters log.failure. "logon. Object[] descrParams.info(LogUtil.howtounlock")).APPS_COMMON_SECURITY. The return value can be directly passed to all logging/tracing methods. LogUtil. Object[] args.lang.Object msgCode.Development and Extension Guide – SAP E-Commerce 7.Object[] args. java. java.lang.WARNING.String msgClear. java.ERROR.Object msgCode.lang.lang. java. java. java.Object msgCode) info(Location loc.lang.String msgClear. java. java.Object msgCode.lang.lang.lang.lang.Object[] args) logThrowable(Severity.Object[] args) warning(Location loc.Object msgCode.Object msgCode.lang.lang.Object msgCode. java.Object msgCode) error(Location loc.lang.lang. java. java. Location loc. java.ERROR.lang.Throwable exc) logThrowable(Severity. java. java. java.Object[] args) WARNING Use the following methods to write log messages with the severity level “WARNING”: logThrowable(Severity.String msgClear. Location loc.lang.lang.String msgClear.lang. java. java.0 APIs for Logging: SAP Logging API INFO Use the following methods to write log messages with the severity level “INFO”: info(Location loc.WARNING.lang. java.Throwable exc) FATAL Use the following methods to write log messages with the severity level “FATAL”: August 2008 124 .lang.Object msgCode. java. java.lang.lang.Object msgCode) ERROR Use the following methods to write log messages with the severity level “ERROR”: error(Location loc. Location loc.lang. java. Location loc. java. java.lang.Throwable exc) warning(Location loc.Throwable exc) logThrowable(Severity. java.lang.Development and Extension Guide – SAP E-Commerce 7. 2. java.lang. iv. Trace the entering and exiting of important method. All methods of business objects which lead to CRUD operations on data. Location loc.0 fatal(Location loc.FATAL.Object msgCode) fatal(Location loc. java. you have to trace the exit in a finally clause.lang. java. Define the Location which is used for your class as static final.lang. All UI actions. In general following methods must be traced: i.FATAL.String msgClear. java.lang. it is required that you trace the exit too! If the method might throw an exception causing the execution flow to exit the method.lang.Object msgCode.Object[] args) logThrowable(Severity.String msgClear.Throwable exc) How to Log/Trace: Usage patterns As a general rule.lang.Object msgCode. java. August 2008 125 . The following guidelines define some useful patterns a developer should follow when using log and trace. java. trace messages are meant for developers to understand the execution flow of the program.Throwable exc) logThrowable(Severity. Use a final String object to hold the name of the method you are tracing. ii. java.lang. 1. Log messages are used by system administrators to monitor the health of an application. event handlers (struts actions.lang. iii. java. Location loc. do* methods) of UI layer.Object[] args.lang. If you do trace the entry of a method.Object msgCode. All init/close start/stop methods calls. The severity level is PATH. java. All methods of backend objects which trigger backend calls. getName()). Trace the throwing of exceptions. In general. // If trace entering/exiting important method using SAP location API private static final Location loc = Location. Example // If Trace throwing exception using ISALocation private static final ISALocation loc = ISALocation.getLocation(ClassName.exiting(). It is up to the calling layer to interpret the raised exception for appropriate logging. // … public void methodX() throws MyException { //… final String msg = “information about the exception”. there is no need to log the throwing of an exception. // If Trace throwing exception using SAP logging API private static final Location loc = Location. Throwable err) or throwing(Throwable err) API to trace the exception. loc.class).class.class). } 3.getInstance(ClassName. Use throwing (String msg. The severity level is PATH.Development and Extension Guide – SAP E-Commerce 7. MyException err = new MyException(…). //do some proecssing … loc. err).throwing(msg.getLocation(ClassName.0 Example // If trace entering/exiting important method using ISALocation private static final ISALocation loc = ISALocation.getInstance(ClassName. loc.entering(METHOD_NAME). } August 2008 126 . // … public void methodX() { final String METHOD_NAME = " methodX()".class). ex). // write the context information to help in error support log. // … public void methodX() throws SQLException { //… try { // do something … } catch (SQLException ex) { // If using ISALocation loc. you should: Use severity level WARNING Trace the alternative operation. Bubbling the caught exception i. If in the catch clause. following are some common cases which should be handled differently.APP_COMMON_SECURITY.0 4. you should: Log the catching exception.Development and Extension Guide – SAP E-Commerce 7. throw ex. i. args.class).e.throwing(ex).e.class. in general. Catching Exceptions. msg. the exception is handled in the catch clause and an alternative operation is chosen to replace the normal operation.getLocation(ClassName.error(Category. When catching an exception. Example // If Log bubbling caught exception using ISALocation private static final ISALocation log = ISALocation. August 2008 127 . } //… } Recover from the caught exception or perform an alternate operation or ignore the caught exception. In case of recovering from the exception.getName()). the same exception is propagated to higher layers. // If Log bubbling caught exception SAP logging API private static final Location loc = Location.getInstance(ClassName. the caught exception is bubbling to the caller. Use the appropriate Severity ERROR or FATAL Trace the throwing of exception. Development and Extension Guide – SAP E-Commerce 7. // If Trace recover from caught exception using SAP logging API private static final Location loc = Location.ex). In case of throwing a wrapper exception.getInstance(ClassName. log.Applications.warning(Category. you should: User severity level ERROR or FATAL Trace the throwing exception August 2008 128 .class. // perform recover/alternate operation } //… } Throwing a wrapper exception.getName()).class). args. // … public void methodX() { //… try { // do something … } catch (InternalException ex) { // If using ISALocation log. "messageKey".0 Example // If Trace recover from caught exception using ISALocation private static final ISALocation log = ISALocation.getLocation(ClassName.info(“Do something to recover from exception”). To help identify problems. throw wrapperEx."messageKey". args. // … public void methodX() throws WrapperException { //… try { // do something … } catch (SQLException ex) { // If using ISALocation log.Development and Extension Guide – SAP E-Commerce 7.wrapperEx).error(Category. For detailed context information including state variables use severity DEBUG. Use severity INFO for events that need to provide information about the progress of an operation. August 2008 129 .getName()).getInstance(ClassName. Never hide exceptions you cannot handle. it is important to log context information for the error condition. 6.getLocation(ClassName. // log context information to help in error support WrapperException wrapperEx = new WrapperException(ex).APP_COMMON_SECURITY.ex). } //… } 5. It is especially important that sufficient context information is logged and traced for an error condition.0 Example // If Trace the throwing a wrapper exception using ISALocation private static final ISALocation log = ISALocation.class).args. log. // If Trace the throwing a wrapper exception using SAP logging API private static final Location loc = Location.throwing(“messageKey”.class. } catch (SQLException ex) { // If using ISALocation log. log.getName()).getInstance(ClassName. new Object[]{obj}).”Error saving business object {0}”. new Object[]{user}).Applications.args. ex).error(Category.0 Example // If Trace the throwing a wrapper exception using ISALocation private static final ISALocation log = ISALocation. DBException wrapperEx = new DBException(ex). new Object[]{obj}).”error. } //… } August 2008 130 .”saved business object {0}”.wrapperEx). throw wrapperEx.error(Category.class).info(“rollbacked transaction”). log. // perform some sql operation … // commit transaction log.throwing(“messageKey”.class. // rollback transaction log.Development and Extension Guide – SAP E-Commerce 7. // If Trace the throwing a wrapper exception using SAP logging API private static final Location loc = Location. // … public void save() throws DBException { //… try { // start transaction log.info(Category. APP_COMMON_SECURITY.info(“commited transaction”).getLocation(ClassName.info(“started transaction for user”. log.APP_COMMON_SECURITY.sqlerror”. The cache is initialised when the application is started.xml file: Example In a customer project you have to add the cache configuration in the file WEB-INF/xcm/customer/modification/cache-config.xml <regions> <!-. Working with the Cache The cache is divided in so called regions. TimeToLive Sets the maximum time the object will stay in the cache before it becomes invalidated (in minutes). we recommend you do it within the cache-config.0 All purpose Cache Internet Sales comes with an all purpose cache. which can be used to store any arbitrary data.xml#xpointer(cache/regions/*)’/> <!-. The cache is accessed using an Access object: The Access Object provides methods to add and remove objects from the cache: August 2008 131 . These attributes define how the cache handles objects cached in the region. Each region represents an individual cache and the region name is used to distinguish between caches. Although you can initialise the cache in programming. If you need your own cache you have to add a new region together with attributes. The most common attributes are: IdleTime Sets the maximum time the object will remain in the cache without being referenced (in minutes).Development and Extension Guide – SAP E-Commerce 7. This chapter describes how to use and configure the cache.defines customer project cache --> <region name=‘Z_AcmeCache’ idleTime=‘60’ timeToLive=‘300’ descr=‘Project ACME cache’/> </regions> You get an overview of existing caches in the ISA Administrator area at: http://host:port/b2b/admin => System cache statistics.includes SAP cache configuration --> <xi:include href=‘${sap}/modification/cache-config. } catch (Exception ex) { log.getAccess(‘Z_AcmeCache’).error(‘z_cache.isa. props : Properties) +terminate() MyInitHandler +initialize() +terminate() The initialize() method is called when the application is started. // getting object from Cache System.put(‘msg’. // store an object in the Cache access.error’.out.Development and Extension Guide – SAP E-Commerce 7. The file has the following structure: <initializations> <initialization className=‘com. These parameters are passed as Properties to the initialize() method. This gives the handler the opportunity to perform some initialisation tasks. Any number of parameters can be defined in the body of the initalization XML element. This gives the handler the opportunity to perform some clean up work. The terminate() method is called when the application is stopped or the SAP J2EE engine is shutting down.cache.init.CacheInitHandler’> <param name=‘paramName’ value=‘paramValue’/> </initialization> </initializations> The className attribute contains the class name of the handler.0 Example try { // The cache is accessed using an Access object Cache.Access access = Cache.println(access. August 2008 132 .Initializable interface «<<interface>>» Initializable +initialize(env : InitializationEnvironment. } Initialization Handler When the Internet Sales application is started a number of Initialisation Handlers are executed.sap.core.core. ‘This is a string’).sap.isa. Each Initialisation Handler implements the com.get(‘msg’)).xml file. null. ex). Initialisation handlers are registered in the init-config. xml (as in the example bove). In this case you have to use the XCM Extension mechanism.xml' on page 274.0 If you write your own init handler in customer projects you have to add it to the file WEB-INF/xcm/customer/modification/init-config.xml. An example is given in chapter 'Changes in init-config. August 2008 133 . If you have to change settings of existing init handlers you can also do this in the file WEB-INF/xcm/customer/modification/init-config.Development and Extension Guide – SAP E-Commerce 7. xml or scenario-config. ICSS. The tool enables you to maintain the configuration for each deployed web application via the URL: http://localhost:50000/<web application>/admin/xcm/init.Development and Extension Guide – SAP E-Commerce 7. Separation of Customer and SAP Configuration Files XCM divides configuration data into two areas: Data maintained by SAP o o This data must not be changed by the customer.xml You should never change the files config-data.xml. It is located in the folder: <APPLICATION_HOME>\WEB-INF\xcm\sap Data maintained by the customer o o o Only these configuration settings should be changed by the customer. take place in init-config.0 -> Installation & Upgrade. XCM basically separates XML based SAP settings from settings done by the customer. connection parameters to the SAP system). done by customers. XInclude is used to include SAP configuration into the customer template.0 Extended Configuration Management (XCM) Extended Configuration Management (XCM) is a new concept for Java applications (Internet Sales. This is done using XCM Administrator August 2008 134 .xml or backendobject-config. the XCM Administrator tool cannot be used for less common settings. The XCM Administrator tool has been developed for general configuration activities (for example.do. In most cases customer changes. Changes are made using XCM extension mechanism. However. In this case configuration changes must be done manually. IPC Web Application). It is located in the folder: <APPLICATION_HOME>\WEB-INF\xcm\customer The customer files consist of empty templates. An XCM Administrator tutorial can be found within the ‘CRM Web Application Installation Guide’ on the SAP Service Marketplace under the alias CRM-INST -> SAP CRM 4. sap.xcm.xml: <initializations xmlns:isa=‘com. or assign backend classes to customer specific business objects (backendobject-config. Separation of Configuration Data and Modification Data Besides the separation of SAP and customer data there is another separation of data. this is often changed).xml) Modify parameters in the standard init-config. Modification data is rarely changed and therefore not maintained in the XCM Admin tool.config’ xmlns:xi=‘http://www. data used for configuration of the application (for example.isa.xml) Customer extensions to XCM Admin meta-data (xcmadmin-config. The following chapter explains how the extension mechanism works. The location of the customer configuration data is located in the folder specified using the context parameter customer.xml) Modfiy cache configurations (cache-config. Here you can: Reassign backend classes to standard business objects.w3.config.Development and Extension Guide – SAP E-Commerce 7.sap.customer changes in init-config should be done here by extending/overwriting the base configuration--> <xi:include href=‘${sap}/modification/init-config. and modification data (this data is rarely changed).path.xml) The XCM administration UI is used for configuration of these two files.0 Example This is the customer version of the file init-config. If you want to change settings you must use the XCM extension mechanism. There are two files used for this kind of configuration: Configuration of scenarios (scenario-config.core.xml) Add configuration scope parameters accessible from the Interaction Layer (interactionconfig. connection data to the SAP System.xml#xpointer(initializations/*)’/> </initializations> The xi:include XML element includes the SAP version of configuration settings.w3. That is. This is not covered in this guide. The customer modification data is located in <APPLICATION_HOME>\WEB-INF\xcm\customer\modification. August 2008 135 .xml).org/2001/XInclude’ xmlns:xml=‘http://www. or activate tracing for function modules in the backend system (modificationconfig.xml (for example.xml) Configuration of components (config-data.config.xml) Replace function module calls in the backend system. assign event listener classes to function module calls.org/XML/1998/namespace’> <!-.xml) Reassign business object managers or add new BOMs (bom-config.xml) Modify connection definitions (eai-config.isa.com. change the event capture handler to Tealeaf (init-config. 3. where applicable. August 2008 136 . The isa:extends XML element has the following syntax: isa:extends=‘XPointer to base node’ The following example illustrates how the extension mechanism works: <configs> <config id=“configdata“> <params id=“logoncrm“> <param name=“user“ value=“john“/> <param name=”password” value=”secret”/> </params> </config> <config id=“TestConfigData“ isa:extends=”.' means go back one node. Change existing configuration.. 2. Add new configuration information.. You read the path to the base node as follows: '. /config[@id='configdata'] means go to node named 'config' with attribute 'id' having value 'configdata'. Use the isa:extends XML tag to inherit from the configuration you would like to change.Development and Extension Guide – SAP E-Commerce 7. After performing this you are in the configs node./config[@id=’configdata’]”> <params id=“logoncrm“> <param name=“password“ value=“topsecret“/> <param name=”language” value=”de”/> </params> </config> </configs> The node with the id TestConfigData extends the node with id configdata. If you want to change existing configuration you have to perform the following steps: 1.0 XCM Extension Mechanism The XCM extension mechanism enables you to manipulate XML nodes using inheritance. Development and Extension Guide – SAP E-Commerce 7.0 After XCM has processed the XML document it is displayed as follows: <configs> <config id=“configdata“> <params id=“logoncrm“> <param name=“user“ value=“john“/> <param name=”password” value=”secret”/> </params> </config> <config id=“TestConfigData“ isa:extends=”../config[@id=’configdata’]”> <params id=“logoncrm“> <param name=“password“ value=“topsecret“/> <param name=”language” value=”de”/> <param name=”user” value=”john”/> </params> </config> </configs> <param name=‘password’ value=‘topsecret’/> has extended the base node and changed the value to topsecret. <param name=‘language’ value=‘de’/> was added by the extending node. <param name=‘user’ value=‘john’/> was inherited from the base node. If you only want to change certain settings from the base configuration it is sufficient to specify only those parameters you need to change. All other parameters can be omitted, as they will be derived. Web Application Configuration and Components The term web application configuration is equal to the term 'scenario' used in some releases within the XCM Administrator. The XCM Administration tool is used for creating a web application configuration. Each application provides one or more pre-defined configurations. You have to create your own configuration based on one of the delivered configurations and then adjust it to your needs. A customer configuration consists of the following: Configuration name Base configuration (the SAP configuration on which the customer bases his configuration) A number of configuration parameters with associated values o Some of these values refer to a component configuration (e.g. the JCO component configures connection parameters to the SAP system) Refer to chapter ‘ August 2008 137 Development and Extension Guide – SAP E-Commerce 7.0 Extending XCM with Customer Settings’ (page 277) to get information how to do custom extensions in the XCM. August 2008 138 Development and Extension Guide – SAP E-Commerce 7.0 SAP Java Remote Function Call (JRFC) The SAP Java Remote Funciton Call (JRFC) is a middleware product that enables communication between Java applications and any SAP systems. The JCo supports both inbound (Java calls ABAP) and outbound (ABAP calls Java) communication. For a general introduction to the SAP JRFC, see the official Java Connector documentation [4]. Since SAP NetWeaver’04, the JCo is a component of the SAP Web Application Server and is called JRFC. Technology JRFC communicates with the SAP system via Remote Function Call (RFC). The RFC is SAP’s own representation of the Remote Procedure Call (RPC). Since the RFC is an ABAP component, it is frequently used when at least one of the communication partners is an ABAP program. The RFC is frequently used in the following scenarios: Both programs are written in ABAP, and an ABAP program calls a different ABAP function (function module) in a different program or SAP system An ABAP program calls a function in a non-SAP system A program in a non-SAP System calls a function module in an SAP system A program in a non-SAP system calls a function in a non-SAP system The Java developer uses the JRFC Java API to communicate with the SAP system. The JRFC middleware layer ensures that communication with the SAP system is transparent for the Java developer. This includes, for example, mapping ABAP data types to Java, or table handling. August 2008 139 Development and Extension Guide – SAP E-Commerce 7.0 Development Environment This unit introduces the development tools that are required for both installing and developing all of the required frontend components and the CRM java applications. It describes how to use the Netweaver Development Infrastructure (NWDI) to modify or extend CRM and ERP Java Web Applications. The Netweaver Development Infrastructure supports integration of patches, Service Packs and upgrades to new releases without loosing modifications or enhancements and it supports team development. We will discuss the following components: Java Development Kit (JDK) NetWeaver’04s Java Development Infrastructure (NWDI) NetWeaver’04s Java Integrated Development Environment (IDE) NetWeaver’04s Java Application Server CRM 5.0 Java Components All examples and operating system specifications in this document refer to Windows. The following diagram shows a typical Development landscape: NWDI – Landscape Overview < Local Installation on Developer‘s PC > SAP NetWeaver Developer Studio <--------------- Central Infrastructure ------------------> Component Build Service (CBS) Design Time Repository (DTR) Name Server Local File System Local J2EE Engine Change Management Service (CMS) Component Model Run Run Time Deploy Time J2EE J2EE Systems Systems System Landscape Directory (SLD) The first of this unit deals with installing and configuring the SAP NetWeaver Development Infrastructure which is a precondition for the development. The second part handles the installation and configuration of a developer workplace. August 2008 140 Development and Extension Guide – SAP E-Commerce 7.0 Development Tools and Concepts The SAP NetWeaver Developer Studio provides access to the SAP NetWeaver Java Development Infrastructure. It enhances the concept of an IDE by server-side services, centrally provides the development teams with a consistent development environment and supports the software development during the entire life cycle of a product. Design Time Repository (DTR): Versioning source code management. Distributed development of software in teams. Transport and replication of sources. Component Build Service (CBS): Central build based on the component model. Change Management Service (CMS): Central administration of the Java development landscape and the transports covering the entire software life cycle. Software Deployment Manager(SDM): Manual and automatic deployment of archives in central runtime systems. System Landscape Directory (SLD): Information on the system landscape. Name Service Central check instance for the uniqueness of names. Java Dictionary: Supports the global definition of tables and data types SAP Java Test Tools: Predefined static tests and runtime tests for the Java development You use the development configuration to configure the development environment. The access paths for the used services are automatically set by importing a development configuration, for example, the URI of the used DTR. You can develop in the development infrastructure either according to the component model. External documentation This document refers to the following official documents delivered by SAP in the help portal ( http://help.sap.com ) : Administration manual of NWDI : o http://help.sap.com/saphelp_nw04/helpdata/en/49/e98876e9865b4e977b54fc090df4ed/f rameset.htm Overview of process CRM Software Components delivered by SAP are imported in a track. Some of the components are designed to be modified. Others are required for compiling and building the application. August 2008 141 Development and Extension Guide – SAP E-Commerce 7.0 Software Component Architecture of the CRM or Extended Ecommerce Java Applications The components SAP-SHRWEB.sca SAP-SHRAPP.sca SAP-CRMWEB.sca and SAP-CRMAPP.sca are designed to be modified and extended in the NWDI. They contain the web files for the E-Commerce Applications, the IPC Web Applications and the Workforce Management Applications. For E-Commerce for mySAP ERP SAP-SHRWEB.sca SAP-SHRAPP.sca are designed to be modified. If you plan to extend database tables you can modify the component SAP-CRMDIC.sca, in the NWDI as well. The components sap.com~STRUTS.sca sap.com~SAP-IPCMSA.sca sap.com~SAP-CRMJAV.sca sap.com~SAP-SHRJAV.sca TEALEAF.sca are designed not to be extended or modified in the NWDI. They are required for compiling and building the applications. August 2008 142 sca sap. IPC Web Applications and Workforce Management Contains J2EE Applications and deployable Libraries. icss (Internet Customer Self Service) Proceed as follows to modify the Web User Interface: Open the Netweaver IDE and connect to the CRM Track. August 2008 143 .com_SAP-SHRWEB or SAP-CRMWEB Select the Development Component of the web application you want to modify (E.sca Yes Yes Contains Web Modules for E-Selling. Modifications and Extensions of the Web User Interface The web user interface of the CRM Applications is contained in the Software Components SHRWEB or CRMWEB. The required Software Components will be selected automatically. Open the Development Configuration Perspective: Choose Window -> Open Perspective -> -> Development Configuration in the Netweaver IDE menu.sca TEALEAF.sca SAP-CRMWEB. ipc (Internet Pricing and Configuration) or wfd (Workforce Management).0 The following table shows all components at a glance: Software Component Software Component for Developement Yes Used in ERP Used in CRM Usage SAP-SHRWEB.Development and Extension Guide – SAP E-Commerce 7.sca SAP-CRMAPP. Contains Data Dictionary Development Components Contains required jar Files for compiling and building Contains required jar Files for compiling and building Contains required jar Files for compiling and building SAP-SHRAPP. For each web application there is one Development Component. Contains Web Modules for other ECommerce Applications Contains J2EE Applications and deployable Libraries.sca Yes Yes Yes Yes No No No Yes No No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Table 31: Software Components Thus.sca SAP-IPCMSA.sca into the list of the Software Components for Development. crm/isa/web/b2b) and Choose “Create Project” from the context menu (right mouse click).sca and SAP-SHRAPP. The naming convention for the Web Module Development Components is as follows: crm/<shortcut for business scenario>/web/<application name> where <shortcut for business scenario> is either isa (E-Commerce). Accept the list of Components to be synched.sca SAP-CRMDIC.com~STRUTS. you must add the components SAP-SHRWEB.g. Select the “Inactive DC’s” Panel Open the Software Component sap. eservice (service parts management). Refer to the NWDI Online help for more detailed informations. By default it contains no classes. Accept the list of Components to be synched. Search for “Changing Used DC” in the online documentation of the SAP Netweaver IDE to find out how to do this. If crm/isa/web/b2b needs classes of crm/home/shr/ext. August 2008 144 .Development and Extension Guide – SAP E-Commerce 7.com_SAP-SHRWEB Select the Development Component crm/home/shr/ext and Choose “Create Project” from the context menu (right mouse click).g. E. Now you can add new classes to the Development Component in the Java Perspective of the NWDI. Open the Development Configuration Perspective: Choose Window -> Open Perspective -> -> Development Configuration in the Netweaver IDE menu. the Used Relationship must be created in crm/isa/web/b2b. the Used Relationship to the public part “assembly” must be added for the Web Module Development Component of the application.0 Figure 22: Extend and Modify CRM Web Apps • • • • Do all modifications in SAP-CRMWEB or SAP-SHRWEB Put own Java classes in Development component crm/home/shr/ext or crm/home/crm/ext Add the used relationship to these components to all web modules which need the java extensions Modify the jsp‘s in the SAP original components in order to be able to do conflict resolution when applying new patches Extensions of the Java Code The Software Component SHRWEB contains the Development Component crm/home/shr/ext. It must refer to crm/home/shr/ext. Select the “Inactice DC’s” Panel Open the Software Component sap. If the classes are required by a web application. The web applications Development Components have no Used Relationships to crm/home/shr/ext. Create new Java classes as follows: Open the Netweaver IDE and connect to the CRM Track. It’s designed to contain customer Extensions. 0 Merged Web Applications All CRM Java applications have the same structure. Figure 23: Merged Web Files Shared components are java Development Components. Restrictions Due to the fact. This development component type is based on a regular Java Development Component with a public part of purpose "compilation". they can't be used for compiling. There are some files which need to be available in all applications. there is a shared web component DC introduced. the version of the file from the web module will be in the generated web application.Development and Extension Guide – SAP E-Commerce 7. For this reason. So. CRM web archive must not contain java classes. it's not predictable which version of the file will be merged into the web module. August 2008 145 . These files can be merged into other web archive Development Components by defining a used relationship in the web module to the shared web component. because the compile time dependancy has a special meaning! Files in src/packages directory of the shared component will be merged into the web archive at build time Shared files can be overwritten by files in the web archive if they have the same name and directory Handling of duplicate files If the a file with the same name and directory exists in two different shared web components. If a file is contained in one shared web component DC and in the web module DC. CRM java applications should not contain java source files. that the used relationships to java development components are used for merging web files . Despite normal java development components the shared web components contain web files to be shared in the src/packages directory. the second one contains project specific extensions.0 Initial Configuration of the NWDI This section describes how to configure the JDI in order to start modifying the CRM software components. Figure 24: Project specific application in CUSTCRMPRJ • • • Copy original Software Component from SAP-SHRAPP to CUSTCRMPRJ Change Context Root Exclude SAP-SHRAPP from deployment August 2008 146 . if you need more information about this. The first one is the one delivered by SAP. Please refer to the documentation mentioned in chapter “Centrally: SAP NetWeaver Java Development Infrastructure”.Development and Extension Guide – SAP E-Commerce 7. it makes sense to have two deployments. Pre-requisites This chapter assumes that you have met the following pre-requisites: You know how to work with the NWDI. Creating a project specific Web Application with own context root In order to be able to compare the SAP standard web applications with the extended applications. The steps in this chapter are relevant immediately after an installation (the next chapter describes the steps needed to handle a Support Package upgrade). NWDI has been installed The NWDI online configuration has been executed The System Landscape Directory (SLD) has the new content (of the Software Components delivered with this release). This chapter describes how to set up such an application. 0 Basic concept Create a new project specific software component in the SLD.com Create a new Track using the Landscape Configurator On the “Track Data” tab of the Landscape Configurator. the SLD content was imported automatically.0 exists in the SLD: If tbis component is missing.sap. SAP-SHRAPP and/or SAP-CRMAPP can be deployed directly to the Web AS Java Server. Only the new Software Component will get the extended version of the application. Step by step process Check SLD content and create a new Software Component If you installed the NWDI Infrastructure by installing usage type DI. Add the used relationship to the public part of the Web Module Development Component to the new Development Component. Create a development component of type “Enterprise Application” for each application you plan to modify Copy all files of the SAP standard Enterprise Application to your own Software component (except application. you import an update of the CIM Model from the service market place. Check whether the Software Component CRM JAVA CUSTOMER PROJECT 5. You'll find more information about SLD and maintenance of Software Dependancies at http://help. enter the general data as shown below: Figure 25: Creating a new Track Substitute the URLs with the appropriate ones from your landscape. Check in the files. This content may not be up-to-date. The SAP standard component SAP-CRMDIC. Add this component to your track for modification. Refer to Note 669669 for more details. Enable deployment in the track.Development and Extension Guide – SAP E-Commerce 7.xml). These versions will be deployed on the Web AS Java System by NWDI. August 2008 147 . the bottom half of this tab will look as shown below: August 2008 148 . add the following Software Components CUSTCRMPRJ (Package Type: Source + Archive) If you need to modify one or more of the components contained in SAP-SHRAPP: SAP-SHRWEB (Package Type: Source + Archive) SAP-SHRAPP (Package Type: Source.0 Add Software Components to track On the same “Track Data” tab. Exclude from Deployment) If you need to modify the Java Data Dictionary: SAP-CRMDIC (Package Type: Source + Archive optional) An example is shown below: Figure 26: Adding Software Component After this step. Exclude from Deployment) If you need to modify one or more of the components contained in SAP-CRMAPP: SAP-CRMWEB (Package Type: Source + Archive) SAP-CRMAPP (Package Type: Source.Development and Extension Guide – SAP E-Commerce 7. Development and Extension Guide – SAP E-Commerce 7.sap.com/saphelp_nw04/helpdata/en/35/1cd66947184aa8915ca1831c59b6c1/content. Configure Runtime Systems in the track Configure your runtime systems as described in the following topic in the help portal: http://help. the following “Required Software Components” are automatically populated: SAP_JTECHS SAP-JEE SAP_BUILDT … Save your changes by clicking on the “Save” button on this tab.0 Figure 27: Required Software Components As shown.htm August 2008 149 . com/patches ) and placed into the “inbox” folder of the CMS.sca files ) must be downloaded from the Service Marketplace ( http://service.sca files could be different – they may include version numbers.sca SAP_BUILDT. where the <CMS Transport Directory> is specified in the “Domain Data” tab of the CMS Landscape Configurator).sca SAP-CRMWEB.sca SAP-SHRJAV.0 Import Software Components into this track Download Archives The Software Component archives ( .sap. vendor name.sca SAP-JEE. (The “inbox” folder can be found under the following path: “<CMS Transport Directory>\CMS\inbox”. Figure 28: Check-In of the Archives August 2008 150 .sca SAP-SHRWEB.Development and Extension Guide – SAP E-Commerce 7.sca SAP-SHRAPP.sca SAP-IPCMSA. The following .sca SAP-CRMAPP.sca files must be placed into the CMS inbox folder: o o o o o o o o o o o o o SAP_JTECHS.sca TEALEAF.sca The names of .sca SAP-CRMDIC. etc. Check-In archives In the “Check-In” tab of the CMS Transport Studio CMS perform a “Check-In” : select each of the above archives and click on the “Check-In” button.sca SAP-CRMJAV.sca STRUTS. xml monitor-configuration. After the import the “state” (field on the extreme right in the picture above) will be shown as “Import Finished” Import the checked in archives into the Consolidation system Repeat the above step in the “Consolidation” tab. open the project for crm/b2b.xml log-configuration. Create a new Enterprise Application Development Component in Software Component CRMCUSTPRJ.0 Import the checked in archives into the Development system In the “Development” tab. A project for the previously created development should already be open.xml from the META-INF directory of SAP standard Enterprise Archive into the META-INF directory of the new Development Component. select the checked-in components and click the “Import” button. Figure 29: Development System This import will run for several hours (if all the components are selected together).Development and Extension Guide – SAP E-Commerce 7.xml data-source-aliases. If you want to modify or extend the crm/b2b application. August 2008 151 .dtd Check in the new Development Component. Open the java perspective and copy the following files from the META-INF directory of the crm/b2b component to the META-INF directory of the home/b2b component: o o o o o application-j2ee-engine.xml monitor-configuration. create a new development component home/b2b Add the Web Module you want to extend to the Enterprise Archive Adjust the context root Copy all files except application. If you want to extend crm/b2b. Look at the online help of the Netweaver IDE for more details on how to execute these steps. Create your own Enterprise Applications The following steps need to be done: Import the Development Configuration into your Netweaver IDE. Additionally you need to deploy the enterprise application of the application you want to test. In the java development components a lot of used relationships to the most common SAP standard java development components are already defined. For SAP-CRMWEB the java DC is crm/home/crm/ext. In Software Component SAP-CRMWEB and SAP-SHRJAV. for each application which uses the new classes. If a new java class needs further references to other java development components.Development and Extension Guide – SAP E-Commerce 7. August 2008 152 . If a new class in the crm/home/shr/ext needs a class contained in crm/isa/isacorer3 for compiling. Creation or Extensions of Java Classes This chapter describes how to create new java classes or extend existing ones in the NWDI. The deployment of the enterprise application Development component can be started in the Development configuation perspective of the Netweaver IDE: Look at the online help of the Netweaver IDE for more details. It contains all required database table definitions.sap. More details of Used Relationships can be found at http://help.0 Test the CRM Java application on a local Web AS Java Engine In order to be able to run CRM Java applications you need to deploy the SAP-CRMDIC software component on your local Web AS Java engine. A used relationship in the web module development components of the applications to the java development components needs to be added.g. E. java development components are prepared to be extended in the NWDI. for SAP-SHRWEB it’s crm/home/shr/ext. new used relationships need to be added.htm or in the online help to the SAP Netweaver IDE. These components are empty when shipped. a new used relationship in crm/home/shr/ext to the public part default in crm/isa/isacorer3 needs to be added.com/saphelp_erp2005/helpdata/en/1c/bca99c220c0e45a1cae3c4cccf4346/frameset. Hint: It’s possible to create an own Software Component.0 Java on <Operating System> : <Database>” guide describes how to install the NWDI.0. To install the buildtool do the following steps: Step 1 2 Description Update the build tool Note 594370 contains a description of the upgrade procedure. Copy the java extensions into the NWDI 4. See http://help.0) to a NWDI track (>= CRM 5.Development and Extension Guide – SAP E-Commerce 7. The DC crm/home/shr/ext in Software Component SHRWEB 2. This command executes the replacement of sapmarkets with sap and copies the result to a folder structure which can be imported to the NWDI track. 3. Internet Sales Web Applic.0. Importing buildtool to NWDI for releases lower CRM 5.com for informations about administrating the NWDI See Online help of the Netweaver IDE for informations about usage of DTR and Development Configurations. You can call this target in the same way as you execute the other targets like build “extract. It contains an additional ant target named “nwdi”. It assumes that the buildtool was used to build the modified application and that there is a new NWDI track available to import the extensions and modifications.0 Importing Modifications and Extensions from older Releases This chapter describes how to import modifications and extensions from former Releases (CRM 3. Execute target “nwdi” with the buildtool The documentation of the buildtool contains a description how to execute an ant target (http://service. The DC crm/home/crm/ext in Software Component CRMWEB The crm/home/shr/ext is designed to hold extensions of the java sources in Software Component SHRJAV. 3. Make source code compilable (if required) In note 594370 is a new version of the buildtool attached. It further assumes that basic knowledge about NWDI is available. The “SAP Customer Relationship Management 5. an own Development or both to hold the java source. Replace “sapmarkets” with “sap” in all source codes and web files 2.1 and 4. ) Create a java project for the Development Component from DTR.sap. Crm/home/crm/ext ist designed to hold extensions of the java classes in Software Component CRMJAV.1 and 4.0 to a higher release In general the following steps are required for CRM 3.com/crm-inst -> E-Commerce Installation Guides -> ESelling: Building&Updating Mod. There are two predefined development components(DC) available to import java extensions: 1. Merge the modifications of the web files to the new release in the NWDI 3. In this case the required used relationships of the Software Components have to be setup on the nameserver and the used 3 August 2008 153 .ears”.0 1.sap.0). 0 Web Module _comp folder. However it might be necessary to add further Used Relationships to make the extensions compilable. Look at the 154 August 2008 .com/crm/home/crm/ext/_comp <NWDI Configuration root> stands for the root of the NWDI. Step 4 Description Copy the java code into the development component selected in the previous step. The buildtool target nwdi created a directory <buildtool root>/nwdi/<application name>_<project name>. Step 10 Description If you added java classes and you want to use them in the modified web application. See Windows>Preferences->Java Development Infrastructure -> Development Configuration -> root Folder in the Netweaver IDE to get this value <Configuration Number> stands for the number of the imported Development Configuration(normally this is 0) 5 Execute a build for the java Development Component in the IDE. Hint: For the predefined DC’s the most important used DC relationships are already established.0 relationships to the Development Components need to be maintained. After executing a refresh on the java project the files will be displayed and you will be asked to add them to DTR.com/<Development Component name>/_comp Hint: If the IDE will not automatically check that the new files have been added.com/crm/home/shr/ext/_comp or to <NWDI Configuration root>/DCs/sap. The naming convention for Development Components is as follows: crm/<isa|ipc|wfd|eservice|icss>/web/<application name> When the project was created. This directory has the same structure as the same directory structure as the Web Module Development Components. 7 8 9 Add the new java files to an DTR activity Check out the web files to be modified or extended from DTR Merge the modifications and extensions of the web files to the CRM 7. so it’s not possible to copy the modified files into the _comp directory but the changes need to be merged into the new version. Copy the content of this directory to the <NWDI Configuration root>/<Configuration Number>/DCs/sap. you will find the _comp folder of the component here: <NWDI Configuration root>/<Configuration Number>/DCs/sap. The Web Module Development Components are located either in CRMWEB or in SHRWEB Software Component. 6 Create a java project for the Web Module Development Component to be modified or extended. Where <buildtool root> stands for the installation directory of the buildtool and <project name> stands for the project name enetered in the buildtool during initialization. you need to add the java Development Component to the list of Used DC’s of the Web Module.Development and Extension Guide – SAP E-Commerce 7. The buildtool target nwdi created a directory <buildtool root>/nwdi/<project name>. Some of the files shipped in the new release might differ from the older versions of the files. 11 Check in all activities into DTR and activate them NWDI Release upgrade from older releases ( >= CRM 5. Change Track (Update Versions) Upload downloaded CIM model to your SLD in CMS Update CMS in Landscape Configurator of CMS August 2008 155 . 2.0) to a higher release Following you will see the steps which are necessary to do the import for sources. Example: If you added classes to crm/home/shr/ext and you want to use it in the b2b application. Otherwise you are not able to add a used DC relationship. Make sure that you created a project for the crm/isa/web/b2b component.Development and Extension Guide – SAP E-Commerce 7. It is used to inform NWDI about dependencies between software components archives.0 netweaver ide’s online help for the detailed procedure. Update CIM Model Download from service marketplace (Support Packages and Patches -> SAP Technology Components -> SAP CR Content) the right SAP Component Repository which fits to your configuration. 1. you need add the public part assembly of component crm/home/shr/ext to the list of used DC’s of crm/isa/web/b2b. Development and Extension Guide – SAP E-Commerce 7.0 Synchronize SC Dependencies in CMS August 2008 156 . Development and Extension Guide – SAP E-Commerce 7. Since the current Dependency Definition is located in the SLD. Resolve integration collisions How to do the single steps.corp:8000/sap(bD1lbiZjPTgwMA==)/bc/bsp/sap/zidesinfobase/detailareaframe.com/saphelp_nw70/helpdata/EN/4f/feda41cabae23ee10000000a155106/frameset. You can find more details about resolving the inconsistencies in the following help page: http://help.htm?them e=STANDARD&aview=1&scenario=010000005762&inframe= Developer Workplace When we look at the architecture of SAP E-Commerce 5.sap.sap.0 After clicking on the synchronisation button the following popup may appear if inconsistencies in the Dependency Definition exist. 4. please have a look into the SAP tutors on http://xads.0 we will discuss the following components: Java Development Kit (JDK) SAP Web AS Java o o o SAP J2EE Application Server SAP Java Connector (JCo) SAP Java Basis 157 August 2008 . 3.htm After synchronization and all lights are green you have to save. In some cases there could be yellow or red lights. therefore use the button ‘Accept SLD Definition’. Import Software Component Archives (SCA) In CMS open Check-In for your track and select all SCAs which should be imported. In this case you have to change the XML content of the Software Component which are not OK.wdf. Layer BLS Layer BLS Layer Web Web Server Server PM Plug In PM PC Browser Browser Browser Browser Browser Browser Middleware BP Order R/3 3.2 SAP NetWeaver’04s Developer Studio Java Development Kit The Java Development Kit represents the Java Virtual Machine (JVM). Installation of JDK 1. Make sure that you download the ‘SDK’ and not the ‘JRE’! August 2008 158 . There the following software component versions are contained or required: Component SAP Web AS Java JDK IDE Version 7. Server JCO Interaction and Interaction and Presentation Layer Presentation Layer Business Obj.0 Internet Sales Web application (ISA) (Interaction and Presentation Layer.1H + Order CRM 3. BLS Layer) All examples and operating system specifications in this document refer to Windows. Business Business Execution Execution Business Service Business Service Internet Internet Index Index Server Server Presentation R/3-System mySAP CRM J2EE Appl.4.Development and Extension Guide – SAP E-Commerce 7.2 Download the JDK from the sun homepage http://java. which is a prerequisite for the SAP Web AS Java (Servlet Engine).4.0 BP BW APO IPC IPC APO = Advanced Planner & Optimizer APO = Advanced Planner & Optimizer BW = Business Warehouse BW = Business Warehouse IPC = Internet Pricng & Configurator IPC = Internet Pricng & Configurator BLS = Business Logic Service Layer BLS = Business Logic Service Layer JCO = Java Connector JCO = Java Connector BP = Business Partner BP = Business Partner PC = Product Catalog PC = Product Catalog PM = Product Master PM = Product Master Figure 30: Overview Developer Workplace Required tools and versions SAP CRM 7. Select the version you require from the drop down list box ‘Java 2 Platform. JDK offers options for compiling. Standard Edition (J2SE)’. Business Object Layer.sun. In addition.0 is based on SAP NetWeaver’04s. Layer Business Obj. executing and debugging Java applications.00 1.com/products/. You also have to append the ‘<JAVA_HOME>\bin‘ directory to your environment variable ‘path’. A destination location <JAVA_HOME> must be chosen and you have to select the following components for installation: Program files Native interface header files Old native interface header files Demos Java sources Once JDK 1. If this was not done automatically. in the Windows environment in the system properties. These settings can be configured.exe (where XX is the number of the patch) has been downloaded.0 Once j2sdk-1_4_2_XX-windows.2 directory.4..2 has been successfully installed.. the JAVA_HOME environment variable must still be set in such a way that the Java compiler can be found (SET JAVA_HOME=<JAVA_HOME>).Development and Extension Guide – SAP E-Commerce 7. Please make sure that the PATH environment variable is expanded to the binary directory underneath the jdk1.%JAVA_HOME%\bin). August 2008 159 .4. you can do this as illustrated in the graphic above or with the command: (SET PATH = . Then the SDK is ready to run and can be tested by typing in java – version in the command prompt. for example. which can be accessed via the control panel (System Settings Control Panel) and by double clicking on the Systems icon. during the manual installation of JDK. for example.. you have to execute it. August 2008 160 .0 Developer Workplace for SAP NetWeaver 2004s The SAP Developer Workpace consists of the following Componentes: SAP NetWeaver Developer Studio Max DB or MS SQL Server SAP J2EE Central Instance (J2EE dispatcher. that is available on the SAP Service Marketplace quick link instguides (http://service.Standalone Engines & Clients). J2EE server process. Enqueue Server) Figure 31: Developer Workplace for SAP NetWeaver 2004s Installing the Developer Workplace for SAP NetWeaver 2004s The installation of the SAP Developer Workplace is described in the “Installation Guide .Development and Extension Guide – SAP E-Commerce 7.Developer Workplace for NW2004s”.sap. SDM) SAP J2EE Central Service (Message Server.com/instguides) SAP NetWeaver Release 2004s Installation (in the list 3 Installation . 0 Directory Structure of the Web AS Java 7. which is entered within the installation and can be calculated with the following formula: <Base port> = 50000 + 100 * <INSTANCE_NUMBER> Name HTTP P4 Telnet Formula <Base port> + 0 <Base port> + 4 <Base port> + 8 Description Used to access the Central J2EE Instance using a browser Used to connect to the J2EE Server Processes with the administration tools (e.0 TCP-Ports The ports used by the Central J2EE Instance are determined by the instance number.g.0 Once it has been installed.Development and Extension Guide – SAP E-Commerce 7. the directory of the Web Application Server is structured as follows: Root SAP SID JC<INSTANCE_NUMBER> Visual Administrator Server directory Contains deployed web applications Logfile directory (also contains the ECO log entries) SAP Web AS Configuration Tool SDM directory Figure 32: Directory Structure of Web AS Java 7. Visual Administrator) Used to manually administrate the J2EE Server Processes (if you don’t use the Visual Administrator) August 2008 161 . telnet. Starting and Stopping the WebAS Java Since NetWeaver’04. To start/stop the Web AS Java. August 2008 162 .Development and Extension Guide – SAP E-Commerce 7.0 can be configured using the configuration tool. The actual used ports can be checked using the configuration tool under Cluster/Dispatcher -> services -> http.0 The SAP WebAS Java 7. open the SAP Management Console. Each Web AS Java consists of two nodes: The Central J2EE Instance and The database instance. Central J2EE Instance Database Instance Figure 33: SAP Management Console Configuration of SAP WebAS Java 7. The used HTTP port is then 50000. select the Web AS Java Instance and press the start/stop button in the button bar. the SAP Management Console is used to start and stop the Web AS Java.0 Example The SAP WebAS Java has been installed on the server with instance number 00. p4. 2. You can create a copy with the ISA Buildtool.do).do’ are forwarded as events to the ActionServlet that is defined and configured in the web. http://localhost:50000/b2b/b2b/init. Create shop definitions refering the corresponding backend system using the Shoadmin web application. The tool.xml file to ensure correct forwarding: <!-. Configuring and Working with Developer Studio This section describes manual deployment of an SAP E-Commerce web application. You can call the application via the URL. Configuration of the web application This section describes the configuration of the Internet Sales application. <J2EE_HOME>\admin\go.0 the Extended Configuration Management (XCM) is used to configure the web applications. Please note that links that end in ‘. 4.0 Uninstalling the Developer Workplace for SAP NetWeaver 2004s How to uninstall the Developer Workplace for SAP NetWeaver 2004s is described in Appendix of the “Installation Guide . for example. To access the XCM Admin please use the following URL: http://localhost:50000/<APPLICATION_NAME>/admin/xcm/init. 3. Consultants can install variants on their laptops. used to configure them. August 2008 163 . Restart the web application through the SAP J2EE Visual Administrator.do (for example: http://localhost:50000/b2b/admin/xcm/init. Click to tab strip Runtime Select application and click -> Stop Application -> Start Application.xml in the directory WEB-INF of your web application.bat -> Server -> Services -> deploy.xml file.do</url-pattern> </servlet-mapping> 5.Developer Workplace for NW2004s”.Standalone Engines & Clients).sap. We recommend you perform all customer enhancements on a copy of the original EAR file. is the XCM Admin. Create customer specific ‘Application Configurations’ or configuration ‘Components’ from SAP configuration default templates. The servlet mappings are configured in the config. This tool is contained in every web application. The focus of this guide is to enable consultants to quickly get started using the new concepts used by SAP and set up a local development landscape that enables them to implement customer requirements.Installation . that is available on the SAP Service Marketplace quick link instguides (http://service. For more details how to configure the web applications please see the 1. This local development landscape can differ from the production environment.com/instguides) SAP NetWeaver Release 2004s Installation (in the list 3 .do.Development and Extension Guide – SAP E-Commerce 7. The following entry is required in the web. You have to configure each application with it’s own XCM Admin.ActionServlet Mapping --> <servlet-mapping> <servlet name>action</servlet name> <url-pattern>*. In Internet Sales 5. for example. Restart the server. Change to the Edit mode by pressing the change/view button confirm this by pressing yes.bat. This information is useful if you extend the ISA application by writing your own Java code. 8. 3.Development and Extension Guide – SAP E-Commerce 7. To debug your coding. August 2008 164 . change the Custom value to ‘yes’ and press the button ‘Apply Custom’. 2. In the Display configuration tab navigate to Configurations instance properties IDXXXXXXX. Select IDXXXXXXX.DebugMode.0 Remote Debugging This unit gives you some information about remote debugging on the SAP J2EE server. You could also change the debug port by clicking on IDXXXXXXX. Press the Edit button .0 permanently. Navigate to Cluster Server Services Configuration Adapter.DebugPort. Connect to the Web AS with an user of the role Administrator. and want to debug this code while it is being executed on the server. Setting up remote debugging for SAP WEB AS Java 7.0 This section describes the necessary configuration of Eclipse for remote debugging of a web application running on the SAP J2EE server. perform the following steps: 1. cluster_data and select Propertysheet 4. you have to: Enable debugging on the Web AS (either temporarily or permanently) Start Remote Debugging Enabling/Disabling Debug Mode Permanently To enable/disable the debug mode of the SAP Web Application Server Java 7. in the button bar of the tab and 7. 6. Start the Visual Administrator by executing <DRIVE>:\usr\sap\<SID>\JC<INSTANCE-NUMBER>\j2ee\admin\go. A new popup will appear. 5. 0 Figure 34: Visual Admin . 4.Setting Up Debug Mode Enabling/Disabling Debug Mode Temporarily To enable/disable the debug mode of the SAP Web Application Server Java 7. perform the following steps: 1.Development and Extension Guide – SAP E-Commerce 7. Start the Net Weaver Developer Studio. Switch to the J2EE Engine View (menu Window 3. Open the context menu (by clicking the right mouse button) and select Enable Debugging of Processes. Show View Other… J2EE J2EE Engine) Figure 35: J2EE Engine .Enabling Debugging August 2008 165 . 2. Select the Server Node.0 temporarily. please refer to the NWDS documentation. where the process being debugged runs. August 2008 166 .0 Starting Remote Debugging Perform the following steps in your SAP NetWeaver Developer Studio: Open the menu Run Debug… Select Remote Java Application and press the button New Host name. This has to correspond with the -Xrunjdwp:address setting.Development and Extension Guide – SAP E-Commerce 7. Type: dt_socket Address: the port. The host. Figure 36: Starting Remote Debugging For further information on how to set up remote debugging on SAP NetWeaver Developer Studio (NWDS). August 2008 167 . Choose server_connect from the drop down list box as Base Configuration Enter the connection data of the particular server. the host. Open the properties of the message server you want to connect by double clicking on it.g. you have to use HTTP/external debugging to analyze ABAP code called from the Java side. Enter an arbitrary name and press the Create button.0 ABAP Debugging Since SAP Netweaver 2004 it’s no longer possible to debug ABAP code from Java side. You can get the values for the parameters ashost and the system number from the SAPGui: Start SAPGui and switch to the System tab Press the button New Entry Enter the System ID and double click on the particular entry in the list. To do this perform the steps listed below: o o o o o o Open a browser and access the XCM Admin of your web application (URL: http://<hostname>:<port>/<appl-name>/admin/ xcm/init. Enter the System number o o o o Navigate in the tree on the left to Start the configuration you want to use. yu have to configure your web application to connect to a single server. where the SAP Web AS is running on. e. The following procedure is necessary to start a debug session: Prerequesites To be able to perform external debugging.Development and Extension Guide – SAP E-Commerce 7. Application Configuration Customer and select Change the value of the parameter jcodata to the component you just created Press the Save button. Press the Display button in the upper right corner. the following prerequisites must be met: the SAPGui has to be installed on the host. Enter the message server as value of the parameter ashost.0. Since load balancing is not supported.0.do): Navigat through the tree on left to Start Components Customer and select jco Press the Edit button in the upper right corner. In SAP E-Commerce 7. where the RFC (of HTTP/HTTPS/SMTP) calls are performed. This chapter describes how to debug ABAP code in SAP E-Commerce 7. not the alias! For debugging the user must have debug authorizations. with the specified user the ABAP coding will be called. refer to note 932457. Select the menu item Utilities Debugging. 6. Open your ABAP coding and set an External Breackpoint by pressing CTRL+Shift+F9 or by pressing the button Set/Delete External Breakpoint . Go to any Development Workbench (transactions SE37. When within the web application. August 2008 168 . Enter the ID of the SU01 user. 668252 and 751872. Java Debugging If you want to debug the Java coding deliverd by SAP. 5. but the coding has not been attached to the . Settings.Development and Extension Guide – SAP E-Commerce 7. There you’ll find instructions how to attach the SAP Java coding to the jar files. Please ensure this via setting appropriate roles or profiles via transaction SU01. switch the tab ABAP Editor and there the tab HTTP 4. 3. It’s recommended to create new “Debug users” for such function. you use to logon to your webapplication You have to maintain the ID of the SU01 user.jar files. SE38. Start your web application. Normally the profile “S_ENTW_SHOW” should be adequate (for detailed information see note 668252). Start the SAPGui and logon to the server you configured in the XCM 2. For detailed information and further questions please refer to the notes 668256. the set breakpoint will be executed.0 Activating ABAP Debugging 1. SE80). Do not add these authorizations to existing “productive users” because of security reasons. 0 – Examples and Tutorials’ (see [1] in chapter References on page 305). CRM) New/enhanced functions (for example. extension of existing function modules. Custom Backend Object provides connectivity to backend functions Calls to function modules are interfered (before and after function call) Custom function modules are called instead of the standard modules Backend (e. new function modules).Development and Extension Guide – SAP E-Commerce 7. It should help you to find an appropriate extension concept for specific requirements.0 Introduction to Extension Concepts Extensions in the ISA Framework The first part of this unit gives an overview of possible extensions and extension concepts. The following table gives an overview of possible changes in different layers: Layer Interaction Layer Business Object Layer Business Logic Service Layer Possible Extensions Action flow has to be interfered in order to get/set additional data. These extensions are not covered by this document. Table 32: Overview of possible changes in different layers August 2008 169 . The concepts in this unit provide the basis for the Examples and Tutorials provided in the ‘Development and Extension Guide: E-Comemrce 7. The subsequent parts of the unit give theoretical introduction to the various extension concepts of the Internet Sales framework.g. Custom Business Objects process additional data. supports the extensions to the ISA Framework.0 customer data has to be entered or displayed CustomAction Possible extensions in all layers Custom BusinessObject Custom BackendObject Custom Function Module Figure 37: Flow of possible changes The E-Service Extended Complaints and Returns application and the Remanufacturer’s Inspection uses the ISA Framework and. as a consequence.Development and Extension Guide – SAP E-Commerce 7. August 2008 170 . The branches describe different requirements (i. images. step by step. the appropriate extension concept depending on your individual requirements. Start Extension to ISA Static extensions to the UI-Layer (colors. Overview Start here to find the appropriate extension concepts or just to get an overview of different categories of extensions. texts) Action flow should be modified or extended Additional data should be exchanged between different layers (UI. what you want do). BE) Static extensions to the UI layer Extensions to the action flow Extensions to exchange additional data End Legend: Requirement What you want to do Reference to sub diagram with more details What to do Reference to detailed description Terminator Decision Figure 38: Overview of different categories of extensions August 2008 171 . where you have to check according to your requirements which branch is the right one for you. with examples. BO.0 Finding the Appropriate Extension Concept How to use these diagrams The following diagrams should help you to find. or a description of what to do. together with a reference to the detailed description of the available extension concept.e. The result of each branch could be a reference to another lower level diagram. Each diagram has one starting point referring to different branches.Development and Extension Guide – SAP E-Commerce 7. images) Change/add text in the text property file (language dependent!) Change colors in style definition (CSS) Replace (standard) image or add new image Rearrange UI elements within JSP and/or to other JSP Add/remove text from JSP Change colors of static images (e. Start Static extensions to the UI layer Texts on the UI should be changed/added/ removed Colors of the UI should be changed Images on the UI should be changed/added/ removed Arrangement of UI elements should be changed (e.Development and Extension Guide – SAP E-Commerce 7. End Figure 39: Statis extensions to the UI layer For details see: Chapter Extensions to the UI layer on page 190 Chapter ‘Extensions Limited to the UI Layer’ in the ‘Development and Extension Guide: EComemrce 7.0 Extensions to the UI Layer This diagram gives an overview of how to realize static extensions which only affect the UI layer.g. buttons.g. frames) Add/remove image from JSP (If required) Adjust frame targets in JSP’s and in action flow configuration.0 – Examples and Tutorials’ (see [1] in chapter References on page 305) with examples for extension August 2008 172 . texts. buttons. frames. like adding or replacing actions. and writing new actions. Start Extensions to the action flow The action flow should be modified by adding/ removing other (standard or customer specific) actions The action flow should be modified by changing the action forward of a specific (standard) action Appropriate user exit available in standard action1) no yes Derive new action from standard action and implement user exit2) Create new action from standard action2) Modification of the action flow in configuration3) Register new action flow in configuration3) End Figure 40: Extensions to the action flow For details see: 1) 2) 3) Standard Actions providing User Exits on page 193 Create a Customer Action on page 191 Modifications in the Struts Configuration on page 197 August 2008 173 .Development and Extension Guide – SAP E-Commerce 7.0 Extensions to the Action Flow This diagram gives an overview of how to realize extensions to the action flow. which are the most common types of extensions.Development and Extension Guide – SAP E-Commerce 7.0 Extensions to Exchange Additional Data This diagram is the entry point to all extensions related to the exchange of additional data. the additional data has to be displayed on the UI and has to be retrieved from a backend system. or should be entered on the UI and have to be transferred to a backend system. These kind of extensions always affect all ISA layers. Typically. Start Extensions to exchange additional data Additional data should be displayed or should be entered on the UI Additional data should be transfered between the web applicatiion and a backend system Extensions to exchange data with the UI-layer yes Extensions to exchange data with a backend system Should the additional data be exchanged with a backend system? no End End Figure 41: Extensions to exchange additional data August 2008 174 . 0 Extensions to Exchange Data with the UI-Layer This diagram shows the necessary steps to display or enter additional data on the UI and to transfer this additional data with the underlying action classes.Development and Extension Guide – SAP E-Commerce 7.0 – Examples and Tutorials’ (see [1] in chapter References on page 305). Figure 42: Extensions to exchange data with UI layer For details see: ‘Extensions to the UI layer’ on page 190 and chapter ‘Extensions Limited to the UI Layer’ in the ‘Development and Extension Guide: E-Comemrce 7. 1) August 2008 175 . from there. Figure 43: Transfer additional input data to action class and business object layer For details see: 1) 2) 3) 4) Standard Actions providing User Exits en page 193 Create a Customer Action on page 191 Create a Customer Action on page 191 Depends on the question if the additional data should be transferred to a backend system and how this can be performed. See also: Storing Additional Data .Development and Extension Guide – SAP E-Commerce 7.Extension Mechanism en page 197 5) Create a Customer Business Object on page 200 176 August 2008 .0 This diagram shows how to transfer additional input data from the http request (from submitting the HTML form) to the action class and. to the busines object layer. Development and Extension Guide – SAP E-Commerce 7.0 – Examples and Tutorials’ (see [1] in chapter References on page 305).0 6) 7) Request Context en page 222 ’Extension Demo 1 – Add New Entry Fields’ in the ‘Development and Extension Guide: EComemrce 7. August 2008 177 . Figure 44: Transfer additional output data from aciton class to JSP For details see: 1) 2) Standard Actions providing User Exits on page 193 Create a Customer Action on page 191 and Modifications in the Struts Configuration on page 197 178 August 2008 .Development and Extension Guide – SAP E-Commerce 7.0 This diagram shows how to transfer additional output data in the action class to the JSP. 0 Table 38: User exits within the Remanufacturer’s Inspection Application Accessing 4) 5) the Session Context on page 195 Accessing the Session Context on page 190 Request Context en page 222 August 2008 179 .Development and Extension Guide – SAP E-Commerce 7. 0 Extensions to Exchange Data with Backend-Systems This diagram is the entry point to extensions related to exchange of additional data between the business object layer and any backend system. Start Extensions to exchange data with a backend system Retrieve data from a backend system Transfer data to a backend system Extensions to retrieve data from a CRM system Extensions to transfer data to a CRM system Extensions to retrieve data from a R/3 system Extensions to transfer data to a R/3 system Extensions to exchange data with the Web Catalog Extensions to exchange data with Web Catalog Extensions to exchange data with an IPC system Extensions to exchange data with an IPC system Extensions to exchange data with the Java Basket Extensions to exchange data with the Java Basket End End Figure 45: Extensions to exchange data with the backend systems August 2008 180 .Development and Extension Guide – SAP E-Commerce 7. Development and Extension Guide – SAP E-Commerce 7. Figure 46: Retrieve additional data from SAP CRM system to business object layer For details see: 1) ‘Standard call’ means that the backend system is called via a function call within the standard process flow. The function module itself does not have to be a standard function call (see Replacing Calls to Standard Function Modules (Backend System) on page 227) 2) Create a Customer Business Object on page 200 and Create a Customer Business Object Manager on page 200 Supported Function Modules and Business Objects on page 212 Table 47: User exits for for Pricing or Configuration Creating 5) 6) 7) 3) new Customer Backend Object on page 208 Create a Customer Backend Object on page 204 Interception of Calls to Standard Function Modules on page 225 Request Context on page 222 August 2008 181 .0 This diagram shows how to retrieve additional data from a SAP CRM system to the business object layer. Development and Extension Guide – SAP E-Commerce 7.2) Read data from request context3) No action required Create new backend cIass.0 This diagram shows how to transfer additional data from the business object layer to a SAP CRM system. Start Extensions to transfer data to a CRM system Data stored in the request context Data stored within a standard business object as extension data Data stored in a (customer) business object Processing with other data or preprocessing before transfer required yes no Extension data of CRM function module can be used1) no yes Implement JCO event listener class. Implement method to call CRM function module4) Call function module in CRM system End Figure 47: Transfer additional data from business object layer to SAP CRM For details see: 1) 2) 3) 4) Supported Function Modules and Business Objects on page 212 Interception of Calls to Standard Function Modules on page 225 Request Context on page 222 Create a Customer Backend Object on page 204 182 August 2008 . concept No action required Create customer implementation of BADI1) Create customer function module with interface of standard function module2) Create customer function module with extended interface of standard function module Create customer function module Use standard backend object no action required Use standard backend object no action required Use standard backend object and implement JCO event listener class3) Create customer backend object. Start Call function module in CRM system No extension of interface or of the logic of the standard function module required No extension of interface but extension of the logic of the standard function module required recomm. concept Extension of interface and of the logic of the standard function module required recomm.Development and Extension Guide – SAP E-Commerce 7. it is assumed at this point.0 This diagram shows how to call a SAP CRM system from the backend layer. August 2008 183 . that a customer business object and a customer BOM are already available. Register new backend object in configuration4) Configure BADI in CRM Assign customer function module to standard function module in configuration2) Assign customer function module and event listener class to standard function module in configuration3) End Figure 48: Call a SAP CRM system from the backend layer For details see: 1) 2) 3) 4) Supported Function Modules and Business Objects on page 212 Replacing Calls to Standard Function Modules (Backend System) on page 227 Interception of Calls to Standard Function Modules on page 225 Create a Customer Backend Object on page 204. 4) yes Derive new backend class from standard backend class. at order save.0 This diagram shows how to retrieve additional data from a SAP ERP system to the business object layer.g. Start Extensions to retrieve data from a R/3 system Data is retrieved within a standard call from the backend system (e. Overwrite method(s) to call function module and/or to process data.2) Extension data of R/3 function module can be used3) yes no Create new backend interface.7) Write additional data to request context.5) Configure extension data6) Implement JCO event listener class.8) Create new backend class. at ship to read)1) Data is retrieved by a new (customer specific) call from the backend system Processing with other data or postprocessing after transfer required no Create new business object and new BOM.5) End Figure 49: Retrieve additional data from SAP ERP system to business object layer For details see: 1) ‘Standard call’ means that the backend system is called via a function call within the standard process flow. The function module itself does not have to be a standard function call (see Replacing Calls to Standard Function Modules (Backend System) on page 227) 2) Create a Customer Business Object on page 200 and Create a Customer Business Object Manager on page 201Table 56: ABAP Extension Structure (ERP) Function Modules and Business Objects.Development and Extension Guide – SAP E-Commerce 7. Implement method(s) to call function module. on page 212Table 47: User exits for for Pricing or Configuration Creating 5) 6) Supported new Customer Backend Object on page 208 Create a Customer Backend Object on page 204 Modification of Communication Structures in SAP and Configuration of the Web Application on page 220 7) 8) Interception of Calls to Standard Function Modules on page 225 Request Context on page 222 184 August 2008 . Development and Extension Guide – SAP E-Commerce 7.0 August 2008 185 . Start Extensions to transfer data to a R/3 system Data stored in a request container Data stored within a standard business object as extension data Data stored in a (customer) business object Processing with other data or preprocessing before transfer required yes no Extension data of R/3 function module can be used1) no yes Implement JCO event listener class.3) Configure extension data 4) Create new backend class.Development and Extension Guide – SAP E-Commerce 7. Interception of Calls to Standard Function Modules on page 225 Request Context en page 222 Modification of Communication Structures in SAP and Configuration of the Web Application on page 220 5) Create a Customer Backend Object on page 204 August 2008 186 . on page 212. Implement method to call R/3 function module5) Call function module in R/3 system End Figure 50: Transfer additional data from business object layer to SAP ERP system For details see:Table 56: ABAP Extension Structure (ERP) Supported 2) 3) 4) Function Modules and Business Objects.0 This diagram shows how to transfer additional data from the business object layer to a SAP ERP system.2) Read data from request container. concept No action required Create customer function module with interface of standard function module1) Create customer function module with extended interface of standard function module Create customer function module Use standard backend object no action required Use standard backend object and implement JCO event listener class2) Create customer backend object.Development and Extension Guide – SAP E-Commerce 7. it is assumed at this point. Start Call function module in R/3 system No extension of interface or of the logic of the standard function module required No extension of interface but extension of the logic of the standard function module required Extension of interface and of the logic of the standard function module required recomm.0 This diagram shows how to call a SAP ERP system from the backend layer. August 2008 187 . that a customer business object and a customer BOM are already available. Register new backend object in configuration3) Assign customer function module to standard function module in configuration1) Assign customer function module and event listener class to standard function module in configuration2) End Figure 51: Call a SAP ERP system from backend layer For details see: 1) 2) 3) Replacing Calls to Standard Function Modules (Backend System) on page 227 Interception of Calls to Standard Function Modules on page 225 Create a Customer Backend Object on page 204. Start Extensions to exchange data with an IPC system Additional data should be transferred to the IPC for Pricing Additional data should be transferred to the IPC for configuration Derive new backend object from standard (CRM/R/3) backend object. Implement user exit.0 – Examples and Tutorials’ (see [1] in chapter References on page 305). August 2008 188 .Development and Extension Guide – SAP E-Commerce 7.0 This diagram shows how to exchange additional data between the business object layer and an IPC system.1) Derive new backend object from standard (CRM/R/3) backend object. Implement user exit.1) End Figure 52: Exchange additional data between business object layer and an IPC system For details see: 1) Standard Backend Objects providing User Exits on page 204 Example. see ’Extension within Data Processing’ of the ‘Development and Extension Guide: EComemrce 7. Development and Extension Guide – SAP E-Commerce 7.0 – Examples and Tutorials’ (see [1] in chapter References on page 305). For displaying additional data in web catalog. Figure 53: Exchange additional data with the web catalog For details see: 1) New Fields in the Web Catalog (SAP ERP Backend and Memory Catalog) on page 231 and New Fields in the Web Catalog (SAP ERP Backend and TREX) on page 232 2) 3) Show Additional Keys for Extended Search in B2B on page 231 See note 684119 (for ISA ERP) and ‘Extensions to Exchange Additional Data’ in the ‘Development and Extension Guide: E-Comemrce 7. see Show Additional Attribute in Product List on page 229 and Show Additional Attribute in Product Details and in Compare Products on page 230 August 2008 189 .0 This diagram shows how to exchange additional data with the web catalog. 0 This diagram shows how to exchange additional data with the Java basket.1) Derive new backend object from standard (JDBC or DB) backend object. Start Extensions to exchange data with the Java Basket Additional data is attached as extension data to the basket header or to the basket item Additional data is attached as extension data to other business objects Extension data is automatically transferred with the header or with the item of the Java Basket no action required.2) Overwrite method to exchange extension data.Development and Extension Guide – SAP E-Commerce 7. End Figure 54: Exchange additional data with the Java basket For details see: 1) 2) Java Basket-Extensions en page 222 Create a Customer Backend Object on page 204 August 2008 190 . No No Effect on other Layers No Changing colors Table 33: Overview of simple modifications related to the UI Changes in the UI are often necessary in order to display additional data or to enable the user to enter additional data. In order to get/display additional data on the UI it is often necessary to change the existing Action flow.Development and Extension Guide – SAP E-Commerce 7. This is done by adding/replacing custom Struts Actions: August 2008 191 .isa.xml) Depending on the functions of the new JSP.getSession()).sap.0 Extensions to the UI layer The following list provides an overview of simple modifications related to the UI only: Type of Extension Adding/replacing Mimes Where On JSPs Adding new Mimes to web application Replacing existing Mimes Changing text displayed on the screen On JSP In language dependent resource files On JSP In cascading style sheets Replacing existing JSP Register new JSP in Struts configuration file (config.core. Extensions in the Action Flow The action flow is realized using the STRUTS framework. Such changes are in most cases not limited to just the UI layer. Accessing the Session Context In order to access the UserSessionData object from the JSP you have to do the following: <%@ page import=‘com.getUserSessionData(pageContext. changes in other layers could be necessary. %> Accessing the Request Context For information about how to access the RequestContext within a JSP refer to chapter 'Request Context' on page 222.UserSessionData’ %> <% UserSessionData userSessionData = UserSessionData. All the action classes of the E-Service Extended Complaints and Returns application extend the com.isacore.isacore. you can use different possible base classes for your Action in the Extended Complaints and Returns application: com. you can use different possible base classes for your Action.action.CommonBaseAction o Inherit from EComBaseAction.isa.sap. delivery.sapmarkets. either directly or indirectly (through other class inheritance). Extend these Actions if you write extensions to the Internet Sales application which use available functions. Or you are modifying a dispatcher Action (for example MaintainBasketDispatcherAction) and extending its functions.Development and Extension Guide – SAP E-Commerce 7.isa.IsaCoreBaseAction o Base class providing easy access to Business Object Managers of the ISA core functions.eservice.action.isa.0 Figure 55: Action flow with CustomActions Create a Customer Action You would like to modify a specific interaction within the application.EComBaseAction o Base class providing MetaBOM.BaseAction o Base class of all Actions. com.isa.isacore.core. Use these Actions if you do not need to access the standard ISA functions (for example. Depending on the type of modification. 192 August 2008 . Depending on the type of modification.sap. In that case you have to overwrite doPerform().EComBaseAction o Base class providing MetaBOM com. generic search. IPC. recall.common. com.sap.sapmarkets.isacore. You have to overwrite the isaPerform() method.isa. and catalog. A reason for doing this could be that you want to perform some additional checks that are not part of the original Actions before you continue with the process flow. This base class providing access to the Common business object manager which handles several business objects such as user. etc. com.sap.action. you extend the functions of Internet Sales without using current functions).EComBaseAction. business partner manager.action.action. When you extend existing Actions you usually overwrite one of the methods provided by the base Action and provide your own implementation for it. sap.ComplaintControlAccessBaseAction o Inherit from ComplaintBaseAction. gives access to the Complaint business object manager which handles several business objects: complaint.action.action. gives access to the Complaint business object manager which handles several business objects: complaint.ComplaintBaseAction o Inherit from CommonBaseAction. delivery.sap. gives access to the Confirmation business object manager. com.sap.EComBaseAction o Base class providing MetaBOM com. checks whether the user is properly logged in before proceeding to the execution of the action com.srvconfirmations.CommonControlAccessBaseAction o Inherit from CommonBaseAction.eservice.common.CommonBaseAction o Inherit from EComBaseAction. com.isacore.inspb2b.crb2b.crb2b. checks whether the user is properly logged in before proceeding to the execution of the action com.crb2b.sap.common. checks whether the user is properly logged in before proceeding to the execution of the action com.eservice. generic search.eservice. checks whether the user is properly logged in before proceeding to the execution of the action com. business partner manager.action.eservice.sap.action.sap.sap. This base class providing access to the Common business object manager which handles several business objects such as user. complaint items list.action.crb2b.sap. recall.EserviceInspBaseAction o Inherit from EComBaseAction com.eservice.ConfirmationBaseAction o Inherit from CommonBaseAction.eservice. complaint dynamic fields.crb2b. August 2008 193 .eservice. you can use the following actions as base actions: com.action.action.inspb2b.0 com. complaint items list.crb2b.common.sap.action.ComplaintControlAccessBaseAction o Inherit from ComplaintBaseAction.action. com.eservice.sap.eservice. complaint dynamic fields.EserviceInspControlAccessBaseAction o Inherit from CommonControlAccessBaseAction.eservice. com.Development and Extension Guide – SAP E-Commerce 7.sapmarkets.eservice.sap.action. gives access to the Eservice business object manager which handles the Help Value Search Handler business object.ComplaintBaseAction o Inherit from CommonBaseAction.eservice.action.EserviceControlAccessBaseAction o Inherit from EserviceBaseAction.CommonControlAccessBaseAction o Inherit from CommonBaseAction. checks whether the user is properly logged in before proceeding to the execution of the action com. etc.action.action.sap.EserviceBaseAction o Inherit from CommonBaseAction.isa. checks whether the user is properly logged in before proceeding to the execution of the action In the Remanufacturer’s Inspection Application. called after the header and item data are parsed from the request. but empty. Modify the header data.sap. Set forward. Modify the document. Table 34: User exits within the Basket August 2008 194 .eservice. Action to delete an item from the current document. Action to replace an item of the basket with another one during the cross.ConfirmationControlAccessBaseActi on o Inherit from CommonControlAccessBaseAction. gives access to the Confirmation business object manager and checks whether the user is properly logged in before proceeding to the execution of the action Standard Actions providing User Exits Some action classes already provide user exits in the form of predefined. The advantage of predefined user exits is that extensions or changes in the standard action classes by SAP within support packages or future releases are aware of user exits: Basket Class / Methode MaintainBasketBaseAction customerExitParseRequestHeader customerExitParseRequestItem customerExitParseRequest MaintainBasketDeleteItemAction customerExitParseRequest MaintainBasketReplaceItemAction customerExitParseRequest MaintainBasketNewShiptoAction customerExitParseRequest MaintainBasketDispatcherAction customerExitDispatcher customerExitParseRequestHeader customerExitParseRequestItem customerExitParseRequest Description Base action for all actions providing functions to manage the shopping basket and sales documents similar to the basket. Action to add a new ship to to a document. called after the header and item data are parsed from the request. For extensions only the existing empty methods have to be implemented in a new action class derived from the standard action class.Development and Extension Guide – SAP E-Commerce 7.0 com. called after the header data is parsed from the request. Modify the document. called after the item data is parsed from the request. Modify the item data.jsp to different (specialized) actions. Modify the document. methods. Modify the header data. Modify the document.and upselling process. called after the header and item data are parsed from the request. Modify the item data. called after standard forward is determined. Modify the document. Action to dispatch all requests coming from the order.action.srvconfirmations. called after the header and item data are parsed from the request. called after the item data is parsed from the request. called after the header and item data are parsed from the request. called after the header data is parsed from the request. Action for receiving items via the OCI. Action to replace an item of the order with another one during the cross. Modify the document. Modify the item data. Set forward. The result of the standard method „checkRequest’ can be modified. Modify the document. to save it in the backend).jsp to different (specialized) actions. Set forward. Action to add a new ship to to a document.Development and Extension Guide – SAP E-Commerce 7. Modify the header data. Modify the document. Action to perform the final step in the processing of a document (i.and upselling process. called after the header and item data are parsed from the request. Read additional data from OCI message. Modify the document. Action to dispatch all requests coming from the order_change. Table 36: User exits within the OCI August 2008 195 . Set forward. called after standard forward is determined. called after standard forward is determined. called after the header and item data are parsed from the request. called after the item data is parsed from the request. Table 35: User exits within the Order OCI (Open Catalog Interface) (interface to external catalogs) Class / Methode OciGetCatalogURLAction customerExitDispatcher customerExitGetOCIURL OciReceiveAction customerExitDispatcher userExitCheckRequest userExitModifyItemListBefore ConvertRequest userExitModifyItemListBeforeAddTo Basket Description Action which retrieves the URL from the external catalog. called after standard forward is determined.g. add user data). Modify URL to external catalog (e.e. Read additional data from OCI message. called after the header and item data are parsed from the request.0 Order Class / Methode MaintainOrderBaseAction customerExitParseRequestHeader customerExitParseRequestItem customerExitParseRequest MaintainOrderReplaceItemAction customerExitParseRequest MaintainOrderNewShiptoAction customerExitParseRequest MaintainOrderSendAction customerExitParseRequest MaintainOrderDispatcherAction customerExitDispatcher Description Base action for all actions providing functions to manage the shopping basket and sales documents similar to the basket. called after the header and item data are parsed from the request. called after the header data is parsed from the request. before the inspection is actually created in the CRM system.getSession()). The following code sequence retrieves a reference to a UserSessionData object: // get user session data object UserSessionData userSessionData = UserSessionData. Table 38: User exits within the Remanufacturer’s Inspection Application Accessing the Session Context In most cases you need to access the session context from Actions.BaseAction provides methods enabling you to communicate with the session context. the complaint/return item entry or complaint/return item resubmission. August 2008 196 .core. either when the user presses the “update” or “send” button on the complaint entry or return entry. either when the user presses the “update” or “send” button on the complaint entry or return entry. The base class of your Actions com.sap.isa. methods. This method is called when the update of the header is invoked. This method is called when the update of an item is invoked when the user presses “update” or “send” on the complaint/return main entry page. Extended Complaints and Returns Application Class / Method ComplaintEntryBaseAction customerExitParseRequest Description Base action for all actions providing functions to manage the entry of complaints and returns. It is called before the header is actually updated in the CRM system.0 As in the Internet Sales application.core.isa. It is called before the document is actually updated in the CRM system. Within the ISA framework you are only allowed to communicate with the session using the com. This method is called when the update of a whole document is invoked. This method is called when the user submits an inspection. After that you can get/set objects in the session using the methods Object getAttribute(String name) and setAttribute(String name. some action classes provide user exits in the form of predefined.Development and Extension Guide – SAP E-Commerce 7. Object object). customerExitParseRequestHeader customerExitParseRequestItem Table 37: User exits within the Extended Complaints Remanufacturer’s Inspection Application Class / Method ConfirmationEntryBaseAction customerExitParseRequest Description Base action for all actions providing functions to create an inspection confirmation. It is called before the item is actually updated in the CRM system. but empty.sap.getUserSessionData(request.UserSessionData object. Development and Extension Guide – SAP E-Commerce 7.IsaCoreBaseAction you get passed the reference to the Business Object Manager in the isaPerform() as a parameter (please see JavaDoc).getBasket(). Now you can use the reference to the BOM to get a reference to a Business Object or to create a Business Object: Basket basket = bom. o The next step is to get a reference to the Business Object Manager.sap. which manages the Business Object you are interested in: UserSessionData userSessionData = UserSessionData.BaseAction o Get a reference to the user session data. Actions are responsible for retrieving data from the HTTP-based environment and passing this data to Business Objects when accessing business functions.action. way is to use the convenience method getBOM() of the UserSessionData class: BusinessObjectManager bom = (BusinessObjectManager)userSessionData. and recommended.setName(‘Mueller’).ISACORE_BOM). Before this reference is used. getBOM(BusinessObjectManager. User user = bom.createUser().getUserSessionData(session). you should check whether it is null or not: if (user == null) { // Error } The business methods can then be executed on the BO: user. You need a reference to this object before you can get a reference to the Business Object Manager.core. August 2008 197 . Business Objects do not know anything about HTTP. The easiest.isacore. If your base class is com.sap.0 Accessing Business Objects from Actions Actions act as a mediator between the HTTP world and the BO Layer. Before an Action can communicate with a Business Object it needs a reference to it.isa. To get a reference the following steps have to be performed: If your base class is com.isa. 0 – Examples and Tutorials’ (see [1] in chapter References on page 305).sap. The base class of each Business Object provides this mechanism. Example See ‚Enhancing/Modifying the Action Flow’ and ‘Extension Demo 1 – Add New Entry Fields’ in the ‘Development and Extension Guide: E-Comemrce 7. Modifications in the Struts Configuration Modifications in the struts configuration are required to Add or remove actions in the action flow Register customer actions in the action flow. Version This feature is available in all versions of E-Commerce.xml. since this would undermine the purpose of the Object Manager.xml file: <BusinessObjectManager name=‘ISACORE-BOM’ className = ‘com.0 The Business Object Manager you get a reference to is defined in the <isa>/webinf/cfg/bom-config. This rule forces every Action to retrieve the Business Objects using the technique described above. In the E-Service applications Extended Complaints and Returns and Remanufacturer’s Inspection.businessobject. These references should never be passed onto other Actions via the session context.isa. August 2008 198 .Development and Extension Guide – SAP E-Commerce 7.Extension Mechanism This modification concept uses the previously mentioned extension mechanism that enables you to store any data in a Business Object. this file is located in <esrv>\web-inf\struts-config. Accessing the Request Context For information about how to access the RequestContext within an JSP refer to chapter 'Request Context' on page 222. This file is located in <isa>\web-inf\config. Business Object Layer Storing Additional Data .xml.BusinessObjectManager’ /> The references to the BusinessObjectManager and the corresponding objects remain valid and can be reused within the Action as often as required. Table 39: Methods of the BOBase class Version This feature is available in all versions of Internet Sales. Use only string objects with the extension data.businessobject. Retrieves all extension data associated with the Business Object.sap. Removes extension data from the Business Object.Development and Extension Guide – SAP E-Commerce 7. It is also available in the E-Service applications Extended Complaints and Returns and Remanufacturer’s Inspection. Retrieves extension data associated with the Business Object.isa.0 Additionally. Figure 56: BOBase class Each Business Object extends the com. if you want to automatically transport this data to the backend using the Extension mechanism (see BADIs/SAP CRM Extensions).core. This base class provides the following methods to store any data: Method Name addExtensionData(Object key. This is the preferred extension concept when you have to pass data between the Business Object and the SAP CRM or the SAP ERP system. this data can be passed transparently to the backend system.BOBase class. For further information on this concept please refer to chapters BADIs/SAP CRM Extensions on page 211 or BAPIs/SAP ERP-Extensions on page 217. August 2008 199 . Object name) Object getExtensionData(Object key) getExtensionDataValues() removeExtensionData(Object key) Function Stores any data within the Business Object. Extending existing Business Objects You use this extension concept when you want to add functions to an existing Business Object.getBasket(). Figure 58: Create own BOM August 2008 200 . you have to derive from the existing Business Object and extend/replace its functions.getExtensionData(‘extHeaderData’).addExtensionData(‘extHeaderData’. In order to make the new version of the Business Object available for use. Figure 57: Derive own class from existing Business Object Since every Business Object is accessed via a Business Object Manager. or if you want to replace the functions of an existing method with your own implementation. In either case. you have to extend the BOM that manages the Business Object you have extended.Development and Extension Guide – SAP E-Commerce 7.0 Example Storing additional data in the basket Business Object: // set extended data as extended data of the Basket Business Object isaBOM.getBasket(). you have to overwrite the get/create method of the BOM that creates this Business Object. extBasketHeaderData). Retrieving extended data: String extBasketHeaderData = (String)isaBOM. This feature is also available in the E-Service applications Extended Complaints and Returns and Remanufacturer’s Inspection.getUser(). Version Own Business Object can be extended in all versions of Internet Sales.0 The new modified version of the BOM creates an instance of the new Business Object.getUser(). Function modules are called within Backend Objects and there is always need of a corresponding Business Object BOBase +addExtensionData() +getExtensionData() +removeExtensionData() Z_CustomFunc +getInfo() Figure 59: Creating own Business Object Customer written Business Objects are managed by a custom Business Object Manager. user. August 2008 201 . All existing Actions do not have to be changed: User user = bom. Create a Customer Business Object There are various reasons why you would have to write your own Business Objects: To provide new functions (there are no suitable Business Objects that could be extended) If you have written own remote callable function modules and would like to use them in customer extensions.Development and Extension Guide – SAP E-Commerce 7.doNew(). New Actions can use the new/extended functionality of the Business Object: NewUser user = (NewUser)bom. The return value must be the class which represents the old Business Object. BOBase 2.ObjectBase. and a method to drop all references to the existing object (releaseXX). therefore.core. always returns a reference to a BO.businessobject. If you have a lot of custom Business Objects. Version This feature is available in all versions of Internet Sales.isa.businessobject.sap.sap. Calling createXX. create a deeper package structure that reflects the business functions provided by your custom business objects. Otherwise extend com.0 – Examples and Tutorials’ (see [1] in chapter References on page 305) provides you a template you can use for your own projects when writing own Business Objects.<your company>.Development and Extension Guide – SAP E-Commerce 7.isa. Create a Customer Business Object Manager A Business Object Manager usually has a method to generate a BO (createXX). By contrast. Place this class in a package like com.isa.BackendAware 3. The semantics are defined in such a way that the createXX method generates a new BO if one does not already exist. If the business object has a corresponding Backend Object it should implement com.core.core. a method to interrogate existing BOs (getXX). August 2008 202 . Example 'Extensions Demo 7: Copy –Template for Customer Actions' in the ‘Development and Extension Guide: EComemrce 7.isa.businessobject o If you have only few Business Objects.sap. Business Object Managers and Backend Objects.0 DefaultBusinessObjectManager Z_CustomFunc Z_CustomBusinessObjectManager +getInfo() creates + getCustomFunc() Figure 60: Creating own BOM To write a Business Object and add it to the BOM you have to perform the following steps: 1. Write a class which extends o o If you are writing a Business Object having a representation in the backend system which is identified by a GUID: com. you can place them directly under the businessobject package. It is also available in the E-Service applications Extended Complaints and Returns and Remanufacturer’s Inspection. or functions in the same way as getXX with existing BOs.businessobject. getXX returns null if the object has not yet been generated with createXX. one method is created with the signature User getUser(). BOs that require this information must implement the BackendAware interface. it is sufficient to implement the interface on the BO side. Even if it turns out later on that the BO does need to communicate with the backend. getXX. and releaseXX methods must be re-implemented for new BOs. whereby XX is replaced by the exact name of the BO class in question. If the class is called User. you can use the GenericBusinessObjectManager as a base class for your own Business Object Manager. and call the corresponding generic methods of the superclass by passing the class object of the Business Object you want to manage. All you have to do is write the required method (for example. and one with the signature void releaseUser(). changes do not have to be made to the BOM.0 The createXX. BOs that do not have to communicate with the backend should not implement the interface unnecessarily. «interface» BackendAware User .Development and Extension Guide – SAP E-Commerce 7. which means that they also implement the setBackendObjectManager method. for example. This class can already manage Business Objects and using it makes it easier to implement BOMs. create/get). In this case. BusinessObjectManagerBase DefaultBusinessObjectManager +setBackendObjectManager() +assignBackendObjectManager() GenericBusinessObjectManager Z_CustomBusinessObjectManager +getBusinessObject() +createBusinessObject() +releaseBusinessObject() +getCustomFunc() Figure 62: Creating own Business Object Manager August 2008 203 . one with the signature User createUser().bem : BackendObjectManager + setBackendObjectManager() + + + + setBackendObjectManager() setUserId(id : String) setPassword(pwd : String) login() Figure 61: Creating interface for Business Object To make it easier to develop Business Object Managers. When the BOs are created by the BOM they can be assigned a reference to the BackendObjectManager. xml file and add an entry to it for the new manager.xml // used in Actions as a constant to identify the BOM public static final String CUSTOM_BOM = ‘Z_CUSTOM-BOM’. } } After implementing a BOM. August 2008 204 . BackendAware { .Development and Extension Guide – SAP E-Commerce 7. } return mCustomFunc.xml#xpointer(BusinessObjectManagers/*)’/> <BusinessObjectManager name=‘ Z_CUSTOM-BOM’ className=‘com.Z_CustomBusinessObjectManager’ /> </BusinessObjectManagers> Version This feature is available in all versions of Internet Sales. // assigns Backend Object Manager to Business Object if // Business Object implements the BackendAware interface assignBackendObjectManager(mCustomFunc). you have to register it in the customer version of the bom-config. /** * Returns custom business object */ public Z_CustomFunc getCustomFunc() { if (mCustomFunc == null) { mCustomFunc = new Z_CustomFunc().0 public class Z_CustomBusinessObjectManager extends DefaultBusinessObjectManager implements BOManager. // reference to business object private Z_CustomFunc mCustomFunc. It is also available in the E-Service applications Extended Complaints and Returns and Remanufacturer’s Inspection...xml: <BusinessObjectManagers> <xi:include href=‘${sap}/modification/bom-bonfig.businessobject. // key used for the Business Object Manager in customer version of bom-config.acme..isa. The file is located in WEB-INF\xcm\customer\modification\bom-config. methods. in most cases empty.0 – Examples and Tutorials’ (see [1] in chapter References on page 305) provides you a template you can use for your own projects when writing own Business Objects. In order to create a customer Backend Object the following two scenarios have to be separated: The Backend Object extends a standard Backend Object: Re-implement the methods which cannot be used from the standard Backend Object and/or add additional Methods.Development and Extension Guide – SAP E-Commerce 7. you want to add additional data before you continue with processing. For extensions only the existing methods have to be implemented or extended in a new backend object class derived from the standard backend object class. Or. Business Object Managers and Backend Objects. before you continue with processing.g. Business Logic Service Layer Many Business Objects (e. Overwrite customer exits The Backend Object is needed for a customer Business Object and can not be derived from a standard Backend Object: Standard Backend Objects providing User Exits Some backend object classes already provide user exits in the form of predefined. The advantage of predefined user exits is that extensions or changes in the standard backend object classes by SAP within support packages or future releases are aware of these user exits: August 2008 205 . basket) in the Business Object layer have a corresponding Backend Object in the BLS layer. The implementation of such an interface is backend-dependent (for example: BasketCRM). Additional functions can be provided by the SAP CRM system in different ways: By using BADIs By additional function modules By customer changes to existing function modules: o o Without changing the function module interface By adding optional parameters to the function module interface Create a Customer Backend Object You would like to enhance a specific processing step within the application.0 Example 'Extensions Demo 7: Copy-Template for Customer Extension' in ‘Development and Extension Guide: EComemrce 7. Customizing of the Java part is often related to changes in the SAP CRM system. you want to execute self written remote callable function modules in the SAP system. The functionality of a Backend Object is accessed via a well-defined Java interface (for example: BasketBackend). A reason for doing this could be that you want to perform some additional checks that are not part of the original processing. Or. Overwrite this method if you want to change the IPC items in some way. for example to pass additional attributes to the document. Overwrite this method if you want to add or modify item properties. This method provides the possibilty. this method is called and it returns a PriceType object. Overwrite this method if you want to change the IPC document in some way. For further information refer to 'Changes in backendobject-config. and after the basket has been created. but before creating the items in IPC. It determines list/scale prices from catalog attributes. This exit is called after creating the IPCItems. and use your subclass. Called after preparing the IPCDocumentProperties.xml' on page 275 Call IPC for Pricing (ISA CRM) Class / Methode PriceCalculatorInitDataCRMIPC Description Price calculator for the SAP CRM backend. for example to pass additional attributes to the item. This exit is called for PriceType determination. It cretaes PriceInfo Objects and stores them in a Prices object which is then returned. When the PriceCalculator is initialized. Table 40: User exits for IPC for pricing customerExitBeforeIpcDocument Create customerExitAfterIpcDocument Create customerExitBeforeIpcItemsCreate customerExitAfterIpcItemsCreate customerExitCreatePrices customerExitGetPriceType IPC-Basket (ISA CRM) Class / Methode BasketIPC customerExitAfterAddBusiness PartnerInBackend Description Basket implementation for IPC This method provides the possibility to extend or modifiy the IPC document. the price types used are read from eai-config.0 In order to use a customer exit you have to perform the following steps: Extend the standard Backend Object class and overwrite the customer exit Register your Backend Object class in customer version of backendobject-config.xml. Overwrite this method if you want to add or modify document properties.xml configuration file. customerExitSetDocumentProperties Table 41: User exits for IPC basket August 2008 206 . but before creating the document in IPC.Development and Extension Guide – SAP E-Commerce 7. Overwrite this method if you want to subclass PriceInfoIPC. The exit is called within the method createInBackend when a basket is created. The exit is called within the method addBusinessPartnerInBackend when a user has already logged on. This exit is called after preparing the IPCItemProperties. as well as dynamic prices through IPC. This exit is called when creating the Prices from the IPC item. based on the settings in the web shop. For each String in that list. to easily extend the document properties of a sales document according to special customer requirements. This exit is called after creating the IPCDocument. but before the IPC-document is created. This method can be used to set additional tables or table fields before the function module SD_SALESDOCUMENT_CHANGE is called This method can be used to modify the ISA sales document after the function module SD_SALESDOCUMENT_CHANGE is called. It is called after the ISA sales document has been filled with the function module data.Development and Extension Guide – SAP E-Commerce 7. It is called only if no error messages from have been returned and after re-reading the ISA sales document from ERP. but before an IPC item is created. Contains the algorithms for reading an entire sales document from ERP. to easily extend the item properties of a sales document according to special customer requirements. Table 43: User exits for Order and Order Status performCustExitBeforeR3Call performCustExitAfterR3SimulateCall ChangeStrategyR3 performCustExitBeforeR3Call performCustExitAfterR3Call DetailStrategyR3 performCustExitBeforeR3Call performCustExitAfterR3Call August 2008 207 .0 Class / Methode customerExitSetItemProperties Description This method provides the possibilty. This method can be used to set additional tables or table fields after the function module BAPI_ISAORDER_GETDETAILEDLIST is called. This method can be used to set additional tables or table fields after the function module SD_SALESDOCUMENT_CREATE is called. Table 42: User exits for IPC basket Order and Order Status (ISA ERP) Class / Methode CreateStrategyR3 Description Algorithms for creating and simulating an order. This method can be used to set additional tables or table fields before the function module SD_SALESDOCUMENT_CREATE is called. This method can be used to set additional tables or table fields before the function module BAPI_ISAORDER_GETDETAILEDLIST is called. Algorithms used for sales document change. It is called after the ISA sales document has been filled with the function module data. The exit is called within the method update(BasketData) when a new item is created. Both tasks are done with the function module SD_SALESDOCUMENT_CREATE. customerExitBeforeItemCreation customerExitAfterItemCreation customerExitBeforeHeaderAttributeCall Table 46: User exits for for Pricing or Configuration August 2008 208 . Customer exit that is called after an array of IPC items has been created.Development and Extension Guide – SAP E-Commerce 7. Customer exit that is called after an IPC item has been created. Table 45: User exits for Web Catalog See also: Extension of the Web Catalog on page 229. attach additional attributes to the catalog. List of ERP messages which are raised by function modules when simulating or saving orders and which should be displayed on the UI or should be ignored (in case of error messages). Customer exit that is called directly before ISA_PRICING_HDRDATA_GET is called. This customer exit can be used to set the context if reference characteristics are involved. Table 44: User exits for Order and Order Status setUpMessageMap Web Catalog (Memory Catalog) (ISA ERP) Class / Methode R3CatalogServerEngine performCustomerExitAfter CatalogRead Description Memory Catalog. See notes 640735 and 641132. Customer exit that is called after an IPC document is created. order read and order create simulation. Contains creation of documents and items. This customer exit can be used to set the context if reference characteristics are involved. Called after the catalog has been set up. Customer exit that is called before an IPC item is created. This customer exit is only called for the standard main memory implementation.0 Class / Methode ReadStrategyR3 Description Contains base functionality for transferring data from function module tables to the ISA sales document that is used from all other algorithm groups. Call IPC for Pricing or Configuration (ISA ERP) Class / Methode ServiceR3IPC customerExitAfterDocumentCreation customerExitBeforeItemCreation customerExitAfterItemCreation Description Provides IPC functionality for the Internet Sales ERP.g. Can be used to set additional parameters in table EXTENSION_IN. order change. For example reading the item and schedule line info is used from all strategies that deal with order change simulation. Can be used to e. Customer exit that is called before an array of IPC items are created. BackendBusinessObjectBaseSAP class. Design Considerations when Creating Backend Object Interfaces If you need to access data located in the Business Object layer you should not pass the reference of the business object to the backend object. Table 47: User exits for for Pricing or Configuration Creating new Customer Backend Objects When creating a custom Backend Object you have to perform the folling steps. but instead use a data access interface instead.sap. This interface should provide all necessary access methods.isa.sp. Stateless classes should use IsaBackendBusinessObjectBaseSAP as in this case the correct logon language is used in the connection.sap.Development and Extension Guide – SAP E-Commerce 7. you define any set of methods needed to access business functions located in the backend system. communicate with the backend system using the connection management provided by the BLS layer Add configuration information to the customer version of the backendobject-config.jco. Only relevant for the non-TREX case.g. Create a Java interface that is used to access the Backend Object Create an implementation for this interface The implementation must implement the BackendBusinessObject interface o If the Backend Object has to communicate with an SAP system using JCo. } Additionally. Within the Backend Object implementation. derive your implementation from the com. Can be used to set additional parameters in table EXTENSION_IN.xml configuration file Create an Interface of Backend Object The interface of the new Backend Object extends the com. Place the data interface in the same package as the Backend Object interface.0 Class / Methode customerExitBeforeItemAttributeCall Description Customer exit that is called directly before ISA_PRICING_ITEM_ATTRIBUTE is called.core. the shop customizing.BackendBusinessObject interface: public interface Z_CustomFuncBackend extends BackendBusinessObject { public String getInfo(). August 2008 209 . Note that the backend context is available here with e.eai. sap. .getJCoFunction(‘Z_GETINFO’).businessobject.g etString(‘in fo’).isa.xml The backend object has to be registered in the customer version of backendobject-config. This method is used to store a reference to the Backend Object Manager: .BackendAware interface.Function func = getDefaultJCoConnection(). This interface defines the method: public void setBackendObjectManager(BackendObjectManager bem).getExportPar ameterLi st(). private BackendObjectManager bem.acme. } When the Business Object is retrieved from the Business Manager the method usually looks as follows (example from previous chapters): August 2008 210 .bem = bem.Z_CustomFuncCRM’ connectionFactoryName=‘JCO’ defaultConnectionName=‘CRMStateless’> <params> <param name=‘myinit’ value=‘myvalue’/> </params> Accessing Backend Objects from Business Objects If Backend Objects need access to the BLS layer they have to implement the com. Z_CustomFuncBackend { public String getInfo() { JCO.. } } Register Backend Object in backendobject-config.crm.. getDefaultJCoConnection().core.xml using XCM extension mechanism: <businessObject type=‘Z_Custom’ name=‘ Z_Custom ‘ className=‘com. Use the BackendBusinessObjectBaseSAP class as the base class for backend objects communicating with an SAP system using the SAP Java Connector. return func.isa.Development and Extension Guide – SAP E-Commerce 7. public void setBackendObjectManager(BackendObjectManager bem) { this....execute(func).0 Create an Implementation of Backend Object Write an implementation for the interface of the Backend Object. public class Z_CustomFuncCRM extends BackendBusinessObjectBaseSAP implements BasketBackend.backend. . } The Backend Object Manager is assigned to the Business Object within the assignBackendObjectManager().z_getbo’.> .0 public Z_CustomFunc getCustomFunc() { if (mCustomFunc == null) { mCustomFunc = new Z_CustomFunc(). } catch (BackendException bex) { log. Version This feature is available in all versions of Internet Sales.error(‘acme. } } return mCustom.error. private Z_CustomFuncBackend getCustomFuncBackend() { if (mCustom == null) { try { mCustom = (Z_CustomFuncBackend) bem. Having a reference to the Backend Object Manager enables the Business Object to create a instance of a backend object using the createBackendBusinessObject(String backendObjectType) method. <businessObject/> public class Z_CustomFunc { private Z_CustomFuncBackend mCustom.xml <businessObject type=‘Z_Custom’ name=‘Z_Custom’ ..getInfo(). The value of backendObjectType corresponds to the value of the type XML element within the backendobject-config... } .. } return mCustomFunc. } public String getInfo() { return getCustomFuncBackend(). // assigns Backend Object Manager to Business Object if // Business Object implements the BackendAware interface assignBackendObjectManager(mCustomFunc)..Development and Extension Guide – SAP E-Commerce 7. August 2008 211 . bex).createBackendBusinessObject(‘Z_Custom’).. The separation of complaints and returns is merely done on the user interface only: the process. BADIs/SAP CRM Extensions This section describes a solution for modifying Business Objects without modifying the standard backend implementation. the E-Service Extended Complaints and Returns application provides some BADIs that you can implement in the CRM system to let you do additional processing. You only need to extend the Interaction Layer with actions to fill your additional fields. As in the Internet Sales application.0 – Examples and Tutorials’ (see [1] in chapter References on page 305) provides you a template you can use for your own projects when writing own Business Objects. and as a consequence. if you want to access this data from the backend. August 2008 212 . The extensions in the Java layer are also key value pairs that are assigned to the corresponding Business Objects. After the BADIs exist you should move your code inside the BADIs. Business Object Managers and Backend Objects. Note that the Complaint business object handles both complaints and returns. Example 'Extension Demo 7: Copy-Templates for Customer Extensions' in the ‘Development and Extension Guide: EComemrce 7. Therefore. where the fields are filled in extension structures as name value pairs. you need to implement a BADI in SAP CRM. you must fill the extension structure in SAP CRM as a modification of your function modules in this ‘pre BADI’ period.Development and Extension Guide – SAP E-Commerce 7. the business objects. this data extension structure can be processed in the CRM system by implementing the BADI definition. it means that the data structure extension is not used as parameter for the function module. Some function modules have as a parameter an extension data structure (type CRMT_ISALES_EXTENSION_INT). This following table lists the function modules and business objects where the extension data is stored in the java application. After that you can access the field using the key from the extension in the Java layer. It also lists the BADIs method where your processing can be inserted. If there are no business objects. Due to time constraints we couldn’t implement all of the BADIs in the first step.0 It is also available in the E-Service applications Extended Complaints and Returns and Remanufacturer’s Inspection. The solution consists of two parts: the extension concept for Business Objects in the Java layer and the BADIs and the ABAP extension structure in the SAP CRM BLS layer. backend objects and ABAP function modules are basically the same. To extend a Business Object with your own fields. This means that you can extend the standard Business Objects with your own data without changing anything in the Business Object and BLS layer. Use String objects when storing extension data. If you use the Java Basket with ISA CRM. you also have to transfer the extension data to the JDBC backend objects and DB basket. For those function modules. Note that some function modules do not use the extension data structure but still offer BADI methods. with SAP CRM as the backend system. ABAP Extension Structure Field REF_GUID ALT_HANDLE Type CRMT_OBJECT_GUID_C CHAR30 Description Guid of the business object.Supported Function Module / Business Object .Supported Function Module / Business Object . Value of the extension. In this case. like the items in the basket. the handle is filled and.Order User Function module CRM_ISA_BP_BPARTNER_GETDETAIL CRM_ISA_BP_CONSUMER_CHANGE CRM_ISA_BP_CONSUMER_CREATE Business object User User User Table 50: CRM .User August 2008 213 . Normally only used when new business objects are created. Since the guids are normally generated from the backend. Table 48: ABAP Extension Structure (CRM) Take care of the field ALT_HANDLE for creating table-like objects. if no guid exists. you can associate the extension with the related item. the guids are empty when new entries are created. It is also available in the E-Service Extended Complaints and Returns application. Alternative handle. with it.Development and Extension Guide – SAP E-Commerce 7.0. NAME VALUE CRMT_ISA_EXTENSION_KEY CRMT_ISA_EXTENSION_VALUE Name of the extension. Supported Function Modules and Business Objects Order Function module CRM_ISA_BASKET_GETITEMS CRM_ISA_BASKET_CHANGEITEMS CRM_ISA_BASKET_GETHEAD CRM_ISA_BASKET_CHANGEHEAD CRM_ISA_BASKET_STATUS CRM_ISA_SALESDOC_GETLIST CRM_ISA_BASKET_STATUS_ENH Business object ItemSalesDoc ItemSalesDoc HeaderSalesDoc HeaderSalesDoc HeaderSalesDoc ItemSalesDoc OrderStatus OrderStatus Table 49: CRM .0 Version This feature is available in all versions of ISA 5. Shop Complaint (E-Service) Function module CRM_ESRV_COMPL_CREATE CRM_ESRV_COMPL_CRT_FROM_DLVRY CRM_ESRV_COMPL_CRT_FROM_INV CRM_ESRV_COMPL_CRT_FROM_MKT CRM_ESRV_COMPL_CRT_FROM_PSL CRM_ESRV_COMPL_CRT_FROM_SORD CRM_ESRV_COMPL_INITIALIZE CRM_ESRV_COMPL_SAVE CRM_ESRV_COMPL_DELETE_ITEMS Business object Complaint Complaint Complaint Complaint Complaint Complaint Complaint Complaint Complaint Table 53: CRM .Supported Function Module / Business Object .Supported Function Module / Business Object .Development and Extension Guide – SAP E-Commerce 7.Supported Function Module / Business Object – ComplaintItem August 2008 214 .Supported Function Module / Business Object .Contract Shop Function module CRM_ISA_SHOP_DATA_GET CRM_ISA_SHOP_GETLIST Business object Shop Shop Table 52: CRM .Complaint ComplaintHeader (E-Service) Function module CRM_ESRV_COMPL_CHANGE_HEADER CRM_ESRV_COMPL_GET_HEADER Business object ComplaintHeader ComplaintHeader Table 54: CRM .Supported Function Module / Business Object – ComplaintHeader ComplaintItem (E-Service) Function module CRM_ESRV_COMPL_CHANGE_ITEM CRM_ESRV_COMPL_CHANGE_ITEMS CRM_ESRV_COMPL_GET_ITEM CRM_ESRV_COMPL_GET_ITEMS Business object ComplaintItem ComplaintItem ComplaintItem ComplaintItem Table 55: CRM .0 Contract Function module CRM_ISA_CNT_GETCONTRACTS Business object ContractHead ContractItem Table 51: CRM . ls_extension-alt_handle = ls_header-handle. APPEND ls_extension to extension_item_out ENDLOOP. ‘name ‘value August 2008 215 . ‘ value APPEND ls_extension to extension_header_out * now adding extensions to the items LOOP AT lt_items INTO ls_item. as an example: * ls_header is a local structure with header data ls_extension-ref_guid = ls_header-guid. Here are some extensions for the basket. ls_extension-name = ‘Z_CUSTOMER2’ ls_extension-value = ls_item-zcustomer2.Development and Extension Guide – SAP E-Commerce 7. * extension are name value pairs ls_extension-name = ‘Z_CUSTOMER1’ ‘ name ls_extension-value = ls_header-zcustomer1.0 Reading data from the Backend If you are reading additional fields from the backend you have to fill the extension tables properly. ls_extension-ref_guid = ls_item-guid. ls_extension-alt_handle = ls_item-handle. and we need to use the handle to identify the extensions. * check. ENDIF. ls_item-zcustomer2 = ls_extension-value. ENDLOOP. ENDIF. ENDIF. * sort the extension table by ref_guid and handle to obtain a better access * with binary search. LOOP AT lt_items INTO ls_item. Example (no example available) August 2008 216 . In this case. if the entry is relevant IF NOT ls_extension-ref_guid = ls_item-guid OR NOT ls_extension-alt_handle = ls_item-handle. ls_header-zcustomer1 = ls_extension-value. LOOP AT extension_item_in INTO ls_extension FROM SY-TABIX. * check the name to find the according field IF ls_extension-name = ‘Z_CUSTOMER1’.Development and Extension Guide – SAP E-Commerce 7. ENDIF. ENDLOOP. BREAK. since we have a problem with the table-like structure at creation point. IF ls_extension-key = ‘Z_CUSTOMER2’. ENDLOOP. * find the starting point for a loop over extensions * use guid and handle as one logical key to access the extension READ TABLE extension_item_in WITH KEY ref_guid = ls_item-guid alt_handle = ls_item-handle BINARY SEARCH. IF SY-SUBRC = 0. no guids table items exist.0 Writing data to the backend This case is little bit more complex. alt_handle. * ls_header is a local structure with header data LOOP AT extension_header_in INTO ls_extension. SORT extension_item_in BY ref_guid. Development and Extension Guide – SAP E-Commerce 7. if a visible field was hidden before the last update. the display or change attributes of the fields must be determined separately. When this flag is set to true. a corresponding message will notice the user. that are hidden for every item category of the used transation type. the mapping of the CRM field name to the UI Element of the additional fields needs to be entered in the UI element definition in the XCM file uicontrol-config. The following components of the return structures need to be supplied: Component FIELDNAME CHANGEABLE INACTIVE Description Name of the field Field is changeable Field is visible or not Since it is possible on item level. It is based on the CRM Sales Order Override concept and the Dynamic Field Control concept of CRM E-commerce (see chapter Dynamic Field Control). Thus for the customer fields it is necessary to implement the corresponding methods GET_HEAD_FROM_IL of BADI CRM_ISA_BASKET_HEAD for the order header and GET_ITEMS_FROM_IL of BADI CRM_ISA_BASKET_ITEMS for the order items. a further compoment ‘IS_ADDITIONAL’ is provided for the item structure. The BADI implementations should perform the CRM_ORDER_FIELDCHECK for these fields and the results need to be transferred to the table parameter CT_FIELD_CHANGEABLE. In order to be able to determine. e. For the item fields the label of the items needs to be assigned to the description fields of the UI element in order to enable the display the field labels of the additional fields. Calling the CRM function module CRM_ORDER_FIELDCHECK the changeability of the order fields are determined depending on the order /order item status and the user’s authorizations. which were adopted in the extension table of the ECO APIs. For the empty lines those fields will not be displayed. Thus the display attribute of the UI element will be adopted generically from the table parameter HEADER_STATUS_CHANGEABLE respectively ITEM_STATUS_CHANGEABLE. Finally the table parameter CT_FIELD_CHANGEABLE needs to be assigned to a new entry for each item field with an initial value for the component ITEM_GUID and PARENT_GUID along with the retrieved field attriubutes FIELDNAME.g. The field attributes of order data are determined in the CRM via the function module CRM_ORDER_FIELDCHECK and transferred to the table parameter HEADER_STATUS_CHANGEABLE of the function module CRM_ISA_BASKET_GETHEAD and the parameter ITEM_STATUS_CHANGEABLE of the function module CRM_ISA_BASKET_GETITEMS. it is necessary to store the hidden fields in a temporary global table and to compare them with the visible fields after the order/basket was changed. The CRM order’s Sales Order Override concept allows hiding or disabling order fields during order processing depending on transaction type and item category regarding the user’s authorizations.xml. For the additional order fields. Example August 2008 217 . If this feature should be supported for the additional item fields as well the following enhancements are necessary in the above mentionded BADI for the order items. For every item type and object the function module CRM_FIELDCHECK_TOOL identifies the field attribute regarding the user’s authorizations. that additional field(s) are available. Therefore the SAP Implementation Guid (IMG) provides the possibility to create authorization groups and assign fields to them (IMG: CRM -> Basic Functions -> Authoritizations). when the product was changed. that additional fields will be displayed. CHANGEABLE and INACTIVE. In order to ensure that the attributes of the corresponding UI elements are adjusted accordingly.0 Enhancements for the Dynamic UI of ECO B2B The dynamic UI of ECO B2B enables the customer to hide or disable fields on the order screens of the ECO B2B application dynamically.The relevant item categories can be determined by calling the function module CRM_ORDER_IT_ASS_SEL_PROC_CB. These authorization groups can be incorporated to the user’s authorization within the authorization object CRM_FLDCHK. August 2008 218 . The solution consists of two parts: the extension concept for Business Objects in the Java layer and the ABAP extension structure in the SAP ERP BLS layer. After that you can access the field using the key from the extension in the Java layer.Development and Extension Guide – SAP E-Commerce 7.0. where the fields are filled in extension structures as name value pairs. ABAP Extension Structure (BAPIPAREX) Field STRUCTURE Type TE_STRUC Description Structure name of BAPI table extension. This means that you can extend the standard Business Objects with your own data without changing anything in the Business Object and BLS layer.0 <UIElement name = "order.order. The extensions in the Java layer are also key value pairs that are assigned to the corresponding Business Objects. you have to declare all additional data fields transferred via the extension structure in the configuration of the web application. you need to implement the corresponding append structures in SAP ERP. Use String objects when storing extension data.display. if you want to access this data from the backend.deliveryPriority" description = "b2b.deliverPrio" allowed = "true" disabled = "false"> <backend structureName = "ORDER_ITEM" fieldName = "DLV_PRIO" /> </UIElement> BAPIs/SAP ERP-Extensions This section describes a solution for modifying Business Objects without modifying the standard backend implementation. Furthermore.item. Version This feature is available in all versions of ISA 5. with SAP ERP as the backend system. To extend a Business Object with your own fields. You only need to extend the Interaction Layer with actions to fill your additional fields. Supported Function Module / Business Objects – Order Please also check the chapter ‘ August 2008 219 . Extension data (240 characters). Order Function module SD_SALESDOCUMENT_CREATE SD_SALESDOCUMENT_CHANGE BAPISDORDER_GETDETAILEDLIST Business object HeaderSalesDoc ItemSalesDoc HeaderSalesDoc ItemSalesDoc HeaderSalesDoc Table 57: ERP . Extension data (240 characters).0 Extension data (240 characters). Table 56: ABAP Extension Structure (ERP) VALUEPART1 VALUEPART2 VALUEPART3 VALUEPART4 VALUEPART VALUEPART VALUEPART VALUEPART Supported Function Modules and Business Objects. Extension data (240 characters).Development and Extension Guide – SAP E-Commerce 7. August 2008 220 .Development and Extension Guide – SAP E-Commerce 7.0 Generic Search Framework’ (page 101). in configuration backendobject-config. Configuration of the Web Application Corresponding to the SAP ERP system.g.2.r3base. The sequence of data. is defined in the SAP ERP DDIC by so-called communication structures (e. If the data should be transferred to other data structures in SAP ERP you have to implement an additional form routine for data transfer (see below).isa.2’/> <param name=‘fieldsItem’ value=‘ LPRIO. for transfer of data between the extension structure and the business object extension data. data is transferred to specific SAP ERP data structures based on equal field names (using move-corresponding): Communication structure BAPE_VBAK BAPE_VBAP BAPI_VBKD ERP Data structure VBAK VBAP VBKD Description Order header data (default structure). you have to define the data definition of the communication structure in ISA.0 Modification of Communication Structures in SAP ERP In contrast to the BADI/SAP CRM extension concept.4’/> </params> </businessObject> August 2008 221 . These communication structures have to be modified/ extended by the data fields which have to be transferred between the extension structure and the data structures in SAP ERP.* Table 58: Communication Structure in SAP ERP * If the structure BAPI_VBKD should be used for transferring data on order header and/or order item level to the ERP data structure VBKD also parameter structure and/or structureitem has to be changed in the configuration backendobject-config.xml on page 275).xml (see bellow). Order business data.sap.WERKS. Order item data (default structure).xml (see Changes in backendobject-config. as well as the data length of the individual data fields within the extension structure BAPIPAREX.Development and Extension Guide – SAP E-Commerce 7. in the BAPI/SAP ERP extension concept only values of additional data are transferred. The definition of the fields must contain name/length pairs separated by comma: <businessObject type=‘EXTENSION_DOCUMENT_CREATE’ name=‘EXTENSION_DOCUMENT_CREATE’ className=‘com.ExtensionParameters’ attributes=‘standalone’> <params> <param name=‘structure’ value=‘BAPE_VBAK’/> <param name=‘structureItem’ value=‘BAPE_VBAP’/> <param name=‘fields’ value=‘ LIFSK.backend. where additional data are transferred by name/ value pairs. BAPE_VBAK). By default. ENDCATCH. If the additional data should be transferred to a different data structure. Only character type data can be transferred through this mechanism. no further activities are necessary. no further activities are necessary.Development and Extension Guide – SAP E-Commerce 7. IF SY-SUBRC NE 0. APPEND EXTENSION_OUT. The extension structure can only used for character type data. MOVE ´BAPE_VBAK´ TO EXTENSION_OUT-STRUCTURE. as shown in the following example: August 2008 222 . TO WA_BAPE_VBAK-ZZPMNTTRMS. an additional form routine for data transfer has to be implemented. ENDCATCH. an additional form routine for data transfer has to be implemented. CATCH SYSTEM-EXCEPTIONS CONVERSION_ERRORS MOVE WA_BAPE_VBAK TO EXTENSION_OUT+30. Writing Data to the Backend If the additional data should be transferred to the default data structure (see above). as shown in the following example: * Extensiondata write . TABLE_TABIX = SY-TABIX. ENDIF. CATCH SYSTEM-EXCEPTIONS CONVERSION_ERRORS = 1.0 Reading Data from the Backend If the additional data should be read from the default data structure (see above). binary data has to be converted before transfer. If the additional data should be read from a different data structure. MODIFY EXTENSION_OUT INDEX TABLE_TABIX. MOVE WA_BAPE_VBAK TO EXTENSION_OUT+30. binary data in the data structure has to be converted before transfer. ELSE. READ TABLE EXTENSION_OUT WITH KEY STRUCTURE = ’BAPE_VBAK’.Header MOVE SALES_DOCUMENTS MOVE ORDER_BUSINESS_OUT-PMNTTRMS TO WA_BAPE_VBAK-VBELN. = 1. Extension data attached to other business objects. for example the ship to have to transfered manually by extending the corresponding standard backend objects. IF SY-SUBRC EQ 0. Example (no example available) Request Context The request context is a container enabling you to easily exchange data between layers in an Internet Sales application.0. The context is accessible from nearly everywhere within the ISA framework. An automatic transfer of extension data from the Business Object to the Java Basket is only possible for extension data attached to the basket header or to the basket items.0 * Extensiondata read . with the Java basket as the backend system. ENDCATCH. ENDIF. The Request context is represented by the class com.core.Header READ TABLE EXTENSION_IN WITH KEY STRUCTURE = ’BAPE_VBAK’.sap. making it a very powerful way to exchange data. Example Chapter ‘Extensions Demo 5 – Maintain Delivery Block Indicator in ECO ERP’ of the ‘Development and Extension Guide: E-Comemrce 7. MOVE _BAPE_VBAK-ZZPMNTTRMS TO ORDER_BUSINESS_IN-PMNTTRMS. It is therefore not used within the standard coding of Internet Sales.isa.0 – Examples and Tutorials’ (see [1] in chapter References on page 305).Development and Extension Guide – SAP E-Commerce 7. The follwing table shows how to access the Request Context in the various places: Location Method for Accessing Request Context August 2008 223 .RequestContext. Version This feature is available in all versions of ISA 5. CATCH SYSTEM-EXCEPTIONS CONVERSION_ERRORS MOVE EXTENSION_IN+30 TO WA_BAPE_VBAK. Java Basket-Extensions This section describes a solution for modifying Business Objects without modifying the standard backend implementation. = 1. This means that you can extend the standard Business Objects with your own data without changing anything in the Business Object and BLS layer. Using the request context violates some rules defined for standard ISA development. If you want to store data between requests use the Business Object layer or use the session context instead. Table 59: How to access the Request Context The request context can store any type of data.RequestContext The scope of the request context is one request (usually one HTTP request).getRequestContext() Within the connectionEvent(JCoConnectionEvent event)method of a function module execution listener (com.sp.Development and Extension Guide – SAP E-Commerce 7.jco. The most important methods are: addData(Object name. After the request is finished the context is cleared.0. Version This feature is available in CRM ISA 5.getRequestContext() For further information about execution listeners refer to chapter 'Interception of Calls to Standard Function Modules' on page 225.core.getRequestContext(request) getRequestContext() getRequestContext() getBackendObjectSupport(). called by the standard to the JSP: August 2008 224 .0 JSP Action Business Object Backend Object Function Module execution listener RequestContext. Object value) o Stores any kind of data Object getData(Object name) o Returnes the stored data or null if not data with the given name is available in the Request Context For more information about the Request Context refer to the Java Doc of com.isa.core. JCoConnectionEventListener) event.isa.sap.eai.sap. Example This example demonstrates how to pass data from Function Module Execution Listener to a JSP: You would like to pass the value of an export parameter of a function module. // get custom value from import parameter name z_value String z_Value = func. August 2008 225 .getExportParameterList().0 public class MyListener implements JCoConnectionEventListener { public void connectionEvent(JCoConnectionEvent event) { // This event listener is called twice: before the function // module is executed and after // we are only intersted in the event after function call if (event.isa..getString(‘z_value’).getData(‘z_Value’). Backend Objects are accessed by Business Objects via well-defined Java interfaces. <%@ page import=‘com.xml in order to be notified when the function module is executed.addData(‘z_Value’.getId() == JCoConnectionEvent. For information how to work with function module execution listeners refer to chapter 'Interception of Calls to Standard Function Modules' on page 225.RequestContext’ %> <% String myValue = RequestContext.getRequestContext().Development and Extension Guide – SAP E-Commerce 7.. Adding additional Function Modules (Backend System) Function modules are accessed by Backend Objects. // pass value to RequestContext event. z_Value)..getJCoFunction(). } } } Retrieve the value within the JSP . If you have to access your own custom function modules you usually do it by writing a Backend Object.sap.getRequestContext(request).Function func = event. %> .AFTER_JCO_FUNCTION_CALL) { // get reference to JCO Function JCO.core.. This function event listener must be registered in the file /WEB-INF/xcm/customer/modification/modification-config. and has access to the RequestContext. The listener can be used to manipulate the function call. The following diagramm shows the how this concepts works at runtime: August 2008 226 . Backend Object). The basic idea behind this concept is to register a Java event listener. meaning that it can communicate with other parts of the application (Action. see chapters: 'Business Logic Service Layer Details' on page 77. Write a backend-specific implementation of the Backend Object.Development and Extension Guide – SAP E-Commerce 7. 2. Business Object.0. which is notified before/after a function module is called.0 Figure 63: Adding additional Function Modules In this case you must do the following 1. For detailed information on how to write Backend Object. Write a Business Object that is used by the Interaction/Business Object Layer to access new functions. without changing the Java coding provided. 3. 'Create a Customer Business Object' on page 200 'Create a Customer Backend Object' on page 204 Version This feature is available in all versions of ISA 4. Write an interface that is used by the Business Object to access a corresponding Backend Object. JSP. It is also available in the E-Service applications Extended Complaints and Returns and Remanufacturer’s Inspection. Interception of Calls to Standard Function Modules This concept allows you to intercept calls to remote callable function modules in a SAP CRM or SAP ERP system. You can use this extension concept to intercept calls To any function module called by ISA To function modules you have registered as described in chapter 'Replacing Calls to Standard Function Modules (Backend System)' on page 227. to Action or JSP) using RequestContext When a function module is executed two events are triggered: Before the function module is called After the function module has been called Within the event you have access to the RequestContext. Business Object. It is also possible that the function module will be replaced in subsequent releases. Within the event you have access to the JCO.g. Nevertheless. You can pass this data to back (e. before the function module is called. this extension concept should only be used when the function module. You can pass data to the execution listener using the RequestContext Retrieve additional data from the optional parameters.Development and Extension Guide – SAP E-Commerce 7. Backend Object). Please keep in mind. or both. A common modification is the addition of optional parameters to the interface of the function module. Retrieve data from function module if needed. which you would like to extend. JSP. after the function module has been called. when you extend these interfaces. of the following modifications: Provide additional data by using the optional parameters.Function notify after execution return JCO. This gives you the opportunity to provide/retrieve additional data from other layers of the application (Action.Function. August 2008 227 . which is called.Function notify before execution execute JCO.0 Standard ISA class BLS Connection Management CRM Customer execution listener or R/3 execute JCO. has no extension table (see 'chapter BADIs/SAP CRM Extensions' on page 211).Function Retrieve data from Request Context if needed Pass additional data to function module if needed. Pass data to Request Context if needed Figure 64: Java event listener for Standard Function Modules This concept can also be used to extend the interface of an existing function module with optional parameters and pass/retrieve additional data. that the interfaces of existing function modules can change with subsequent releases of ISA. This gives you the opportunity to provide/retrieve additional data in your optional parameters. In this case you will usually perform one. getName() You can find out if this is an event before. Version This feature is available in all versions of ISA 5.core.Development and Extension Guide – SAP E-Commerce 7.0.isa.sap.sp. Within the event handler method you have full access to the JCO.eai. If the listener wants to access sessionspecific data. or retrieve additional data after the module has been called. Write an execution event listener by implementing the com. Register the listener within WEB-INF/xcm/customer/modification/modificationconfig.jco. What to Do The following steps describe the tasks you have to perform: 1.xml. You can define for which function module the exection listener should be notified <function-module-listener> <param name=‘fmevent:NAME_OF_FUNCTION_MODULE’ value=‘ClassNameEventListener’/> </function-module-listener> Within the listener the connectionEvent(JCoConnectionEvent event) method is called when a function module is executed.getId(). 2.AFTER_JCO_FUNCTION_CALL or event. Access the RequestContext by calling event.getRequestContext() Pass your additional data to the function module before it is called.Function object. and comparing with event.0 – Examples and Tutorials’ (see [1] in chapter References on page 305). Within this method you have the follwing possibilites: o o You can find out which function module has been called by calling event. Replacing Calls to Standard Function Modules August 2008 228 .BEFORE_JCO_FUNCTION_CALL. or after.getJCoFunction(). the function call by retrieving the event id event. it has to use the backend context or the RequestContext.JCoConnectionEventListener interface. It is also available in the E-Service applications Extended Complaints and Returns and Remanufacturer’s Inspection. o o Example For an example on this modification. see ‘Extension 5: Maintain Delivery Block Indicator for ECO ERP in the ‘Development and Extension Guide: E-Comemrce 7.0 Thread Safety in Execution Listeners Please note that every listener has configuration scope! That means that you shouldn’t define instance variables within the listener if the data have to have session scope. To allow the ISA application to call your function module you have to register it in the WEBINF/xcm/customer/modification/modfication-config. instead of the standard function modules. What to Do Create an own Z_ function module having the same or an compatible interface as an function module called by the ISA standard coding (e. It is also available in the E-Service applications Extended Complaints and Returns and Remanufacturer’s Inspection. You can use this extension concept to let the application call your function modules.0 (Backend System) This concept allows you to replace calls to remote callable function modules in a SAP CRM or SAP ERP system without changing the Java coding provided. Prerequisite is that the interface of your function module is compatible with the interface of the standard function module called by ISA.Development and Extension Guide – SAP E-Commerce 7. Z_CRM_ISA_SHOP_GETLIST) August 2008 229 .xml The following diagram shows the runtime behavior of this extension concept Standard ISA class getJCoFunction BLS Connection Management Z_Function in CRM or R/3 Standard Function Check if replacement function was registered in backendobject-config. that means your function module can only provide additional parameters but you must not change/or delete parameters of the standard function module.0.g.xml return Z_Function having same or compatible interface as standard function fill import parameters and tables execute Z_function perform operations call standard perform operations return function Figure 65: Replacing calls to Standard Function Modules Version This feature is available in all versions of ISA 5. isa. please add an attribute Z_COLOR.jsp the part between <thead> and </thead> is responsible for the table headings.jsp for B2B and /b2c/catalog/ProductsB2C. shop. Both are similar. Create a resource key that has the name catalog.0 Register the function module within WEB-INF/xcm/customer/modification/modficationconfig.jsp for B2C. Go to catalog maintenance and add a list of characteristics to the catalog that contains the attribute you want to add.Development and Extension Guide – SAP E-Commerce 7. your function module will be called during runtime Example See Customer Specific Views in the Web Catalog (SAP ERP Backend and TREX) on page 235 Extension of the Web Catalog New Fields in the Web Catalog (SAP CRM Backend) Showing more attributes in the web catalog is very easy. for the color of the product. Just add the attribute in product catalog maintenance in SAP CRM and adapt the JSPs accordingly.xml <function-module-replacement> <param name=‘fm:CRM_ISA_SHOP_GETLIST’ value=‘Z_CRM_ISA_SHOP_GETLIST’/> </function-module-replacement> Instead of the standard function module. For the new attribute. we need an additional heading in the area between these. Ensure that this attribute is maintained for the products in your catalog. since no java class needs to be touched. Show Additional Attribute in Product List Only some attributes of the item are displayed in the product list. For example. Preparation Create a catalog.Z_COLOR with a value like color in your language resource file ISARessources. Launch an initial indexing run (replication) for the catalog variant.attribute.description’/></th> add the line: August 2008 230 . For this example.inc. due to space constraints. and so on in SAP CRM. otherwise you will only see an empty field in the web catalog. In ProductsISA. For this example we will use the B2B JSPs. variants.isa. The JSP responsible for the product list is /b2b/catalog/ProductsISA. after: <th><isa:translate key=‘catalog. inc. are designed in such a way that all catalog-specific attributes that have a non empty description and their names conatin a “_“ (item.getAttribute(‘OBJECT_DESCRIPTION’) %>&nbsp. category-specific and catalog-specific. an appropriate resource key has to be added to the ISAResource file(s): catalog. the items are iterated in the JSP and the data is displayed. August 2008 231 . CompareItemsB2C (for B2C) respectively.indexOf("_") != 0) are shown.Development and Extension Guide – SAP E-Commerce 7.isa. The ProductDetailsISA. Show Additional Attribute in Product Details and in Compare Products There are two types of attributes.0 <th rowspan=2 align=center> <isa:translate key=‘catalog. so we also need to put the content after the content of the description. insert the display of the content of the new attribute: <td rowspan=‘<%= noOfContractItems %>‘ align=‘center’> <%= item.Z_MyAttribute=AttributeName See also note 452751. because if contracts are displayed. </a> </td> After this.<attribute_name> are shown.jsp (for B2B). if an additional catalog specific attribute Z_MyAttribute should be displayed. By default. or all catalog-specific attributes that have a resource key corresponding to the pattern catalog. We put the heading after that of the description. The content of the description field is displayed with: <td rowspan=‘<%= noOfContractItems %>‘ align=‘center’> <a href=‘javascript:seeSingleItem('<%= item.getAttributeName().isa.isa. and the ProductDetailB2C.getItemID() %>')’ > <%= item. </td> The row span is needed in B2B.attribute. After that.getAttributeDescription() != null && item. This means. an additional row will be displayed for each contract.attribute. only the categoryspecific attributes are displayed.jsp.attribute.getAttribute(‘Z_COLOR’) %>&nbsp. CompareItemsISA.Z_COLOR’/></th> This will ensure that the heading of the column Color is displayed. Our attribute is valid for the product in general and therefore the table cell should span over these contract lines too. if necessary. In addition to the extensions described in this unit. be used as a search key. Use the JCO connection provided as call parameter to read additional information from SAP ERP.R3CatalogServerEngine.R3CatalogServerEngine. the ISARessource file has to be extended to display in ISA CRM the additional attributes in the product detail of the web catalog. The method is shipped empty and called after reading the catalog.0 Show Additional Keys for Extended Search in B2B The extended search is done with respect to catalog-specific attributes.isa. In the method additional data can be read from the SAP ERP system and added to the catalog. and to search in the catalog. and add the results to the catalog object. Loading additional Product Attributes from the SAP ERP Backend to the Memory Catalog Additional product attributes can be transferred from the SAP ERP Backend to ISA using a predefined customer exit performCustomerExitAfterCatalogRead in the class com.sap. only the OBJECT_ID and OBJECT_DESCRIPTION attributes are taken into consideration.<attribute_name> gets an input field displayed.r3.catalog. and can.R3CatalogServerEngine in with the ISA extension concept as described in ‘ Changing existing Backend Object’ on page 275.catalog. Each attribute that has a resource key corresponding to the pattern catalog.jsp to display new search keys.isa. using the memory catalog.sap. therefore.catalog. The parameters of the method are the catalog and a JCO connection to the SAP ERP system. it is very easy for bigSearch. New Fields in the Web Catalog (SAP ERP Backend and Memory Catalog) This unit describes how additional attributes can be transfered from the SAP ERP system to the ISA product catalog.backend.backend. August 2008 232 . However. Version This feature is available in all versions of ISA 5.isa.isa.backend.sap.r3. Create a new class extending com. By default.r3. Example See note 610393. See also note 482338. 3. Implement the method performCustomerExitAfterCatalogRead. the appropriate JSP has to be extended as for ISA CRM. Register your individual class instead of com.bigSearch. The following steps have to be performed: 1.0. 2.Development and Extension Guide – SAP E-Commerce 7. If the attributes should be displayed in the product list of the web catalog. the appropriate JSP has to be extended as for ISA CRM. and for searching in the catalog. If the attributes should be displayed in the product list of the web catalog.0 New Fields in the Web Catalog (SAP ERP Backend and TREX) This unit describes how additional attributes can be transferred from the SAP ERP system to the ISA product catalog. August 2008 233 . using the TREX. the ISARessource file has be extended as for ISA CRM for display the additional attributes in the product detail of the web catalog.Development and Extension Guide – SAP E-Commerce 7. In addition to the extensions described in this unit. Version This feature is available in all versions of ISA 5. Use the class builder (transaction SE24). This example only deals with item attributes: August 2008 234 . the new attributes are created on TREX. The first method defines the attribute names and specifies the attribute type.Development and Extension Guide – SAP E-Commerce 7. the second method is called for every catalog area and item to add values for the additional attributes. The following steps have to be performed: 1. 2. to create a new class named ZCL_ISA_REPLICATION_CATALOG inheriting from CL_ISA_REPLICATION_CATALOG (use the button “Define inheritance” next to the file name in the creation dialog). The methods are delivered empty in the standard class and have to be redefined in a customer class inheriting from CL_ISA_REPLICATION_CATALOG. 3. The standard implementation ISA_REPL_CAT_IMP_DEF can be used as a template. The BAdI implementation is used to return an instance of your catalog class instead of the standard class.0 Loading additional Product Attributes from the SAP ERP Backend to the TREX Additional products attributes can be transferred from the SAP ERP Backend to TREX by using the methods ATTRIBUTE_NAMES_GET and NODE_GET_ATTRIBUTE_VALUES of class CL_ISA_REPLICATION_CATALOG. The first method is used to define the names and types of the attributes on TREX. Example This example shows how to define the view attribute (see also chapter “Customer Specific Views in the Web Catalog (SAP ERP Backend and TREX)” on page 235) and an additional attribute MAT_GROUP that will contain the material group of a catalog item.0. Redefine the methods IF_ISA_REPLICATION_CATALOG~ATTRIBUTE_NAMES_GET and IF_ISA_REPLICATION_CATALOG~NODE_GET_ATTRIBUTE_VALUES. Create a new implementation for BAdI BADI_ISA_REPL_CAT. Available attribute types are: I F D S N T U (Integer) (Floating Point) (Date YYYYMMDD) (String) (Char) (Time) (UTC Date-Time) The attribute definitions must be put into the 2 separate changing parameters (tables) ITEM_ATTRIBUTES and AREA_ATTRIBUTES. After the replication using transaction ISA_CAT_REPLICATION. The usage of the new class is controlled by the BAdI BADI_ISA_REPL_CAT. See the example below for further details. for each area and each item). Furthermore. For each item. Therefore its interface contains only one parameter ATTRIBUTES with attribute assignments. item_attribute-attrname = 'VIEWS_ID'. "special attribute for views item_attribute-attrname = 'MAT_GROUP'. If more view assignments shall be made. we create one catalog view per industry sector throughout the catalog. it assigns the content of field MARA-MATKL from material master data to the attribute MAT_GROUP.e. "String APPEND item_attribute TO item_attributes. The method checks if the caller passed an area or an item. it assigns the material’s industry sector (field MARAMBRSH) to VIEWS_ID. Hence. August 2008 235 . ENDMETHOD. it’s important to increase the multi-value counter per view id. "String APPEND item_attribute TO item_attributes. See the coding comment below.0 METHOD if_isa_replication_catalog~attribute_names_get. item_attribute-attrtype = 'S'. "material group The second method is called once for each catalog node (i.Development and Extension Guide – SAP E-Commerce 7. DATA: item_attribute LIKE LINE OF item_attributes. item_attribute-attrtype = 'S'. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING error_in_catalog_api. therefore you could even skip the counter assignment. lv_attribute-multatrcnt = 1. Customer Specific Views in the Web Catalog (SAP ERP Backend and TREX) This unit describes how to get customer specific views of the product catalog with an SAP ERP backend system and the TREX catalog (see also note 696095). APPEND lv_attribute TO attributes.Development and Extension Guide – SAP E-Commerce 7. lv_mara TYPE mara. each line has to use a * different number for the multi-value counter. APPEND lv_attribute TO attributes. DATA: lv_attribute LIKE LINE OF attributes. In this example it's * only 1 value. = lv_mara-matkl. August 2008 236 . "create attribute values for the item * read material master data for the given catalog item CALL FUNCTION 'MARA_SINGLE_READ' EXPORTING matnr IMPORTING wmara EXCEPTIONS lock_on_material = 1 = lv_mara = item-material lock_system_error = 2 wrong_call not_found OTHERS IF sy-subrc <> 0.0 METHOD if_isa_replication_catalog~node_get_attribute_values. = 3 = 4 = 5. ENDIF. * build catalog views according to industry sector lv_attribute-attrname = 'VIEWS_ID'. "the multi-value counter lv_attribute-attrvalue = lv_mara-mbrsh. * assign material group to the corresponding attribute lv_attribute-attrname lv_attribute-attrvalue = 'MAT_GROUP'. ENDIF. IF NOT item IS INITIAL. * when assigning the item to more than 1 view. These attributes have to be transferred from the SAP ERP Backend to ECO via the SAP ERP function modules ISA_READ_CATALOG_COMPLETE and ISA_CUSTOMER_READ_CAT_VIEWS. with the (ECO) customer. but both have to be extended due to individual requirements.internal area number o attributes-item . Implement a new form routine to retrieve the ‘catalog view’ attributes and to fill the data to the table ATTRIBUTES.Development and Extension Guide – SAP E-Commerce 7. 4. Create a new SAP ERP function module Z_READ_CATALOG_COMPLETE by copying the standard function module ISA_READ_CATALOG_COMPLETE (see note 677320). Version This feature is available in E-Commerce 5. August 2008 237 . Create a new SAP ERP function module Z_CUSTOMER_READ_CAT_VIEWS with an interface as described in note 677319 for function module ISA_CUSTOMER_READ_CAT_VIEWS. 5. o attributes-layout . 7. Register the new SAP ERP function module instead of the standard SAP ERP function module ISA_READ_CATALOG_COMPLETE with the E-Commerce extension concept as described in Changes in Configuration on page 274. o catalog-views-string – value of ‘catalog view’ attribute 6.internal item number (if required) o attributes-name – ‘VIEWS_ID’ (fix value) o attributes-value . Neither function module retrieves any ‘catalog view’ attributes in standard. Register the new SAP ERP function module instead of the standard SAP ERP function module ISA_CUSTOMER_READ_CAT_VIEWS with the E-Commerce extension concept as described in Changes in Configuration on page 274.0 Example See note 677319 and the example in chapter “New Fields in the Web Catalog (SAP ERP Backend and TREX)” on page 232.0 Customer specific views of the product catalog are created by matching ‘catalog view’ attributes. Activate catalog views in the web shop definition.value of ‘catalog view’ attribute 3.catalog layout o attributes-area . The following steps have to be performed: 1. attached to the (ECO) product catalog area/item. 2. Implement a new form routine to retrieve the ‘catalog view’ attributes and to fill the data to the table CATALOG_VIEWS. com. Mobile Sales order. Please give your feedback (corrections. PLM. additions) about the IPC chapter to thomas. Architecture of the IPC 5.. August 2008 238 .. MM. You can find detailed descriptions in the installation documents on the SAP Service Marketplace under alias /crm-inst. ERP order.) Transaction Data (order. Since the Interactive Configuration UI uses the E-Commerce framework.. SCE and SPE engines that form the IPC “server” have their own extension mechanisms (user exits as described in notes 809820 and 870201)..Development and Extension Guide – SAP E-Commerce 7.).PP. Vehicle Manager .) Display configuration UI HTTP Server Customer Data Order Data Product Catalog SAP CRM System Product Master . The main focus of this chapter is with regards to the IPC is on the Interactive Configuration user interface.machts@sap. it also supports the modification concepts of the framework. The following unit introduces some modification concepts related to the IPC user interface as part of the ECommerce web applications (b2b and b2c) or as a separate web application (ipc) which is used in SAP scenarios (Interactive configuration in CRM Order.0 UI in CRM Order Scenario This unit gives an introduction to the IPC UI concepts. pricing Optional: No SAP R/3 backend (data maintainance including pricing and configuration data in SAP CRM) IPC IPC Client Objects API Figure 66 The IPC and its UI in the CRM Online Landscape The picture above shows the setup and communication of the IPC web application (above: SAP CRM order scenario). HTML control SAP R/3 Backoffice Systems (SD. The section below explains additions and differences to the E-Commerce extension concept..0 Extensions of the IPC The IPC (Internet Pricing And Configurator) is a reusable component for pricing and interactive configuration.. The interactive configuration user interface is a web application based on the E-Commerce application framework. It consists of the pricing engine (SPE) the sales configuration engine (SCE) and the interactive configuration user interface.maintain configuration models Get and Modify configuration state SAP J2EE Engine Java Server Pages UI Beans Struts Actions R/3 Plug-In Master Data (products.. knowledge bases. SCE and SPE are components of the SAP application server. The UI communicates with the IPC over a string based socket protocol (as in 4. the IPC reads master data directly from the SAP CRM or ERP server.0 In summary: There is a clear separation between the IPC engines as part of the CRM or ERP system and the IPC Web Application. Mobile Sales: The IPC is a process running on the mobile client. As of release 5. The IPC comes with the CRM or ERP and exchanges data with its client applications via RFC. CRM online.0). The former dataloader is not required anymore. The UI communicates with the IPC over remote function calls 2. ISA ERP). ERP: The IPC “lives” inside of the SAP application server. the interactive configuration (JSP) UI uses an abstraction layer (Client Object API) very similar to the ISA Business Object/Backend Object APIs with Java methods. Design of the JSP Web Application: The IPC UI uses the ISA Framework (Layout. The “server” part depends on the scenario in which the UI is used 1. The UI part (JSP.Development and Extension Guide – SAP E-Commerce 7. In all scenarios (including ISA CRM.0 the IPC is not a separate server anymore. Tags. XCM. ERP MSA IPC Server SPE/SCE Integration Pricing Engine Configurator Mobile Sales Figure 67 IPC Architecture more in detail The above slide shows the layered architecture of the IPC. CRM online. Actions. Client Object Layer Interface. Vehicle Management System. JSP Pages Actions UIBeans Client Object Layer Interface Remote Function Call TCP/IP UIClasses Virtual Machine Container SPE/SCE Integration Pricing Engine Configurator Internet Sales. Backend communication. …) on top of the graphic is the same in all scenarios. Instead of directly calling RFC function modules. ISA. …) The IPC UI does not use html frames The Javascript is separated into script files Action Forms are not used August 2008 239 . VMS. which is the JSP UI used for interactive product configuration and runs on the SAP J2EE Engine. August 2008 240 . ipc). UI Components The XCM file /sap/modification/ipclayout-config. for more details. UI Layouts The XCM file /sap/modification/layout-config. For detailed explanation of the E-Commerce Layout Framework refer to chapter Error! Reference source not found. creates the html according to the layout and sends the response Use of the E-Commerce Layout Framework The interactive product configuration user interface takes advantage of the E-Commerce Layout Framework.xml defines the UI Components that are common for SAP’s standard applications that include the interactive configuration ui (b2b. Data display actions: Reads the current state of the configuration.0 Action Flow Data Processing Data Display Post redirect Get Action: setCharacteristicValues Forward to displayLayout Action(s): displayLayout Figure 68 General Action Flow The slide shows the general action flow in the 5.Development and Extension Guide – SAP E-Commerce 7.0 UI (same as in E-Commerce applications). Data processing actions: Receives user input via http post request and changes the state of the configuration 2. b2c. The common UI components of the interactive configuration ui together with the UI components of the standard application form these layouts.xml defines the layouts of the application. We can divide the action flow into two blocks: 1. Development and Extension Guide – SAP E-Commerce 7. Technical background of this separation between layout-config and ipclayout-config is that UI components from ipclayout-config can be reused. Theses UI areas are filled with UI components at runtime. Figure 70 UI areas of the config UI August 2008 241 . UI Areas The picture below shows the partitioning of the interactive configuration UI in different UI Areas.0 Figure 69 Example for layout with UI components from both files (layout-config and ipclayout-config) The XCM file /sap/modification/layout-config.xml so that at runtime both files form one XCM file.xml includes /sap/modification/ipclayout-config. Tiles carry content. The work area for example lists a variable number of characteristics that may differ in their presentation to the user. You’ll find layouts in software component SAP-SHRWEB in development component crm/ipc/web/ipcshared in folder ipc/layouts.Development and Extension Guide – SAP E-Commerce 7. The picture below demonstrates how layout and tiles are combined. The layout JSP page is very simple and holds only a table in which the tiles are included. Figure 71 Example for tiles The interactive configuration UI uses tiles mainly for rendering of characteristic values. the UI combines tiles with low level layouts. Low level layouts In order to reuse tiles. the interactive configuration UI introduces the concept of “tiles”. Low level layout pages carry only layout information. You’ll find tiles in software component SAP-SHRWEB in development component crm/ipc/web/ipcshared in folder ipc/tiles. In order to support modifications on such a fine-grained level of UI parts. Tiles are low level UI parts included by UI Components. This low level layout technique is different from the UILayouts of the E-Commerce Framework.0 Tiles The layout of the interactive configuration is highly dynamic. August 2008 242 . The application does this with a XCM customizing table lookup in file jspinclude-config.Development and Extension Guide – SAP E-Commerce 7.0 Figure 72 Combining low level layout and tiles Dynamic Includes The application calculates at runtime which layouts to combine with which tiles.xml for each request before sending the response back to the users browser. August 2008 243 . Layouts and tiles carry keys that the application replaces at runtime by the physical file path of the JSP page for the layout or tile. GroupUIBean charGroup. They make sure that the parameters passed to the included page do not interfere with parameters used by other included pages. You’ll find UIClasses in software component SAP-SHRJAV in development component crm/ipc/ipc in folder com/sap/isa/ipc/ui/jsp/uiclass. The Interactive Configuration UI performs dynamic includes using static methods (“include”) of UIClasses.Development and Extension Guide – SAP E-Commerce 7. You will find an example for this technique in Change UI Components. public static void include( PageContext pageContext.0 Figure 73 JSP Key and Path The indirection -> key -> XCM table lookup -> physical path gives application programmers the possibility to easily replace SAP’s standard JSP pages by their own pages in xcm/customer/modification/jspinclude-config. Hashtable customerParams) { August 2008 244 . String characteristicController. UIContext uiContext. CharacteristicUIBean cstic. UIArea uiArea. InstanceUIBean instance. The include methods offer a typesafe api to the page.xml. getUiArea(). Hashtable customerParams = includeParams.IncludeParams includeParams = CharacteristicUI. August 2008 245 . The parameter stack ensures that getIncludeParams retrieves those parameter that are passed with the last include method. UIBeans UIBeans form an intermediate layer between the JSP pages and the Business objects (IPC client object layer). You may pass parameter between jsp pages only via the session or request context. All IncludeParams objects have a method getCustomerParams() that returns a Hashtable.getCustomerParams().getInstance().Development and Extension Guide – SAP E-Commerce 7.0 The included page retrieves the parameters by the following call: CharacteristicUI. CharacteristicUIBean characteristicUIBean = includeParams. the dynamic includes with UIClasses used in the interactive product configuration offer a possibility to pass extension data to JSP pages.getCstic(). UIContext uiContext = includeParams. GroupUIBean characteristicGroup = includeParams. The interactive configuration UI consists of recursively nested JSP pages. InstanceUIBean currentInstance = includeParams. All include methods of UIClasses offer a customerParams parameter. Methods of UI Beans are optimized for use within the JSP pages and reduce the complexity of the JSP pages.getCharGroup().getIpcBaseUI(). UIArea csticsArea = includeParams. That means on the top of each included page you need to call getIncludeParams(pageContext). Include parameter are supposed to be valid only for the current include method and not visible for all the included pages. Extension To Transfer Data To JSP In addition to the standard ways to transfer data to JSP pages described in this document.getIncludeParams(pageContext). August 2008 246 . Please see Figure 67 IPC Architecture more in detail. applies also to the Interactive Configuration User Interface.0 Figure 74 Interaction of UIBeans with the JSP pages and the Busines Object Layer Client Object Layer The IPC client object layer is the business object layer and the backend layer of the IPC.Development and Extension Guide – SAP E-Commerce 7. Finding The Appropriate Extension Concept For IPC The chapter Error! Reference source not found. Specific concepts are described in this chapter. It performs communication with the IPC in the backend via RFC function calls or Socket commands (Mobile Sales). It performs caching and provides convenient Java API’s to its calling applications. xml. you will need to 1. IPC shared styles are located in software component SAP-SHRWEB development component crm/ipc/web/ipcshared/ folder ipc/mimes/style/stylesheet. Change SAP’s standard style definitions in your own stylesheet or add new styles for your own JSP pages. Shared styles means those styles are common to b2b. b2c.Development and Extension Guide – SAP E-Commerce 7. You will find an example on how to do this in /xcm/customer/modification/initconfig.0 Static extension to UI layer Changing Stylesheets In order to define your own styles to change the appearance of the application. and ipc web applications.xml. 3.css. Register your own stylesheet in /xcm/customer/modification/init-config. Create your own stylesheet file as a copy of SAP’s standard stylesheet 2. August 2008 247 . The parameter target allows the three values for html hyperlink targets: _self. Change UI Components Example: Customer Buttons and Actions The interactive configuration UI gives you the possibility to add three customer buttons to the header area without modification to the UI component header. top. UIComponents are located in /sap/modification/ipclayoutconfig.Development and Extension Guide – SAP E-Commerce 7. _parent. Figure 75 XCM settings for customer buttons The parameter forward is not supported in SAP’s standard UI. In order to do this you need to define those customer buttons in the xcm customizing under components customerbutton1 to customerbutton3. August 2008 248 .xml. By default the result will be displayed in the same frame as the interactive configuration UI.0 Create New Layout Or Change Standard Layout The only thing that differs here from the E-Commerce framework is the location of UIComponents for the interactive configuration UI. SAP provides three placeholder for customer button labels: ipc.0 Figure 76 Customer buttons on screen In order to display language dependend labels for the customer buttons you need to provide the appropriate label for the session language in the language dependent resource files. … (see: Change/add text in the text property file (language dependent!)) The customer buttons call the actions that you have defined in the parameter customerbutton1. August 2008 249 . SAP provides three placeholders for action mappings /ipc/customerButtonXAction in the ipcconfig.customer_button1_label. Example: Adding Customer Tab To Multifunctional Area The interactive configuration UI gives you the possibility to add a customer specific tab to the multifunctional area (area on the right side of the standard interactive configuration UI).xml.Development and Extension Guide – SAP E-Commerce 7.action. August 2008 250 .0 Figure 77 Component configuration for customer tab You activate this area when setting the parameter “customertab.show” of the XCM component multifunctional area to “T”.Development and Extension Guide – SAP E-Commerce 7. jsp page or change the action mapping to use your own action and forward to your own JSP page. August 2008 251 .customer.ipc.ui.Development and Extension Guide – SAP E-Commerce 7. The customer tab will be active.GetCustomerTabAction. This action will display the page /ipc/customer/components/customerTab. The example delivered by SAP displays the characteristic details in the customerTab.jsp in the multifunctional area. by default the system will execute the action com.jsp.jsp.action.0 Figure 78 Application configuration for customer tab Figure 79 Customer tab action mapping When you click on the customer tab.isa. You may either change the content of the action and the customerTab. /xcm/customer/modification/jspinclude-config.Development and Extension Guide – SAP E-Commerce 7. you may want to display the name of the characteristic and its values in one line to save vertical space. August 2008 252 . development component crm/ipc/web/ipcshared.0 Figure 80 Customer tab with characteristic details Example: Display Characteristic Header And Values In One Line Depending on the space on screen and your configuration model (length of characteristic names and values).xml shows an example how to include this modified page instead of the SAP standard page. Software component SAP-SHRWEB.jsp shows the modified JSP page. folder ipc/customer/tiles/characteristic. sap.customer. August 2008 253 .ui. You may register your own UIBeanFactory in /xcm/customer/modification/factory-config.sap.ui. A good example is the method determineLayout() in com.xml.isa.ipc.beans. Perform complex calculations in methods that are relevant for the way you display data but not the business data itself.1 allows the definition of multiple config-files.beans.ipc. interval domain.jsp. The UIBean passes the data through. You extended the business object layer (IPC client object layer) and want to display additional data from the business object layer in the JSP pages. This calculation is neither business logic nor should the calculation been done on the jsp page.ui.isa. SAP introduced a new /customer/ipcconfig.ipc.isa. I recommend extensions to the UIBean layer if you want to: 1.0 Extensions To The UIBean Layer The interactive configuration creates UIBeans using a generic factory that you may subclass and replace SAP’s standard UIBean factory. This method calculates the characteristic layout to be used from a number of characteristic attributes (multi value. 2.jsp.CharacteristicUIBean.xml file. Figure 81 Creating UIBeans via UIBeanFactory The customer UIBean factory in the example creates an object of type com. Extensions In The Action Layer Since struts 2. …). The file contains an example for registering a customer UIBeanFactory.ValueUIBean which in turn is a subclass of com.jsp.Development and Extension Guide – SAP E-Commerce 7.beans.ValueUIBean and overwrites the getLanguageDependentName method. modify or remove the data in the http request attributes. Figure 82 Standard customer exit in actions The shown standard customer exit is called at the end of every IPC action.ipc. the userSessionData or mbom. The action mapping for Z_SetCharacteristicValues. August 2008 254 . The NWDI will support merges of SAP’s corrections and your changes of those files.jsp. The example how to change the action flow is in ipc-config.xml.0 Customers may place their own action mappings there. In this tile he adds a hyperlink that requests Z_SetCharacteristicValues.do. those changes in /Web-inf/ipc-config. This action implements a customerExit that shows all instance nodes of the instance tree expanded.Development and Extension Guide – SAP E-Commerce 7. It allows customers to read request parameter from request or requestParser and add.xml In cases where the customers wants not only to add additional action flow.isa.GetInstancesAction. but to change the action flow delivered from SAP.action.xml will be supported by the Netweaver Development Infrastructure.do can be done in /customer/ipcconfig.ui. Example: The customer replaces a tile in the application. You will find an example for an extension in the action layer in com.customer. Use the method of your customer object in the corresponding UIBean or any action (in the example CustomerConfigUIBean) You may also use IPC client objects as container for extension data.ipc.jsp. you may call other RFC enabled systems as well. but also by the E-Commerce catalog and the E-Commerce b2c shopping basket for price determination and interactive configuration . You would typically use these methods in actions in order to transport your data to JSP pages. The client object layer provides you analog to the E-Commerce backend layer with connection objects to backend systems. Implement the factory method for the client object that you want to modify (in the example newConfiguration) 3. getExtensionData() and removeExtensionData(). The IPC Client object layer is not only used by the interactive configuration UI.customer. Subclass the client object that you want to modify (in the example RfcDefaultConfiguration) 5.xml contains an example how to register a customer IPCClientObjectFactory. The example CustomerIPCClientObjectFactory overwrites the factory method newConfiguration.getBusinessObject(). Register your CustomerClientFactory in the customer/modification/factoryconfig.getExtensionData(). Using these connections you may call virtually all remote function modules in the backend system. The example shows a complete extension through different layers of the UI.Development and Extension Guide – SAP E-Commerce 7.isa.ui. You may acess these data on JSP pages with UIBean. The customer IPCClientObjectFactory should be a subclass of SAP’s standard IPCClientObjectFactory so that you need to overwrite only those factory methods (newXXX) that create customer client objects.beans.client.xml 4. The private method callATPCheck shows you how you would call remote functions from your customer client objects. Subclass the IPCClientObjectFactory (in the example) CustomerClientObjectFactory 2. Overwrite the methods that you want to change or add new methods (in the example CustomerDefaultConfiguration. calling additional function modules or you need to extend the client object layer. August 2008 255 .checkAvailability 6.CustomerConfigUIBean in method “getAvailabilityImage()” which in turn is used by ipc/customer/tiles/statusbarWithAvailibilityCheck.jsp.customer. As with UI Beans.0 Create Customer Backend Object To get additional data from a backend system and to use these data in the interactive configuration UI or in conjunction with IPC pricing functions you would need to either use the E-Commerce extension framework techniques like function call interception. Analog to the UIBeans you may register your own IPCClientObjectFactory in /xcm/customer/modification/factory-config. The client object class com. The file factoryconfig. Client objects inherit from BOBase and provide the methods addExtensionData(…). This method is then used by com.CustomerDefaultConfiguration introduces a new method “checkAvailibility()”.object. You are not limited to IPC function modules.xml. a factory creates the client objects. Here as summary a step by step description how to extend the client object layer by subclassing: 1. Defining your own connections in XCM. 0 – Examples and Tutorials’ (see [1] in chapter References on page 305).Development and Extension Guide – SAP E-Commerce 7. Those user functions are independent of the interactive configuration UI and therefore not subject of this guide. Exchange additional data with ECO Standard E-Commerce backend objects used by ECO CRM or ECO ERP provide different customer exits to exchange additional data between E-Commerce and the IPC for pricing. August 2008 256 . Examples see ’Extending Existing Backend Objects’ in the ‘Development and Extension Guide: E-Comemrce 7.0 Figure 83 Handling extension data at client objects SCE user functions Please refer to note 870201 for information on SCE user functions. For details see Standard Backend Objects providing User Exits on page 204. configuration or creating the IPC basket (only ECO CRM). if a document is opened. Additionally. if the user presses refresh on the browser? To solve these problems we have introduced an object. For example. the DocumentHandler. and technically with corresponding objects in the business layer). and a document you cannot edit. This complex constellation raises some questions: Which document should be displayed. if the catalog is closed? What should be displayed. A corresponding tab strip is displayed in the documents frame.Development and Extension Guide – SAP E-Commerce 7. an document you can edit. a catalog page can be displayed. it will be displayed in the form_input frame. documents Displays the tab strips of the documents. Often these frames must be updated together. _history Displays a list (history) of the last used documents. The UpdateDocumentView module is responsible for representing the following frames: form_input This is the working area. and the document must be set at the beginning of the history. Implementation The diagram shows the main objects of the UpdateDocumentView module: August 2008 257 . Together with some other objects and actions they form the UpdateDocumentView module. which knows the status of the graphical user interface (GUI). if a document is closed? What should be displayed.0 Extensions of the Document Handling This unit describes the UpdateDocumentView Module used to manage the behavior of the user interface with respect to the display of documents. The documents and the catalog are displayed here. Overview In the B2B application you can have up to two active documents (documents having a tab strip in the documents frame. without modifying the UpdateDocumentView module. and the _history frame.0 Figure 84: Main objects of the UpdateDocumentView module The DocumentHandler stores the status of the GUI for the documents and the catalog. it is generic. You can add new types of documents in the business layer. a reference to the Basket. for example. The DocumentHandler manages ManagedDocuments. a document.Development and Extension Guide – SAP E-Commerce 7. a ManagedDocument holds a reference to the corresponding business object. the JSPs which display the tab strips and the history need additional information. For this. There is only one DocumentHandler object for every session. it must return a string for the forward mapping. The UpdateDocumentViewAction is responsible for updating the form_input. This information is stored in a ManagedDocument object. For every active document (document with a tab strip). The diagram shows the activities of the isaPerform() method of the UpdateDocumentViewAction. or a default page must be displayed. August 2008 258 . It is stored in the session context. for example the text which is displayed on the tab strip and in the history. It knows if the catalog. the documents. Since it is an Action. Additionally. Because of this.Development and Extension Guide – SAP E-Commerce 7. (ISA B2B).. each document type needs its own refresher JSP. The necessary Actions and JSPs are coded in the refresher JSP. The file name of a Refresher JSP always has the prefix refresher_. A Refresher JSP loads with JavaScript functions the documents.>). _history. August 2008 259 .. Example This example shows the creation of a new order. and form_input frame.xml (see <action path=‘/b2b/updatedocumentview’ .0 Figure 85: Activities of the isaPerform() method of the UpdateDocumentViewAction The forward strings of the UpdateDocumentViewAction are mapped to special JSPs (Refresher JSPs) in the file config. and creates a new ManagedDocument for the basket.0 Figure 86: Creation of a new order. The CreateBasketAction is called. August 2008 260 . It performs certain preparation actions.Development and Extension Guide – SAP E-Commerce 7. (ISA B2B) The user enters the welcome page and selects Create a new basket. creates a new Basket object. error handling. for example. jsp will display it.jsp should be loaded. It asks the DocumentHandler what should be displayed and gets the ManagedDocument for the basket. while the display phase is passed more than once. and UpdateHistoryAction to update the _history frame. The ShowBasketAction reads all necessary information from the Basket object and puts it in the request context. For a specific document.jsp calls the ShowBasketAction for the positions frame. The frameset_order. This frame displays header information and all positions of the basket. The frameset_order. The prepare phase is passed if a new document is created or opened. Finally. This should be performed in every refresher JSP.jsp calls WorkAreaNavAction to update the documents frame (tab strips). The display phase is passed if the document is displayed.jsp also loads the details and the closer_details frame. Figure 87: Display a new Document type with the UpdateDocumentView Module August 2008 261 . prepare and display. It reads from the ManagedDocument that refresh_basket. it loads the frameset_order. This is document-specific.0 UpdateDocumentViewAction is called. The refresh_basket. for example if the user selects the browser refresh-button.jsp into the form_input frame.Development and Extension Guide – SAP E-Commerce 7. Integrating own documents There are two phases which must be considered when integrating new documents. normally the prepare phase is passed only once. The order. refName refNumber and refName are the number and name which can be assigned by the customer for the document. for example. or use an available business object. They are not displayed. String docNumber docNumber is a unique string. The document type is displayed on the tab strip for the document and in the history list. refNumber and refName may be null. In this case. refresh_newdoc. Creating a ManagedDocument A ManagedDocument is created by calling its constructor with the following parameters: DocumentState doc Reference to the corresponding business object. by asking the BOM for it.jsp. for example. It is displayed on the tab strip for the document and in the history list.Development and Extension Guide – SAP E-Commerce 7. newdoc. and twodocnav. 4.docnav.jsp will be described below. 2. Only PrepareNewDocAction and refresh_newdoc. If forward is null then the DocumentHandler will directly hand over the ManagedDocument to the history list. onedocnav. String refNumber. Must hand over this object to the DocumentHandler.because the other actions are not relevant for the UpdateDocumentView module. It is not managed by the DocumentHandler and so it will not be displayed.xml a path must be assigned for this string. This means you have a way of adding entries to the history without displaying it.jsp. You have to add an entry in your project specific XLF file (see chapter “Changing language dependand resource keys” for more details).jsp). PrepareNewDocAction The action for the prepare phase (PrepareNewDocAction): Must create a new. the following steps are necessary: 1.. DisplayNewDocAction. often the date when the document is created. String forward This string is used by UpdateDocumentViewAction for the forward mapping. With some small modifications on the JSP they can be displayed. It is displayed on the tab strip for the document and in the history list. Write a JSP which displays the new document. In the file config. String docDate docDate is a date. onedocnav. PrepareNewDocAction.jsp. 3. automatically assigned by the backend for every document. August 2008 262 . docType is part of the key for the translate tag (see its usage in history.0 When integrating a new document.jsp. quotation. Write the refresher JSP. order. It is not translated and it may be null. then the value of b2b. Write an Action for the display phase. and twodocnav.jsp. In this case. This object must implement the interface DocumentState.jsp. If docNumber is equal to ‘new’. docNumber may be null. String docType Type of the document..jsp.>. Since this string is language-dependent. In this case. The corresponding tag is <action path=‘/b2b/updatedocumentview’ . Must create a new ManagedDocument object.new from your project specific XLF file (see chapter “Changing language dependand resource keys” for more details) is displayed instead. but are put in the request context for history. In this case. Write an action for the prepare phase. contract. Development and Extension Guide – SAP E-Commerce 7.0 String href, hrefParameter These strings are used by history.jsp. Every entry in the history is a link to a document. With href and hrefParameter the anchor of the link is built, href+’?’+hrefParameter. The result must be the action with the parameters for displaying the wanted document. If href is null, the document is not added to the history. So there is a way for displaying documents without adding themto the history. If hrefParameter is null, then no '?' is generated behind href. Example The business object is orderStatusDetail. (See JavaDoc for DocumentHandler, DocumentState and ManagedDocument.) Get the DocumentHandler object from the session context. DocumentHandler documentHandler = (DocumentHandler)userSessionData.getAttribute(SessionConst.DOCUMENT_HANDLER); String href_action = ‘b2b/documentstatusdetailprepare.do’; String href_parameter = (‘techkey=‘.concat(documentKey.getIdAsString())).concat(‘&’); The state of the document is set. It must be DocumentState.VIEW_DOCUMENT or DocumentState.TARGET_DOCUMENT. If the state is not set to one of these, then the document cannot be added to the DocumentHandler. orderStatusDetail.setState(DocumentState.VIEW_DOCUMENT); The ManagedDocument is created. ManagedDocument mDoc = new ManagedDocument(orderStatusDetail, headerSalesDoc.getDocumentType(), headerSalesDoc.getSalesDocNumber(), headerSalesDoc.getPurchaseOrderExt(), headerSalesDoc.getDescription(), headerSalesDoc.getChangedAt(), ‘order_status’, href_action, href_parameter); The ManagedDocument is handed over to the DocumentHandler. documentHandler.add(mDoc); The DocumentHandler is told, that the document orderStatusDetail (the corresponding business object to the new ManagedDocument) should be on top of th other document. But this does not remove the catalog if it is displayed. To remove the catalog, youmust add the additional line: documentHandler.setCatalogOnTop(false); documentHandler.setOnTop(orderStatusDetail); August 2008 263 Development and Extension Guide – SAP E-Commerce 7.0 PrepareNewDocAction The refresh JSP loads the documents frame, which displays the tab strips of the documents, the _history frame, which displays the history list, and the form_input frame, which displays the document. The JSP should contain the following lines: <head> <script src=‘<%=WebUtil.getMimeURL(pageContext, ‘b2b/jscript/frames.js’) %>‘ type=‘text/javascript’> </script> <script type=‘text/javascript’> <% if (!refresh) { %> documents().location.href = '<isa:webappsURL name=‘/b2b/updateworkareanav.do’/>'; getHistoryFrame().location.href='<isa:webappsURL name=‘/b2b/updatehistory.do’/>'; <% } %> form_input().location.href = '<isa:webappsURL name=‘/b2b/displaynewdoc.do’/>'; </script> </head> In the first script block, the JavaScript frames.js is loaded. It provides, amongst others, the functions: documents(), which returns the address of the documents frame. getHistoryFrame(), which returns the address of the _history frame. form_input(), which returns the address of the form_input frame. In the second script block, the frames are loaded. In the bold faced line, the form_input frame is loaded. It loads the action, which is mapped to the path /b2b/displaynewdoc in the file config.xml. In this example it should be the action DisplayNewDocAction. If your document consists of a frameset with several JSPs, the frameset must be loaded. We recommend you copy an existing refresh JSP, for example, refresh_basket.jsp, and that you change this line only. The other frames are only loaded if the user has not pushed the browser refresh button (in this case the flow is different). They load the WorkareaNavAction and the UpdateHistoryAction, which are configured in config.xml. August 2008 264 Development and Extension Guide – SAP E-Commerce 7.0 Structure of the Internet Sales application Before an Internet Sales application can be extended it is necessary to know how it is structured. This unit gives an overview of the structure of the application. After reading this unit you should be able to identify the location of the major components of the Internet Sales application. Enterprise Application Archive (ear file) The Internet Sales application is delivered as an Enterprise Application Archive (EAR). An EAR is a JAR (zip) file containing all components of an enterprise application. The most important part of the EAR file is the Internet Sales web archive (WAR) file. Web Archive (war file) The web archive file is a JAR (zip) file containing all parts of the Internet Sales application. The following table gives an overview of the content of the archive. Directory within the war file auction b2b catalog ecall ipc Meta-inf mimes etc. Admin Description User interface components (for example, JSPs, Mimes, …). The folder names are Internet Sales application specific. JSPs of Internet Sales administration pages and the XCM Administrator tool. Every Internet Sales application (e.g. B2B, B2C, etc.) has this folder. WEB-INF WEB-INF\cfg WEB-INF\cfg\cic WEB-INF\classes WEB-INF\doc Access to the administration pages must be restricted. See note 646140 for further information . Contains configuration files not accessible using HTTP. SAP Internet Sales application specific configuration files (e.g. logging, catalog). Customer Interaction Center (CIC) specific settings for the SAP Internet Sales application. Internet Sales resource files contain language dependent texts used within the application. Legal statements regarding the usage of third party products. Application version information (Version.txt). WEB-INF\lib WEB-INF\tlds SAP Internet Sales application specific libraries (e.g. Struts, core.jar, …). Descriptors for custom JSP tags. Table 60: Overview of the content of the web archive August 2008 265 Development and Extension Guide – SAP E-Commerce 7.0 Directory within the war file WEB-INF\xcm WEB-INF\xcm\sap WEB-INF\xcm\customer WEBINF\xcm\customer\conf iguration Description Configuration files managed by the Extended Configuration Management (XCM). These configuration files contain default application configuration and must not be changed by the customer. These configuration files are used to adjust the default applicationconfiguration to customer needs. This folder contains configuration files used for common configuration settings. These settings are done using the XCM Administrator. Files in this folder should never be changed manually, only using XCM Administrator. WEBIND\xcm\customer\modi fication The files in this folder usually do not contain the actual settings. The files in this folder are copied to a folder placed outside the SAP J2EE Engine installation directory during initial deployment. This folder contains files used to change less common settings. These files are usually touched when extending functions of the web application. SAP delivered default settings are changed manually using XCM extension mechanism. Table 61: Overview of the content of the web archive Configuration files The following table gives an overview of the most important configuration files and their location within the web archive. Folder WEB-INF\web.xml Description Deployment descriptor of Web application. Most settings in this file are related to the Servlet Runtime: Session timeout Declaration of custom tags WEB-INF\config.xml In contrast to previous versions of Internet Sales, there are only a few application related parameters in this file. Most of the application specific parameters are managed by XCM. Configuration of the Struts Interaction Layer. This file should be modified if you perform changes in the process flow of the application. WEBINF\xcm\customer\modi fication\bomconfig.xml The settings in this file are related to the Business Object Layer. This file should be modified if you want to use your own custom Business Object Manager. Table 62:Overview of configuration files August 2008 266 Development and Extension Guide – SAP E-Commerce 7.0 Folder WEBINF\xcm\customer\modi fication\eaiconfig.xml WEBINF\xcm\customer\modi fication\initconfig.xml Description Central file for configuration of the BLS layer. You usually do not change this file. You only need to change it if you are using JCo function execution cache. See chapter 'JCo Function Cache' on page 87 This file defines a set of handlers called during the initialization of the application. You make settings in this file if you want to add your own initialization handler or to change settings in the available initialization handlers. See chapter 'Initialization Handler' on page 132 WEBINF\xcm\customer\modi fication\cacheconfig.xml WEBINF\xcm\customer\modi fication\ modificationconfig.xml Configuration for application caches. You can change settings of existing caches or register your own caches. See chapter 'All purpose Cache' on page 131 File used to register function module execution listeners, turning on ABAP debugging, enabling JCo function tracing and register custom function modules See chapter 'Interception of Calls to Standard Function Modules' on page 225 See chapter 'ABAP Debugging' on page 166 See chapter 'Tracing Function Modules' on page 293 See chapter 'Replacing Calls to Standard Function Modules (Backend System)' on page 227 WEB-INF\cfg\logconfig.properties Starting from ISA SP07 this file replaces the previously used logconfig.xml configuration file. The settings in this file configure the logging and tracing capabilities of the ISA application. You make changes in this file if you want to change the logging/tracing settings. TODO: See chapter ‘Generic Search Framework’ on page 101. Table 63:Overview of configuration files August 2008 267 Development and Extension Guide – SAP E-Commerce 7.0 Source Code General Package Structure of an E-Commerce application The following table shows the general ideas behind the package structure of E-Commerce. Package structure com.sap.isa .<NameApplication> .<NameApplication>.action .<NameApplication>.actionform .businessobject.user .businessobject.basket .businessobject.order .backend.crm .backend.r3 .backend.ipc .core .isacore Comment Root for all classes in the ISA application. Subproject, for example catalog, cic, eauction. Struts Actions. Struts actionsforms. Packages for business objects. Packages for backend-specific implementation of the business objects. Core ISA functionality (no application logic). Core application logic functionality. Table 64: Overview of the package structure of E-Commerce August 2008 268 jsp Table 65: Naming conventions for JSPs Changes in config.sap.0 Conventions when Enhancing the E-Commerce Application The following chapter gives recommended conventions for enhancing the E-Commerce application.xml (or other Struts configuration files) The following conventions apply when the predefined flow of Actions is interfered. Java-side business logic of Internet Sales is located in the com. The following example shows how this is done. For example. The original flow looks as follows: Figure 88: Original flow of actions August 2008 269 . If the name of the customer is ACME. Java Server Pages The following table gives you information about some naming conventions recommended when working with JSPs.businesobject package. The following unit gives you information on recommended conventions for customer extensions.Development and Extension Guide – SAP E-Commerce 7.businessobject package. Separation of SAP-Software / Customer Extensions It is necessary to strictly distinguish between the components delivered by SAP and extensions made by the customer. Changes can only be made by integrating new Java code into the existing application framework.isa. Naming Conventions All extensions made by the customer should follow naming conventions that are described in the following units.isa. Type of Modification All additional elements in JSP (for example: input field) Naming convention z_<name> or Z_<Name> Example: z_extendedBasketHeaderInc Adding a customer written JSP z_<name>.acme.jsp of JSP or Z_<name>. Application logic extensions should be placed in customer-specific Java packages. the customer should place his business objects in the com. xml for this process flow is as follows: <action path=‘/firstaction’ type=‘com.sap.isa.sap.SecondAction’> <forward name=‘success’ path=‘/thirdaction.SecondAction’> <forward name=‘success’ path=‘/thirdaction.action.action.action.custom action --> <action path=‘/secondaction’ type=‘com.isa.acme.do’/> </action> <action path=‘/secondaction’ type=‘com.sap.action.do’/> </action> <!-.FirstAction’> <forward name=‘success’ path=‘/secondaction.Development and Extension Guide – SAP E-Commerce 7.do’/> </action> Example: This process flow is interfered by introducing a customer written CustomAction. Figure 89: Changed flow of actions <action path=‘/firstaction’ type=‘com.do’/> </action> <!-.original path modified --> <action path=‘/Z_secondaction’ type=‘com.isa.isa.do’/> </action> August 2008 270 .0 The config.Z_CustomAction’> <forward name=‘success’ path=‘/Z_secondaction.isa.FirstAction’> <forward name=‘success’ path=‘/secondaction.action.sap. BackendAware { public static final String CUSTOM_BOM = ‘Z_CUSTOM-BOM’. When Z_CustomAction has finished.Development and Extension Guide – SAP E-Commerce 7. The naming convention for the original path is: Z_<name of original path> If you have a chain of custom Actions (more than one).xml When you write a Business Object Manager you have to register it in the bom-config. Since the original path /secondaction. When you name your Business Objects Managers please use the following naming convention: Type of Extension Name of Business Object Manager in bom-config. /Z_2_thirdaction. It works well when original flow is intercepted by multiple custom Actions.do is used to route the flow to Z_CustomAction. example: public class Z_CustomBusinessObjectManager extends BusinessObjectManagerBase implements BOManager.xml Naming Convention Z_<name>-BOM example: Z_CUSTOM-BOM Accessing name of new Business Object Manager from an Action Place a constant containing the above name in the class of the new BOM.0 The original path /secondaction.do is used by Z_CustomAction. of original path> Some Actions are triggered by JSPs (e. Changes in bom-config. Table 66: Naming conventions for Business Object Managers August 2008 271 .g frame-sets) but it is not recommended to change JSPs in order to call custom Actions. /Z_3_fourthaction The advantages of this naming convention are Customer changes are easily distinguished. the path of SecondAction has to be changed.xml file. use the following naming convention: Z_<number starting with 2>_<name Example: /Z_secondaction.xml file only. the flow continues with SecondAction. For interfering the process it is recommended to limit changes to the config. ..businessobject.getSession()). getBOM(Z_CustomBusinessObjectManager. BackendAware { public static final String CUSTOM_BOM = ‘Z_CUSTOM-BOM’. // get user session data object UserSessionData userSessionData = UserSessionData. .acme.0 Example The following example shows how these naming conventions work together: Entry in bom-config. August 2008 272 .xml: <BusinessObjectManager name=‘Z_CUSTOM-BOM’ className=‘com. Please only use the source code for information purposes and for debugging. Modifications in the delivered E-Commerce source code are not allowed. // gettting custom BOM Z_CustomBusinessObjectManager myBOM = (Z_CustomBusinessObjectManager)userSessionData.getUserSessionData(request.isa.Z_CustomBusinessObjectManager’/> Definition of constant: public class Z_CustomBusinessObjectManager extends BusinessObjectManagerBase implements BOManager.. } Accessing Custom BOM from Action: . Java All Java related changes to the application have to take place in customer packages.CUSTOM_BOM).Development and Extension Guide – SAP E-Commerce 7.. boi Example: com.<name of your company>.isa.isa.isa.<name of your company>.acme. Do not use BO or BusinessObject in the name of the business object.backend.isa.crm Table 67: Naming conventions for packages Java Classes The following naming conventions should be used when developing custom classes: Type of Java Code Action Naming conventions Z_<Arbitrary name>Action for self written classes Z_<Original Action name>Action when deriving from existing ECO actions Business Objects Z_<Name of BO e.backend.isa.businessobject Backend Object Interfaces com.businessobject.action Business Objects com.acme.isa.isa.acme.g.isa.<type of backend> current backend-types are: <crm>.acme.action Example: com.boi Implementation of Backend Objects com.businessobject Example: com.acme.<name of your company>.Development and Extension Guide – SAP E-Commerce 7. <ipc> Example: com.0 Packages When Java classes are written they should be put in packages using the following naming conventions: Type of Java Code Actions Name of Package com.backend. Example: com. Basket> for self-written classes Z_<Original Business Object name> when deriving from existing ECO business objects The name of a business object should be a noun.Z_Basket Table 68: Naming conventions for Java classes August 2008 273 .<name of your company>.backend.isa. isa.settings=My Settings after changing: acme. CustomBusinessObjectManager> for self-written classes Z_<Original BOM name> when deriving from a existing ECO Business Object Manager Example: com.acme.isa. Table 69: Naming conventions for Java classes Resource Files If you modify text keys in XLF files or add your own texts.backend.crm.header.Z_Busines sObjectManager Backend Object Interfaces Z_<Name of Business Object>Backend for self written classes Z_<Original Backend Object interface name> when deriving from existing ECO business objects Example: com.businessobject.acme.Development and Extension Guide – SAP E-Commerce 7.Z_CustomBask etCRM. this class provides additional basket functionality but does not derive from the CRM specific ECO basket.crm.header.backend. use the following conventions: Changes Changed text of an existing key Naming convention Copy the key and rename it using the following naming convention: <name of your company>z_<key name> Example: original key: b2b.b2b.g.0 Type of Java Code Business Object Manager Naming conventions Z_<Name of BOM e.acme.Z_OrderCRM Implementation of Backend Objects Z_<name of Business Object><type of backend in upper case> Z_<Original Backend Object impementation name> Example: com.z_settings=My personal Settings Table 70: : Naming conventions for resource files August 2008 274 .isa. cic). of course. to change the catalog cache settings.0 Changes Added custom key Naming convention <name of your company>z_<key name> The key name should correspond to the component within the application (e.CatalogCacheInitHandler’> <param name=‘expiration’ value=‘24’/> <!-.xml. Example: acme.Development and Extension Guide – SAP E-Commerce 7.display.b2b. b2b.time in hours --> <param name=‘removal’ value=‘48’/> </initialization> August 2008 275 . In the SAP version of WEB-INF\xcm\sap\modification\init-config. use the same extension mechanism in other configuration files.xml The following example is taken from Internet Sales 5.xml or backendobject-config. Changes in init-config. Changes in Configuration The following chapter explains changes to the configuration using Extended Configuration Management (XCM).cache. Application Configuration and Component Configuration Application configuration and component configuration can be created and maintained using the XCM Administrator tool. but changes to these two files are the most common.xml the following inithandler is responsible for initializing the catalog cache: <initialization className=‘com. A detailed description can be found in the XCM Administrator tutorial which is part of the mySAP CRM Java Installation Guide (see [1]) Common Configuration Changes This section details how you make common configuration changes to the settings in init-config.order.catalog. This makes it easier when you upgrade the application. You can.z_extheaderdat a_inc Table 71: : Naming conventions for resource files Place all additional/changed keys at the end of the resource file.0 B2C.isa.sap.g. These changes cannot be made using the XCM Administration tool. isa./initialization [@className='com.isa.backend.webcatalog.xml.PriceType --> </params> </businessObject> </config> August 2008 276 .xml located in the folder: <web application>\WEB-INF\xcm\customer\modification. expiration).isa.pricing.boi. all others are inherited (for example.catalog. and there is no appropriate switch in the XCM Administrator.xml: <config id=‘crmdefault’> <businessObject type=‘PriceCalc’ name=‘CatPriceCalc’ className=‘com.sap.cache.PriceCalculatorCRMIPC’ connectionFactoryName=‘JCO’ defaultConnectionName=‘ISAStateless’> <params> <param name=‘priceTypes’ value=‘totalGrossValue’/> <!-. You only need to provide the parameter you wish to change (removal).xml You use this file to register backend objects in the Business Logic Service Layer (BLS).pricing.for allowed values see defined constants in com. The following example illustrates how to change a setting in the PriceCalc Backend Object (example is taken from Internet Sales B2C).0 You want to change the value of the removal attribute from 48 to 4711. Changes in backendobject-config.crm.xml was used for registering Backend Objects. Changing existing Backend Object If you need to change configuration for existing backend objects.sap. You have to derive your changes from the base backend object.Development and Extension Guide – SAP E-Commerce 7. You make the changes in the customer version of init-config. you need to carry out the changes manually. All customer changes must be done in WEB-INF\xcm\customer\modification\backendobjectconfig.backend..webcatalog. In previous releases the file eai-config. using XCM extension mechanism.CatalogCacheInitHandler']’> <param name=‘removal’ value=‘4711’/> </initialization> In this example you are extending the catalog cache init-handler. Example: Add the following code after the xi:include XML element: <initialization isa:extends=‘.sap. located in WEB-INF\xcm\sap\modification\backendobject-config. className)./config[@id='crmdefault'‘> <!-. You need it to tell XCM which backend object you are extending. You need the backend object attribute 'type'. Extend this configuration using isa:extends=‘.backend.Z_Custom’ connectionFactoryName=‘JCO’ defaultConnectionName=‘ISAStateless’> <params> <param name=‘myParam’ value=‘myValue’/> </params> </businessObject> </config> always be extended for self written backend objects August 2008 277 . because this is the key identifying the backend object.. name.acme. Perform the following step. Check the result of this extension in the XCM cache. 2. 3. and not all attributes (for example.The reasons is that this is the base configuration for all other configurations. Locate the backend object PriceCalc in SAP configuration using the id='crmdefault'.0 To change the value of priceTypes from totalGrossValue to netValueWithoutFreight. (even if you use ECO ERP)./config[@id='crmdefault'‘./config[@id='crmdefault'‘> <businessObject type=‘PriceCalc’> <params> <param name=‘priceTypes’ value=‘netValueWithoutFreight’/> </params> </businessObject> </config> 4. In doing this you derive the complete base configuration crmdefault. (Example taken from ISA B2C) You can always extend the base configuration crmdefault when registering your object. Adding new Backend Object If you have written a backend object you have to register it in backendobject-config.xml..the crmdefault configuration can be --> <config isa:extends=‘.crm. priceTypes). The following coding in the customer version of backendobject-config.xml is placed after the xi:include: <config isa:extends=‘.register your backend objects here --> <businessObject type=‘Z_Custom’ name=‘z_custom’ className=‘com.isa.Development and Extension Guide – SAP E-Commerce 7. Make a note of the backend object you need to change. carry out the following steps: 1. Please note. <!-. you only have to write down those you are changing (in this case.. allowed values etc. Meta data of the new parameter like description. In addition to that you have to provide meta data like the descirption (custom parameter) and the type of the parameter (text). What to Do The first step consists of adding the name (myParam) and the default value (defaultValue) of the new parameter and the name of the component (project) the parameter is assigned to. you can extend the XCM configuration tool with your own settings.Development and Extension Guide – SAP E-Commerce 7. After adding the new parameter you will be able to configure it using the XCM Admin tool as shown in the following figure: Figure 90: Adding and configuring new parameter (XCM) August 2008 278 . 2. There are two types of information you have to provide when adding new parameters to XCM: 1.0 Extending XCM with Customer Settings If you extend the application and would like to make your extensions configurable. The new parameter with a name and default value. Make a backup of this file before doing any changes in case you need to restrore the original file <component id="project"> <configs> <config id="projectconfig"> <params id="default"> <param name="myParam" value="defaultValue"/> </params> </config> </configs> </component> The naming rule for the config id is is always: <component id>config e.g.do) Select 'XCM Settings' in the tree Click the ' Component configuration data download' button Store the file you have downloaded in the file system In this step you have to add the component name the paramter name and the default value of the paramter.0" encoding="UTF-8"?> <xcmadmin> <componentmetadata> <component id="project" shorttext="Project specific setting" scope="application"> <longtext>Detailed overview on parameters configured here</longtext> <params> <param name="myParam" type="text" shorttext="custom parameter"/> </params> </component> </componentmetadata> <scenariometadata> <!-. You have therefor first to download it from the Database o o o o Open the XCM tool (e. b2b/admin/xcm/init.xml Add the metadata like shown in the following example: <?xml version="1.add additional </scenariometadata> </xcmadmin> scenariometadata here --> August 2008 279 .0 Adding Parameter Name and default Value The XML file used for storing the name/value of parameters is stored in the DB.Development and Extension Guide – SAP E-Commerce 7. In the next step you have to add metdata of the paramter like descrition and type o Open the file xcm\customer\modification\xcmadmin-config.g. projectconfig. g. Adding Meta data of XCM parameters This paragraph gives some information on how adding component meta data. This can be done in the XCM Admin by the user during configuration (e. Used to identify the component.isa.ComponentTest Provide a detailed description of the component.0 You have to restart the application in order to activate the setting In the last step you have to upload the config-data. Either application or session.xml file back to the database: o o o Start the XCM and select XCM Settings Click the 'Edit' button Select the path of your modified config-data file in the 'Path to component configuration data' entry field By uploading the file manually you overwrite the DB content of this file. testing connection to SAP system using JCO). This attribute indicates that a component is obsolete and should not be used any longer. You should update the short/long text and describe the consequences of the deprecation See [5] Chapter Changing XCM Parameters for rules when changing configuration parameters Table 72: Adding Meta data of XCM parameters no August 2008 280 . Make sure that the XML file is valid and well formed before uploading it to DB. o Press the upload button After uploading the file you should be able to see/changfe the new parameter in the XCM UI. An obsolete component is marked with an icon in the tree.sapmarkets. One sentence describing what this component is good for. This class is used to test the component configuration. This will be used in a summary table giving the customer an overview on the available components. The component XML element has the following attributes: Attribute id shorttext Description The id of the component.test. If this attribute is omitted the default value is 'session' no Required yes yes testclass No longtext yes It is recommended to only use the 'application' scope in customer projects status value 'obsolete’. What is the component good for? scope The scope of the component. The test class has to implement the interface com.core. Uploading invalid files can cause the application to not start or work properly.Development and Extension Guide – SAP E-Commerce 7. text is used to for any kind of text.0 A component is configured using parameters. Each parameter should have a one sentence long shorttext giving information what the parameter is good for.Development and Extension Guide – SAP E-Commerce 7. You can see entry fields of type text (e.port) as well as one entry field of type singleselect (securemode) Figure 91: XCM .parameter shorttexts Example: Example of text type: <param type="text" name="myParam" shorttext="myValue" /> August 2008 281 . singleselect is represented by a dropdown-listbox giving the user a limited number of choices.smtp. mail. There are two types of parameter values: text and singleselect. It can also have a longtext with detailed information about the parameter. the test can be executed using the 'run test' button. The screenshot below shows where the parameter shorttexts are shown. If there is a test class registered.g. LWC features releated to security will be disabled. One sentence describing what this parameter is good for.0: Allowed value 'obsolete’.Development and Extension Guide – SAP E-Commerce 7. </longtext> <constraint> <allowedvalue value="true" shorttext="securemode is turned on"/> <allowedvalue value="false" shorttext="securemode is turned off"/> </constraint> </param> The param XML element has the following attributes. This attribute indicates that a parameter is obsolete and should not be used any longer.core. This description is shown in the XCM Admin tool to give the user an idea what the parameter is used for as well in a printable summary of component parameters. ActiveX controls and document push are the features which pose threat to security. The class has to implement com. Please describe in the long text the consequences of the deprecation See [5] Chapter Changing XCM Parameters for rules when changing configuration parameters no Required yes yes longtext no type Status yes No Table 73: Attributes of the param XML element August 2008 282 .isa. The short text visible in the UI has the following format: OBSOLETE <shorttext>. By default. If one sentence is enough to describe the meaning of the parameter then this is sufficient conversionclass A class used to convert the value.admin.sapmarkets. This can be used to convert the value before it is stored. ParamConverter If the parameter is of type text you can provide additional information here helping the customer to maintain this parameter correctly Either text or singleselect.xcm.conv. securemode is set to true. In case of single select you have to define the allowed values New in 5.0 Example: Example of singleselect type: <param name="securemode" type="singleselect" shorttext="Enables or disables security related features"> <longtext> When set to true. An obsolete parameter is marked with yellow color int the table. Attribute name shorttext Description Name of a parameter. isa. If you have defined in the CRM Backend some dynamic fields and you wish that they appear in this web application.getApplicationScopeConfig(). then the dynamic-fields-config.sap. If one sentence is enough to describe the meaning of the parameter then this is sufficient longtext More details about the value.isa. (The delivered standard file is placed under …\WEB-INF\xcm\sap\modification\dynamicfields-config.config.Development and Extension Guide – SAP E-Commerce 7.XCM Firstly get your the component configuration: FrameworkConfigManager.ComponentConfig.getProperty("myParam"). This description is shown in the XCM Admin tool to give the user an idea what the value is used for as well in a printable summary of component parameters.0 Definition of a allowedvalue located in the body of the param XML tag. PRICING. Configuration of Dynamic fields in E-Service Dynamic fields are fields that a customer can add to be included in the complaints and returns. Attribute value shorttext Description The value of the parameter One sentence describing what this parameter is good for.core.XCM .xml file must be updated. Table 74: Definition of a „allowedvalue“ Required yes yes no API for reading XCM parameter Values The API for getting an 'application' scope component is located in the class com. "projectconfig") The component configuration is of type com.xml and should not be changed. They can be defined on the following one-order structure: CUSTOMER_I.sap.It provides access methods for XCM parameters: getParamConfig("default").getComponentConfig("project".core. The file under the root of the application …\WEB-INF\xcm\customer\modification\dynamic-fields-config. FrameworkConfigManager.) August 2008 283 .xcm. These dynamic fields can be defined in customizing: Customer Relationship Management Basic Functions Authorizations Define Authorization Group and Customer Relationship Management Basic Functions Authorizations Maintain Authorizations at Field Level. SHIPPING and PRODUCT_I.xml is the one that must be modified. w3.cl.config" xmlns:xi="http://www.0 Here is an example of the dynamic-fields-config.crb2b.xml file: <maintenance-object xmlns:isa="com.dyn.hsq" objectType="CUSTOMER_I" fieldName="HS_OF_PRIME_QTY" size="10"> </property> <property name="HS_OF_PRIME_UNIT" type="input" description="esrv.cl.crb2b.cl.Development and Extension Guide – SAP E-Commerce 7.xml#xpointer(backendobject/configs/config[@id='${backendtype}']/*)"/> <property-group name="ComplaintItemDynFieldsPG"> <property name="DANG_TO_RETURN" type="selectbox" description="esrv.car" objectType="CUSTOMER_I" fieldName="CARRIER_CLAIM"> </property> <property name="HS_OF_PRIME_QTY" type="input" description="esrv. August 2008 284 .cl.org/2001/XInclude" > <!-.isa.cl.customer changes in dynamic-fields-config should be done here by extending/overwriting the base configuration --> <xi:include href="${sap}/modification/dynamic-fieldsconfig.dyn.core.cl.dang" objectType="CUSTOMER_I" fieldName="DANG_TO_RETURN"> <allowedValue value="A" description="esrv.hsu" objectType="CUSTOMER_I" fieldName="HS_OF_PRIME_UNIT" helpValuesSearchName="UnitOfMeasure" size="10"> </property> <property name="SCRAP_VALUE" type="input" description="ScrapValue" objectType="PRICING" fieldName="SCRAP_VALUE" size="12"> </property> </property-group> </maintenance-object> Immediately below the statement <xi:include…>.mov" /> </property> <property name="CARRIER_CLAIM" type="checkbox" description="esrv.opt.sap.crb2b.dyn.opt. you will have to define a property-group named ComplaintItemDynFieldsPG and define underneath it all the properties that you want to appear in the web application.crb2b.dyn.crb2b.scr" /> <allowedValue value="B" description="esrv.crb2b. properties file. objectType fieldname Size helpValuesMethod Database entity where this field can be found.Development and Extension Guide – SAP E-Commerce 7. <select id…> <option value=”value” …) Description The resource file key containing the value that will be displayed on the web application UI. Table 75: Allowed Attributes for the tag <property> Allowed attributes for tag <allowedValue> for a property of type selectbox.xml. This key must exist in crm~eservice~cr_b2b~resources.g. either: CUSTOMER_I. or PRODUCT_I. Attribute Value Default Remark Static value which will be added as select option to a <html> select box (e. This key must exist in crm~eservice~cr_b2b~resources.0 Allowed attributes for tag <property>: Attribute Name Remark Name of the property. the name of the field which must match the field in the backend system The maximum length of this field on the web application UI Identifies a help value method defined in file sap\modification\helpvaluesconfig. Adding the name of an <helpValuesSearch> will bring up an binocular beside of an input field.properties file. The name must be unique within one screen group. PRICING. Hide this value (not included on the <html> page) Hidden False Table 76: Allowed Attributes for the tag <allowedValue> August 2008 285 . Type Defines the type of the search screen property: input (= simple input field) selectbox (= drop down list box) checkbox (= simple checkbox) Description The resource file key containing the field label that will be displayed on the web application UI. genericsearch.ui.java Web server Re-use from Internet Sales Re-use from Internet Sales Re-use from Internet Sales Re-use from Internet Sales Re-use from Internet Sales E-Service specific Re-use from Internet Sales Re-use from Internet Sales com.GenericSearchBaseUI.isacore.jsp Web server Re-use from Internet Sales \xcm\sap\modification\generic-searchbackend-config.uiclass.java Web server com.sap.isa.isa.java Web server CRM_ISALES_SEARCH Application server (Dev.class) CRM_ICSS_CR CRM_ISA_GEN_DOCUMENT_SEL Application server (Dev.sap.GenericSearchBaseAction.ui. Mod) CL_ISA_GEN_DOC_SEARCH_HELP Application server (class) Table 77: Main Components of the generic search framework Details of component “generic-searchbackend-config.GenericSearchSortAction.isa.sap.xml” Location: xcm \ sap \ modification \ generic-searchbackend-config.java Web server com.Development and Extension Guide – SAP E-Commerce 7.isa.action.isacore.xml Web server E-Service specific com. August 2008 286 .GenericSearchUIFactory.sap.xml.genericsearch.action.uiclass.0 Generic Search Framework Main Components of the Generic search framework for E-Service Extended Complaints and Returns: Component Application layer Specific or Shared component ? \appbase\genericsearch. Known standard implementations for CRM E-Service extended Complaints and Returns. class) Application server (func. This implementation is exclusively used to select deliveries. Filter Value BILLINGDOC BILLINGITM ABAP class CL_IM_CRM_ISA_GDS_BILLDOC CL_IM_CRM_ISA_GDS_BILLDOCI Remark This implementation is used to select billing documents. This implementation is used to search for items within CRM billing documents. The components are designed to work in a generically way. It returns items instead of header objects. This implementation is exclusively used to select deliveries.0 BAdI Implementations in component “CRM_ICSS_CR” Filter Value CAMPAIGN COMPL COMPL_I ABAP class CL_IM_CRM_ESRV_CAMPAIGN CL_IM_CRM_ESRV_COMPLAINT CL_IM_CRM_ESRV_COMPLAINT_I Remark This implementation is exclusively used to select marketing campaign elements. This implementation is exclusively used to select complaints. This implementation is used to search for items within one sales document (1Order documents). It returns items instead of header objects. It returns items instead of header objects. August 2008 287 . ORDER 1O_ITEMS CL_IM_CRM_ISA_GDS_ORDER CL_IM_CRM_ISA_GDS_1O_ITEMS Table 79: BAdI Implementations in Component “CRM_ISALES_SEARCH” E-Service Extended Complaints and Returns specific implementation of the Generic Search Framework The section before gave a detailed overview of the different components of the Generic Search Framework. This implementation is exclusively used to select complaints. independent from an application. This section now focuses on the integration of the Generic Search Framework into the CRM E-Service Extended Complaints and Returns. This implementation is exclusively used to select product service letters (PSL). DELIVERY DELIVERY_I CL_IM_CRM_ESRV_DELIVERY CL_IM_CRM_ESRV_DELIVERY_I PSL REJECTED_I RETURN RETURN_I CL_IM_CRM_ESRV_PSL CL_IM_CRM_ESRV_REJECTED_I CL_IM_CRM_ESRV_RETURN CL_IM_CRM_ESRV_RETURN_I Table 78: BAdI Implementations in Component "CRM_ICSS_CR" BAdI Implementations in component “CRM_ISALES_SEARCH” (Those BAdI implementations are re-used from Internet Sales application).Development and Extension Guide – SAP E-Commerce 7. This implementation is exclusively used to select returns. This implementation is exclusively used to select rejected complaints and returns items. It returns items instead of header objects. This implementation is exclusively used to select returns. It returns items instead of header objects. This implementation is exclusively used to select order documents. uiclass. To search for sales document items (used to find items in case large document handling is enabled) To search for billing document items (used to find items in case large document handling is enabled) To search for delivery document items (used to find items in case large document handling is enabled) To search for claim document items (used to find items in case large document handling is enabled) To search for return document items (used to find items in case large document handling is enabled) To search for complaints and returns items which are in status rejected. Known search definitions in E-Service Extended Complaints and Returns Search Screen Definition SearchCriteria_B2B_Ref Scenario B2B Remarks To search for reference documents.Development and Extension Guide – SAP E-Commerce 7.sap. August 2008 288 . All the search definition in the E-Service Extended Complaints and Returns application relate to a UI class com.deliveries .xml. 3. extending the base one and specifying it in the <screen-group> of the generic-searchbackend-config. First search screen to come up in the B2B scenario on the left side of the application (Shuffler / Navigator). This is defined in the java class EserviceStartApplicationAction. If you wish to override these conditions.product service letters (PSL) . SearchCriteria_B2B_Cr SearchCriteria_B2B_Sales_OrderStatus_Items B2B B2B SearchCriteria_B2B_Billing_BillingStatus_Items B2B SearchCriteria_Delivery_Items B2B SearchCriteria_B2B_Claim_Items B2B SearchCriteria_B2B_Return_Items B2B SearchCriteria_RejectedItems B2B Table 80: Search definitions in E-Service Extended Complaints and Returns 2.crb2b.0 1. In the E-Service Extended Complaints and Returns application.eservice.invoices . it is possible to define your own UI class.GenericSearchCrUI.marketing campaign elements To search for claims and returns documents. This class makes sure that the user has sufficient authority to view each document types for either his company or a company in his hierarchy before displaying the search criteria. . Dynamically disabling document types which are not allowed by user permissions.orders . the navigator is always set to display the complaints and returns search (as opposed to reference documents search). August 2008 289 . 3. Open the runtime version of the configuration file you are interested in by clicking on the links.Development and Extension Guide – SAP E-Commerce 7. The XCM processed configuration files only exist in the memory. 5. 6. Select the configuration you are interested in from the dropdown list box. You must therefore check the XCM processed files using XCM Administrator: 1. Check if your change was processed correctly. Start the application with the XCM scenario (application configuration) you are using.0 Checking configuration during runtime After changing configuration in customer files you need to check your extension mechanism is working properly. 4. 2. Access the XCM Administrator. 7. Press the button “monitoring” in the upper right corner. Restart web application. Change settings in customer version of configuration files. You can specify the following additional request parameter when invoking the application: showmodulename=true This activates the feature for one session Example By starting the B2B application with the following URL: http://<host name>/b2b/b2b/init. Displaying Names of JSPs while Running the Application Use this feature if you want to display the name of a JSP on the screen.0 Best Practices Getting Information about the Application The following units give you hands-on information needed for performing extensions. b2b) consist of many frames. This activates the feature permanently. After changing a JSP you can update the corresponding page in the browser by placing the mouse pointer on a particular page. You can activate this feature in two places: In XCM: Navigate to the component UI and set the parameter showmodulename.do?showmodulename=true You get the following screen showing the name of the JSP in the upper left corner: August 2008 290 .core = true.g. Getting Information about JSPs Some applications (e.Development and Extension Guide – SAP E-Commerce 7. and selecting Refresh from the context menu. only Description Value: <any value> The language independent resource key is displayed instead of the corresponding text.show.key. Value: <any value> The language independent resource key as well as text is displayed in the form: <resource key>:<text> Table 81: Displaying text of keys translate.Development and Extension Guide – SAP E-Commerce 7. Possible values are: Request Parameter translate.show.concat August 2008 291 .0 Figure 92: Displaying name of JSP-Files in E-Commerce Applications Displaying Text Keys While Running the Application Use this feature if you would like to find out which text displayed in the application corresponds to which key in the resource file. Providing an additional request parameter in the URL activates this feature.key. There are several ways of getting information on the interaction within the application.do?translate.key.xml File (or other Struts configuration files) There is currently no tool support for analyzing the content of the config. Analysing the config.0 Example By starting the B2B application with the following URL: http://localhost:50000/b2b/b2b/init.show.Development and Extension Guide – SAP E-Commerce 7. To analyze this file you should be familiar with the Struts framework. August 2008 292 .xml file.concat=99 You get the following screen: Table 82: Displaying language dependent keys Finding out Information about the Process Flow You need this information if you have to interfere the process flow of the application in order to provide your custom functionality. To do this. where counter is a number between 1 and 20. The log level used for this is always DEBUG. Open the application specific component in the XCM admin tree view: "General and Application Settings/Customer/<APPLICATION>/<APPLICATION>config". proceed as described below: The following procedure describes how to generate a session trace: Remove unused DefaultTrace file in the log directories of your Web AS Java server node directories. whereby it is not possible to raise the log level globally The trace messages are written in the default trace files of the SAP Web AS Java. which are located in the directory <DRIVE>:\usr\sap\<SID>\JC<INSTANCE_NUMBER>\j2ee\cluster\<SERVER>\log (e. Start the application by opening this url: http:<host>:<port>/<application> The application start page lists all application configurations you configured in the XCM and provides a "Single Session Trace" link for each of them. perform the following steps: Open the XCM UI by opening the following URL in the web browser: http:<host>:<port>/<application>/admin/xcm/init. Configuring session tracing Before you can make use of the session tracing.g.0 Session Tracing Session tracing enables you to write all trace entries of a user session to a separate file.Development and Extension Guide – SAP E-Commerce 7. you have to configure it. your SAP Web AS Java is running on. August 2008 293 .trc.<COUNTER>. regardless of how the other logging settings are. c:\usr\sap\C51\JC10\j2ee\cluster\server0\log).do.jsp" feature Save your configuration Restart the application in the deploy service of the visual administrator There are various ways of enabling the Single Session Trace: Enabling session tracing To activate the session tracing in an E-Commerce application. where <APPLICATION> is the context root of your application Turn on the "appinfo" feature Turn on the "show. The application will start a web session based on the selected XCM application configuration. where <HOST> ist the name of the host.start. in addition to the standard log files. and <PORT> is the http port of your SAP Web AS Java. A second browser window will open where the session id will be displayed. There you’ll find the files defaultTrace. This function allows a detailed tracing in a production system. Session logging offers the following: Tracing a client session Debug log level (highest level of detail) independent of further logging settings. Download the csv File To be able to us the session tracing. The session id was displayed during startup of the session via "Single Session Trace". you can decide whether you want to trace the function module before it is called. If you have such data it is possible to omit tracing some of the parameters. Tracing Function Modules You can enable tracing for any function module executed in the ECO application.0 Replay the session to generate the application specific trace file content.xml August 2008 294 . Press "go down" Press the "Download content" button.xml Example: For examples see comments in file modification-config.Development and Extension Guide – SAP E-Commerce 7. It is useful if you need to know which parameters were used when the function module was called. For information on how to do this. or after it has been executed. you have to configure it as described above. Open the Netweaver Administrator by opening the following URL http://<host>:<port>/nwa Start the log viewer by: Click on the "Monitoring" Link Click on the "Logs and Traces" Link Select the "Default Trace" View Open a Search Search for your "Session". Additionally. The function module trace is enabled in the file WEBINF/xcm/customer/modification/modification-config. please see the comments in the file modification-config. This feature traces import/export and table parameters.xml You should make sure that you do not trace sensitive data. Comes with 3. and a sold-to selection is necessary.0 Additional Request Parameters General Request Parameters The following table gives you an overview of HTTP request parameters which can be passed to the application. for example. For SP04 and higher. Precedes the mimes search path with the theme string. Language to be used. the application is never accessed using HTTPS.gif Userid Secure The ID of the logged on user. when it is started. Version of the oci-interface.0 = yes (X) | no. an error page will be presented if autoentry is used.1: Until SP03.com=winter modfies the normale search path /b2b_dev/b2b/mimes/images/shopHeader. Id of the auctions opportunity.xcm Shop Theme Value: The name of an XCM scenario.1 = X. The password of the logged on user. Value: Name of the theme. for example. CRM_Q4C_705. Forward hook_url Language oci_version opportunity_id Password Portal scenario.core. Also disables the display of billing documents. Rel4. Possible value: on This parameter is needed if you run the following infrastructure: browser => HTTPS => Web Server => HTTP => J2EE Engine Since the protocol between the web server and the SAP J2EE Engine is HTTP. Request Parameter Autoentry Description Value: Rel3.gif to /b2b_dev/winter/b2b/mimes/images/shopHeader. Value: yes|no Triggers visual modifications necessary for displaying the shop in the portal. parameter allowed to automatically pass shoplist and sold-to party selection without any user action. In order to let the application know that HTTPS is used it should be started using the additional request parameter secure=on Table 83: General Request Parameters August 2008 295 . de. The page the LoginAction should forward to. First entry of the shoplist or sold-to party list had been selected.isa.sap. or en. Example: theme. Shop to be used. URL for the outside page to return to Internet Sales. but no shop is passed via URL parameter.Development and Extension Guide – SAP E-Commerce 7. within the selected shop area: August 2008 296 .do?shop=<shop name>&areaID=<area Guid>&productID=<product Guid> After execution the user is directly forwarded to the detail screen of the selected product. Example The application can be started with the following URL: http://<host name>/b2c/b2c/init. Example http://localhost:50000/b2b/b2b/init. The parameters are: Request Parameter areaID Description This parameter specifies the GUID for the area that contains the product. you can start the application with some extra parameters in the URL. This parameter specifies the product Id that is associated with every product from the catalog by the ISA B2C application. It can be obtained by calling item. Table 84: Request parameters for B2C productID Shop ECO Version This feature is available in all versions of E-Commerce.getAreaID().0 ECO Version This feature is available in all versions of E-Commerce. This parameter is used to specify the shop that contains the desired product. This parameter can be obtained for a certain item (WebCatItem object) by calling item.getItemID().do?shop=muster&language=en Request parameters for B2C To directly display the product details of a certain product. There are three parameters that should be in the request to display the details for a certain product.Development and Extension Guide – SAP E-Commerce 7. in the JSP): String data = (String)request. value). Action Flow Remains on the Server In this scenario all the Actions operate on the same request: Figure 94: Action flow of one request Data can be set using: request. August 2008 297 .Development and Extension Guide – SAP E-Commerce 7.getAttribute(‘Name’).0 Figure 93: Calling the application with additional request parameters Single Session Trace Passing Data between Actions When you have a chain of Actions you often need to pass data from one Action to another. depending on the Action flow. Data is retrieved using (for example. There are two different strategies.setAttribute(‘Name’. isacore. } String n = name. or use this feature to retrieve values from a multiple select input: August 2008 298 . RequestParser.IsaCoreBaseAction. if (price. for example.0 Action Flow is Interrupted by a JSP In this scenario a JSP (for example.isDouble()) { double d = price. You may. In this case you have to interfere the Action flow after the JSP. RequestParser.isa.getValue().sap. This class is a wrapper around the request object and allows you to retrieve parameters of the right type and test them for valid values: RequestParser parser = new RequestParser(request).getString().getParameter(‘price’).getValue(). The Servlet concept for managing request parameters is based on strings and causes a lot of work when converting the data into other data types.getValue(). Before Figure 95: Original action flow After Figure 96: Interrupted action flow Working with Request Parser This unit describes the Request Parser which can be used if your Actions derive from com.isSet()) { if (price.getParameter(‘name’).Parameter price = parser.Parameter name = parser. } An additional feature is that you can use arrays in the context of form variables. by adding your own Action.getDouble(). frameset) interrupts the server-side Action flow. group related variables together.action. In this Action you have to retrieve the data from the Business Object layer and set it as a request attribute as described above.Development and Extension Guide – SAP E-Commerce 7. i++) { %> param. It is therefore used by many concurrent threads from different sessions.getString().getParameter(‘beer[]’). You therefore have to be careful when writing customer extensions.getString(). during runtime.Development and Extension Guide – SAP E-Commerce 7.getParameter(‘personal[]’). if (param. String name = param. please see chapter 'Interception of Calls to Standard Function Modules' on page 225.Parameter param = parser.php’ method=‘post’> Name: <input type=‘text’ name=‘personal[name]’><br> Email: <input type=‘text’ name=‘personal[email]’><br> Beer: <br> <select multiple name=‘beer[]’> <option value=‘122’>Warthog <option value=‘33’>Guinness <option value=‘7373’>Stuttgarter Schwabenbräu </select> <input type=‘submit’> </form> The data of this form contains two associative arrays ‘personal’ and ‘beer’. } param = parser. RequestParser. i < parm. You can retrieve the data using this wrapper class in the following way: RequestParser parser = new RequestParser(request).getValue(‘email’).getInt(). } Writing Thread Safe Code Internet Sales is used by many concurrent users.getValue(‘name’).isSet()) { // gives you the value of personal[email] String email = param. This chapter gives you some hints: Writing thread safe Actions Refer to chapter 'Threads in Actions' on page 40 Writing Execution Event Listeners There is only one instance of an event listener for each XCM configuration.getValue(i). For further information. for (int i = 0.0 <form action=‘array. at the same time. August 2008 299 .getNumValues(). the E-Commerce logging was replaced with the standard logging of the SAP Web AS. that are available on the application server. the E-Commerce page has been removed.Development and Extension Guide – SAP E-Commerce 7.0. August 2008 300 . and not just the pools of the Web application in which the administration page is.0 solution: SAP-CRMAPP (not contained in ECOERP) SAP-CRMDIC SAP-SHRAPP Logging In SAP E-Commerce 5. The following software components are contained in the SAP E-Commerce 5. For more information please refer to chapter Logging/Tracing on page 115. The version information was moved to http://<hostname>:<port>/sap/monitoring/ComponentInfo. Getting Application Version Since the SAP Web Application Server Java provides a central web page. were the versions of all deployed components are shown.0 Administration Console There are some administration pages which help you to administer the following technical aspects of the application: Aplication Cache statistics Catalog cache statistics Application System Cache Statistics Java Connector Pools Java Connector Pools pool name max pool size Name of the connection pool The maximum number of connections to the SAP System that are required per pool up to that point in time The maximum number of connections to the SAP System that are required per pool up to that point in time The number of connections that are currently available in the pool Table 85: Attributes of Java Connector Pool max cons used num current used cons The page displays all of the SAP Java connector pools. Restart application through SAP J2EE administration console.0 Updating Application This table gives you information about after which changes to the application you have to restart the SAP J2EE Server.Development and Extension Guide – SAP E-Commerce 7. Table 86: Updating the application August 2008 301 . Restart application through SAP J2EE administration console. Changes JSPs Configuration files Java files What to do Refresh corresponding page in browser. Development and Extension Guide – SAP E-Commerce 7.0 Web Diagrams Syntax of Web Diagrams August 2008 302 . Development and Extension Guide – SAP E-Commerce 7.0 B2B .Start Page August 2008 303 . 0 B2B .Create Basket August 2008 304 .Development and Extension Guide – SAP E-Commerce 7. Development and Extension Guide – SAP E-Commerce 7.Display Order Status August 2008 305 .0 B2B . Follow the “Java” link that is applicable for the database and operating system.Development and Extension Guide – SAP E-Commerce 7. you want to use.0 CRM Core and Standalone Components. InstallationGuide on SAP Service Marketplace: http://service. [3] Struts documentation: http://jakarta.com/crm-inst mySAP CRM 2005 CRM Core and follow the link “Installation mySAP CRM 2005 (SAP CRM 5.0 Date August 2008 Remarks First Version for SAP CRM Release 7.sap.sap. [2] SAP CRM 5.sap.0 References [1] “SAP E-Commerce Development and Extension Guide: Examples and Tutorials” on SAP Service Marketplace: http://service.com/connectors Connector Java Update History Version 1.0 Java.0 August 2008 306 .apache.0)”.com/crm-inst SAP CRM 7.org/struts/userGuide/index.html [4] SAP Java Connector: On the SAP Service Marketplace: http://service. .................................0 Table Index Table 1: List of the variables used in this guide ...............................................................49 Table 12: Input Validation....................................................168 Table 33: Overview of simple modifications related to the UI ...............................................................................121 Table 31: Software Components ............68 Table 23: Overview Context Values .............................................................................194 Table 36: User exits within the OCI ......90 Table 27: Types of Log Messages........................................................................................................67 Table 22: Registration of Context Values................................................................................................................................................................................................................................................................35 Table 11: Input Validation..............................................................58 Table 20: Global UI Commands .................31 Table 5: Parameters of the iterate Tag .............................35 Table 10: The structure of the UI element group object................................78 Table 25: Attributes of BusinessObject elements................................................190 Table 34: User exits within the Basket.................................................................................................................................................................................................................56 Table 17: Structure of the UIAreaContainer Tag.......Development and Extension Guide – SAP E-Commerce 7............................................................................................................................................89 Table 26: Attributes of BusinessObject elements.........................................................32 Table 7: Parameters ot the moduleName Tag ...................................................33 Table 8: Parameters of the imageAttribute Tag .....................................................................................................................................................194 August 2008 307 ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................29 Table 3: Parameters of the WebappsURL ................57 Table 18: Structure of the UIComponent Tag .....................................................................................................................................................................................................................................................................................................121 Table 30: Categories for Logs .......69 Table 24: Connection Types to Backend ................................................................................67 Table 21: Commands while Layout Processing ......................................117 Table 28: Types of Tracing................................................................................56 Table 15: Structure of the HTML Attribute Tag ....................................................................................................................................................................................................56 Table 16: Structure of the UIArea Tag ......................55 Table 14: Structure of the Form Tag.........32 Table 6: Parameters of th contentType Tag................................................................142 Table 32: Overview of possible changes in different layers.................................................................................................................................................................................................................................57 Table 19: Structure of the UIConfiguration Tag..............................................50 Table 13: Structure of the UILayer Tag...................................................................................................................30 Table 4: Parameters of the translate Tag........................................................................................................117 Table 29: Log Levels........................................................................................................................15 Table 2: Parameters of the MimeURL ....................................................193 Table 35: User exits within the Order...............................................34 Table 9: The structure of the UI element object ................................................................................................. .............................................................................................................Supported Function Module / Business Object ...............................................................213 Table 55: CRM ............................Supported Function Module / Business Object .......198 Table 40: User exits for IPC for pricing ........279 Table 73: Attributes of the param XML element......................................................................................................272 Table 68: Naming conventions for Java classes .............................................................274 Table 72: Adding Meta data of XCM parameters ..................................Supported Function Module / Business Objects – Order .....................Supported Function Module / Business Object ............................212 Table 49: CRM ................................................207 Table 47: User exits for for Pricing or Configuration..........................284 August 2008 308 ...................................................218 Table 57: ERP ....................273 Table 70: : Naming conventions for resource files ..............................................207 Table 45: User exits for Web Catalog...............................................213 Table 53: CRM ......................................................................Complaint ......................................273 Table 71: : Naming conventions for resource files ....................................................................................................................................Contract..........................................................................................................0 Table 37: User exits within the Extended Complaints ......................................................................265 Table 63:Overview of configuration files ..........................................213 Table 56: ABAP Extension Structure (ERP) ..............................................212 Table 51: CRM ...............................207 Table 46: User exits for for Pricing or Configuration.......................................................................272 Table 69: Naming conventions for Java classes .................................................................................................Supported Function Module / Business Object .............................................195 Table 38: User exits within the Remanufacturer’s Inspection Application ................................................................................................................................213 Table 54: CRM ...........................................................................................................................................................................282 Table 75: Allowed Attributes for the tag <property> ...................................268 Table 66: Naming conventions for Business Object Managers..267 Table 65: Naming conventions for JSPs...............................................................195 Table 39: Methods of the BOBase class.....................................................................................................................................................................................................................220 Table 59: How to access the Request Context ....................................................................................................................218 Table 58: Communication Structure in SAP ERP..................205 Table 42: User exits for IPC basket ..............................284 Table 76: Allowed Attributes for the tag <allowedValue> ...............................................................................................................................................................Shop........................................................................206 Table 44: User exits for Order and Order Status........................205 Table 41: User exits for IPC basket ........................................................................................Supported Function Module / Business Object – ComplaintHeader...............................270 Table 67: Naming conventions for packages .............Supported Function Module / Business Object .........................Order..............208 Table 48: ABAP Extension Structure (CRM).............................................................212 Table 50: CRM .......................................................................................281 Table 74: Definition of a „allowedvalue“...............................................................................................................................................................Development and Extension Guide – SAP E-Commerce 7...........213 Table 52: CRM .................................Supported Function Module / Business Object – ComplaintItem..........................................264 Table 61: Overview of the content of the web archive........................................................................265 Table 62:Overview of configuration files .................206 Table 43: User exits for Order and Order Status..........................223 Table 60: Overview of the content of the web archive.266 Table 64: Overview of the package structure of E-Commerce .....User .................................................. ...........................................................................299 Table 86: Updating the application .....285 Table 78: BAdI Implementations in Component "CRM_ICSS_CR"........................................................290 Table 82: Displaying language dependent keys................................................................................................................................295 Table 85: Attributes of Java Connector Pool...................................................Development and Extension Guide – SAP E-Commerce 7............................291 Table 83: General Request Parameters .......................286 Table 79: BAdI Implementations in Component “CRM_ISALES_SEARCH” ..................................................................................................................................................0 Table 77: Main Components of the generic search framework...........................294 Table 84: Request parameters for B2C .............................300 August 2008 309 .............................................................................................287 Table 81: Displaying text of keys.......................................................................................................................................................286 Table 80: Search definitions in E-Service Extended Complaints and Returns ............ 164 Figure 35: J2EE Engine ............................................................................................................................................................................................................72 Figure 15: XCM admin ..........................147 Figure 27: Required Software Components............................................0 Figure Index Figure 1: SAP J2EE three-tier architecture .......................24 Figure 5: Layered Architecture .........................................................................................................................................................................................................................................................................................................39 Figure 11: Error Message user_no_login..............................................28 Figure 9: Component configuration within XCM................Enabling Debugging............................Setting Up Debug Mode......................165 August 2008 310 ...........................................................................................................................................................................................................................................................................................53 Figure 14: Bookmark Support............................................................161 Figure 34: Visual Admin ....................................................................................149 Figure 29: Development System ................................................................................................................51 Figure 13: Layout areas of frameless JSP pages.........................................................................Development and Extension Guide – SAP E-Commerce 7........................................................................................115 Figure 22: Extend and Modify CRM Web Apps.........................................................................................78 Figure 20: Class Diagramm about use of JCo Connection.....164 Figure 36: Starting Remote Debugging ........................143 Figure 23: Merged Web Files .................73 Figure 16: Prozess of re invoke of an invalid session.............................................................................................................................................................................................................................25 Figure 6: Internal processes within the interacton and presentation layer...............................................36 Figure 10: Actions within ECO Framework .......160 Figure 33: SAP Management Console ..........................................................................................74 Figure 17: BO Layer Structure.............................................................................................................................................................27 Figure 8: Business Logic Service Layer (BLS Layer) .....................................................................23 Figure 4: Architecture of SAP E-Commerce for mySAP ERP 2005 ............46 Figure 12: Possible Attacks.................................................144 Figure 24: Project specific application in CUSTCRMPRJ...................21 Figure 3: SAP E-Commerce for mySAP CRM architecture ..........................................................................................157 Figure 31: Developer Workplace for SAP NetWeaver 2004s ..........26 Figure 7: BO Layer and the Business Object Manager .....................................................................75 Figure 18: Design of BLS ....................................................................................................................................................................................................................................................................77 Figure 19: Lifecycle of Backend Object ............................20 Figure 2: Components of the SAP J2EE Application Server.......................................................................................................................................................................defaultShopId...............81 Figure 21: Design of Logging / Tracing...............................................................................................................................................................................................................................................................................................146 Figure 26: Adding Software Component ...........................................0.................................................................................................159 Figure 32: Directory Structure of Web AS Java 7.145 Figure 25: Creating a new Track ......148 Figure 28: Check-In of the Archives .................................................................................150 Figure 30: Overview Developer Workplace................................... .............................226 Figure 65: Replacing calls to Standard Function Modules.........................................................................................................228 Figure 66 The IPC and its UI in the CRM Online Landscape...........................................................................................................................................................................................................................................................................................................................................................................182 Figure 49: Retrieve additional data from SAP ERP system to business object layer........................................198 Figure 57: Derive own class from existing Business Object ........................................................................................................................................................174 Figure 43: Transfer additional input data to action class and business object layer ........................187 Figure 53: Exchange additional data with the web catalog.............................................241 Figure 72 Combining low level layout and tiles ...............................................247 Figure 76 Customer buttons on screen..................................................................................199 Figure 59: Creating own Business Object.......................181 Figure 48: Call a SAP CRM system from the backend layer ...........................................................................................179 Figure 46: Retrieve additional data from SAP CRM system to business object layer.....................................................................................185 Figure 51: Call a SAP ERP system from backend layer................................................................238 Figure 68 General Action Flow ......................171 Figure 40: Extensions to the action flow ...........................................................................................0 Figure 37: Flow of possible changes ................................169 Figure 38: Overview of different categories of extensions .....................................................................................................................................183 Figure 50: Transfer additional data from business object layer to SAP ERP system...............237 Figure 67 IPC Architecture more in detail ...............................................................................242 Figure 73 JSP Key and Path ...........................................................................................243 Figure 74 Interaction of UIBeans with the JSP pages and the Busines Object Layer.....................................................202 Figure 62: Creating own Business Object Manager ....................................177 Figure 45: Extensions to exchange data with the backend systems ...............................................186 Figure 52: Exchange additional data between business object layer and an IPC system.........................................180 Figure 47: Transfer additional data from business object layer to SAP CRM..............................................................................................................................................................................................................................................................240 Figure 70 UI areas of the config UI...............................172 Figure 41: Extensions to exchange additional data...............................................248 August 2008 311 .......................................239 Figure 69 Example for layout with UI components from both files (layout-config and ipclayout-config)...........................................................170 Figure 39: Statis extensions to the UI layer .........................189 Figure 55: Action flow with CustomActions .........................................................................................................................................................................200 Figure 60: Creating own BOM................................................................................Development and Extension Guide – SAP E-Commerce 7...................................199 Figure 58: Create own BOM..........................................................................................................................201 Figure 61: Creating interface for Business Object.................188 Figure 54: Exchange additional data with the Java basket .......................................................................................................175 Figure 44: Transfer additional output data from aciton class to JSP ........................240 Figure 71 Example for tiles...................................................................245 Figure 75 XCM settings for customer buttons ....................................................................................................225 Figure 64: Java event listener for Standard Function Modules...................................................................................................202 Figure 63: Adding additional Function Modules ................191 Figure 56: BOBase class .........173 Figure 42: Extensions to exchange data with UI layer.................................................. .........................................................Development and Extension Guide – SAP E-Commerce 7.................................................................................................................................296 Figure 94: Action flow of one request .........................................................297 Figure 96: Interrupted action flow ...........................253 Figure 83 Handling extension data at client objects ..................280 Figure 92: Displaying name of JSP-Files in E-Commerce Applications ...................................................................................................................................................................................277 Figure 91: XCM .............................250 Figure 79 Customer tab action mapping................... (ISA B2B)...251 Figure 81 Creating UIBeans via UIBeanFactory ..........252 Figure 82 Standard customer exit in actions............................................................................................................................268 Figure 89: Changed flow of actions ....................................................................................................................................................................................................................................249 Figure 78 Application configuration for customer tab ...............................................250 Figure 80 Customer tab with characteristic details......................................................................................................................................................................................................................................................260 Figure 88: Original flow of actions ...........parameter shorttexts.....................................................257 Figure 85: Activities of the isaPerform() method of the UpdateDocumentViewAction...............................290 Figure 93: Calling the application with additional request parameters ...........................................296 Figure 95: Original action flow.............................................................................259 Figure 87: Display a new Document type with the UpdateDocumentView Module.....................258 Figure 86: Creation of a new order...................269 Figure 90: Adding and configuring new parameter (XCM).......................................297 August 2008 312 ......0 Figure 77 Component configuration for customer tab ..................................................................................255 Figure 84: Main objects of the UpdateDocumentView module .........................................................................................................................
Copyright © 2024 DOKUMEN.SITE Inc.