Effective Web Dynpro - Adaptive RFC Models

Similar documents
SAP NetWeaver 04, 7.0, 7.01, CE 7.1, CE 7.11

HOW TO USE THE WEB DYNPRO CONTENT ADMINISTRATOR. SAP NetWeaver 04 SP Stack 9 JOCHEN GUERTLER

Enhancing Web Dynpro Table Performance

Advanced Input Help - The Object Value Selector (OVS)

Tutorial. Unit: Interactive Forms Integration into Web Dynpro for Java Topic: Dynamically generated forms

How-To Guide SAP NetWeaver Document Version: How To... Configure CM Services in SAP NetWeaver 7.3 and up

Inside Web Dynpro for Java

Teiid Designer User Guide 7.5.0

How to Create Business Graphics in Web Dynpro for ABAP

SAP NetWeaver How-To Guide How To... Configure SAP HANA for CTS

SAP NetWeaver 2004s: Learning Map for Development Consultants

How To Create FPM Application consuming CDS view using ACT

WDJ: Adaptive Web Service Model Controller Coding Explained

Migration Guide. SAP Web Application Server Release 6.40 J2EE and Web Dynpro for Java

Tutorial. Interactive Forms Integration into Web Dynpro for Java Topic: Working with the PdfObject API

COURSE LISTING. Courses Listed. Training for Database & Technology with Development in ABAP Dialog Programming. Beginner. Intermediate.

Project Management. Projects CHAPTER

SQL*Loader Concepts. SQL*Loader Features

Identity Provider for SAP Single Sign-On and SAP Identity Management

Freely Programmed Help- Web Dynpro

Uploading and Downloading Files in Web Dynpro Java

Access SAP Business Functions (ABAP) via Web Services

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

Preface 7. 1 Introduction to OpenUI5 9

COURSE LISTING. Courses Listed. with ABAP Dialog Programming. 25 December 2017 (08:57 GMT) NW001 - SAP NetWeaver - Overview

Creating Your First Web Dynpro Application

Accessing ABAP Functions in Web Dynpro Java

Can be used in diverse languages / Development Environments

Kubernetes Integration with Virtuozzo Storage

BAPI Execution in offline Adobe Form

SAP BusinessObjects Performance Management Deployment Tool Guide

FUNCTION MODULE. BAPI are RFC enabled function modules. Might Be Remote Enabled or May not be Remote Enabled

How to Use Web Dynpro Popup Menus

Using SAP NetWeaver Business Intelligence in the universe design tool SAP BusinessObjects Business Intelligence platform 4.1

Oracle Fusion Middleware 11g: Build Applications with ADF I

This download file shows detailed view for all updates from BW 7.5 SP00 to SP05 released from SAP help portal.

Change and Transport Management

Handling Transactions with BAPIs in Web Dynpro

BEAAquaLogic. Service Bus. Interoperability With EJB Transport

Implementing Business Objects in CAF and Developing Web Dynpro Application

SAP Asset Manager Configuration Guide for Android

Mastering Oracle ADF Task Flows. Frank Nimphius Principal Product Manager Oracle JDeveloper / ADF

What s new in IBM Operational Decision Manager 8.9 Standard Edition

Veteran's Guide. Visual Composer for. Document Version 2.00 March SAP NetWeaver 7.3

JCo 3.0 in Web Channel 7.54

Upload Image file from system in Web dynpro view

Oracle Policy Automation Connector for Siebel V10.2 Release Notes

Visual Composer Build Process

Creation of Alert Data Service VC model for the BI query exception using Information Broadcasting

CaptainCasa Enterprise Client. CaptainCasa Enterprise Client. CaptainCasa & Java Server Faces

How to create a custom step for GPA With Solution Manager 7.1

STARCOUNTER. Technical Overview

Oracle Fusion Middleware 11g: Build Applications with ADF I

MetaBase Modeler User s Guide MetaMatrix Products, Release 4.2 SP2 (Second Service Pack for Release 4.2) Document Edition 1, June 10, 2005

Distributed Systems Theory 4. Remote Procedure Call. October 17, 2008

Developing with Tables in Web Dynpro

SAP Certified Development Associate ABAP with SAP NetWeaver 7.02

Uploading and Downloading Files in Web Dynpro Java

Data Handling in the SAP NetWeaver System Landscape Directory Step by Step

Setup an NWDI Track for Composition Environment Developments

Copyright...4. Overview Managing Snapshots... 6

UNIT V *********************************************************************************************

Creating Rules in Process Composer and using them in Process

Manual Trigger Sql Server Update Column Example

Mobile Application Workbench. SAP Mobile Platform 3.0 SP02

K Hinds Page 1. Information Communication Technology Microsoft Access

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

DREAMFACTORY SOFTWARE INC. Snapshot User Guide. Product Usage and Best Practices Guide. By Sathyamoorthy Sridhar June 25, 2012

COGNOS (R) 8 GUIDELINES FOR MODELING METADATA FRAMEWORK MANAGER. Cognos(R) 8 Business Intelligence Readme Guidelines for Modeling Metadata

SAP Automation (BC-FES-AIT)

Importing BW Objects

ADF OAF Who Cares? You Do! Oracle Applications Framework / Application Development Framework - Which way do I go?

DocAve 6 Administrator

Map-Reduce. Marco Mura 2010 March, 31th

Nuxeo Server 9.1 Release Notes

PrimoPDF Enterprise User Guide, Version 5.0

The Evolution of Java Persistence

How to Integrate SAP xmii Services with Web Dynpro Java

A Practical Approach to Balancing Application Performance and Instrumentation Information Using Symantec i 3 for J2EE

Business Process Monitoring for non-abap/non-sap

Integration Service. Admin Console User Guide. On-Premises

Teiid Designer User Guide 7.7.0

Xpert BI General

Interface Documentation in Solution Documentation

SAP BW 3.5 Enhanced Reporting Capabilities SAP AG

IBM Best Practices Working With Multiple CCM Applications Draft

Microsoft Dynamics Road To Repeatability Technical Deep Dive Server Extensibility in Microsoft Dynamics NAV. Vjekoslav Babić, MVP

Educational soft presenting particularities through special functions of ABAP List Viewer in Web Dynpro technology

CHAPTER. Oracle Database 11g Architecture Options

SAP Certified Associate Technology Architect print view[link to: same link]

Information Design Tool User Guide SAP BusinessObjects Business Intelligence platform 4.0 Support Package 4

A Step-by-Step Guide on IDoc-to- JDBC Using Business Service in the XI Integration Directory

A Guide to CMS Functions

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004

1. Introduction. 2. Technology concepts

SETTING UP SALESFORCE KNOWLEDGE

5 Introduction to OData Service Creation

Migration of Interface Monitoring in classical BPMon to Interface & Connection Monitoring SAP Solution Manager 7.1 / 7.2

Vendor: SAP. Exam Code: C_HANATEC131. Exam Name: SAP Certified Technology Associate (Edition 2013) -SAP HANA. Version: Demo

New Features Summary. SAP Sybase Event Stream Processor 5.1 SP02

Transcription:

Effective Web Dynpro - Adaptive RFC Models Bertram Ganz, NWF Web Dynpro Foundation for Java Overview In many Web Dynpro applications, backend access is based on RFC modules in SAP systems. The Web Dynpro for Java Foundation provides a cutting-edge technology for accessing RFCs in the Adaptive RFC Adapter. This article reviews some basic principles and guidelines ("do's" and "don'ts") for the effective use of Adaptive RFC models in Web Dynpro. Starting with a general description of adaptive RFC features and benefits, two important performance issues related to RFC parameters are discussed. Another important topic is the relationship between RFCs, Adaptive RFC models, and Web Dynpro development components. We will provide some rules of thumb for an optimal partitioning of these entities inside your Web Dynpro application. Finally, the article describes restrictions when utilizing the adaptability features of an Adaptive RFC adapter. Contents 1. Recommended Do s Do (1): Apply Adaptive RFC Models for Accessing RFC Modules in SAP Systems Do (2): Put as Many RFCs in a Single Adaptive RFC Model as Possible Do (3): Place Web Dynpro Models into Separate DCs for Optimizing the Development Performance Do (4): Consider Given Restrictions when Utilizing Adaptability 2. Recommended Don ts Keywords Don t (1): Do Not Transfer Table Values as Export or Import Parameters Don t (2): Do Not Embed Tables within RFC Import, Export, or Table Parameters Don t (3): Do Not Implement Data-Intensive Operations on the UI Layer Don t (4): Do Not Put Different Models into the Same Java Package Adaptive RFC Adapter, Adaptive RFC models, RFC, JCo, performance, export-parameters, importparameters, table-parameters, deployment granularity of Adaptive RFC models, adaptability, adaptability restrictions, closed namespace Icons in Body Text The do s and don'ts are divided into two categories: performance relevant and general recommendations. Each category is marked with a different icon. Icon Meaning Performance relevant recommendation General recommendation Related Tutorials Some specific Web Dynpro tutorials dealing with Adaptive RFC models can be found on the SAP Developer Network (SDN) at http://sdn.sap.com. The tutorials and project ZIP files are available for download under the category Home Developer Areas Web Application Server Web Dynpro. Effective Web Dynpro Adaptive RFC Models 1

Accessing SAP Backend in Web Dynpro Handling Transactions with BAPIs in Web Dynpro 1. Recommended Do s Do (1): Apply Adaptive RFC Models for Accessing RFC Modules in SAP Systems With the Adaptive RFC Adapter, the Web Dynpro for Java Foundation provides its own technology for accessing Remote Function Call (RFC) modules that are exposed in an SAP system. SAP strongly recommends using the Adaptive RFC Adapter instead of implementing another technique for accessing RFCs based on the JCo communication layer. The Adaptive RFC Adapter yields the following benefits: Low Memory Consumption: The Adaptive RFC Adapter was optimized for typical user interface scenarios. Therefore, even if large amounts of data are returned by an RFC call, only the data directly required by and displayed on the user interface is unmarshalled, which yields lower memory consumption. In this respect you should obey the following rule, which is explained at the end of this article: Don t (3): Do not implement data-intensive operations on the UI layer. Automatic Model Generation: The Adaptive RFC Model importer provided by the Web Dynpro tools automates the generation of a complete model access layer based on a given RFC module. This access layer allows the calling of any RFC from within Web Dynpro with minimal hand-written code. In some cases, no hand-written code is necessary at all because wizards exist for generating the necessary code automatically. Dictionary Integration: The Adaptive RFC Adapter is a dictionary-based interface. At design time, all structures, fields, and simple data types used by the imported RFC module are replicated in a logical dictionary. The generated model classes can be bound to structures in the logical dictionary so that the model attributes represent structure fields or model class properties can reference dictionary simple types. At design time, the snapshot of all dictionary types belonging to an Adaptive RFC model can be used for various declarations, like binding context nodes to dictionary structures (context-tostructure binding) or typing context attributes using dictionary simple types. At runtime, the model dictionary uses a provider infrastructure to get all types of information online from the SAP backend system. This runtime access of dictionary metadata provides the basis for type-specific services, like displaying field labels, column headings, tool tips, populating value sets; or, formatting lengths, currencies, and units). Adaptability: Based on the Java Dictionary Runtime, the Adaptive RFC Adapter can handle the arrival of new fields within an existing structure at runtime. It can adapt to modifications such as the addition of new fields (extension fields) to append structures in standard SAP tables or changes of field lengths, label texts, and value sets. There is no application coding required for getting all dictionary-based runtime services. The user interface support of the Adaptive RFC Adapter is not yet adaptive, but dynamic. This means that the application developer has to manage the visibility of extension fields based on a dynamic view layout modification. Destination Configuration: The Adaptive RFC Adapter provides a mechanism for mapping logical system names defined at design time to physical systems not known until runtime. This includes some advanced mechanisms, e.g. for mapping a logical system to a specific physical system on a per-user, per-role, or per-session basis. This allows integrating Adaptive RFCbased applications in many different system landscapes. Effective Web Dynpro Adaptive RFC Models 2

...... SAP NetWeaver SP Stack 09 Model Reimport: The model reimport functionality provided by the Web Dynpro tools allows resynchronizing a model to the current RFC module version in the backend. New fields, structures, and datatypes are then also available at design time. Value-Added Features: The Adaptive RFC Adapter provides many value-added features for accessing RFC modules from within your Web Dynpro application. Besides dictionary integration it includes a sophisticated connection and lifecycle management, automated data transport, backend type conversions, and generic services based on the Common Model Interface API (CMI) or the Web Dynpro Runtime API like the WDCopyService, IWDModelClassChangeTracking or IWDModelRegistry. Do (2): Put as Many RFCs in a Single Adaptive RFC Model as Possible Do: Principally, you should put as many RFCs in a single Adaptive RFC Model as possible. Consider this rule of thumb with regard to using Adaptive RFC Models in Web Dynpro for the following reasons: 1. Closed Namespace: A model is imported into a closed namespace; therefore, any commonly used datatypes or structures can be shared only within a single model. The term closed namespace means that the definition of dependencies between Adaptive RFC models is not supported. In this respect you should strictly adhere to the rule that two models must be put into two different namespaces or Java packages. The best example for this restriction is the Return structure of BAPIs (Bapiret2). If you import two RFCs (BAPIs) in different models, then you will receive two different classes representing Bapiret2. You can therefore no longer build any common functionality for parsing and interpreting the Return value of multiple BAPIs. You cannot share references, which means you cannot pass data by reference from one RFC to another. Instead, you would be forced to copy, e.g. via the WDCopyService. 2. Connection: A model represents a number of services that are required at runtime. The most important one is the connection (JCO.Client). If you import two RFCs in two different models, then each model will require, by default, a connection to be assigned at runtime. In most cases though, you might want to share the connection between multiple RFC calls, therefore it is wise to keep those RFCs in a single model. It is possible to share a connection between multiple models (see Method IWDDynamicRfcModel.setConnectionProvider() ), but it is still easier if you are not forced to do this. 3. Reimport: Reimport functionality exists, so you are able to update an existing model and add further RFCs as needed. In the past, this was often the reason for using multiple models. This problem no longer exists. Use Cases for Separate Models You may still wish to separate models, and there are use cases for this. Here are some situations in which you would do this: 1. Different Backend Systems: You need to access different RFCs in different backend systems, e.g. RFC A accesses System A and RFC B accesses System B. This requires using different connections; therefore, you must use different models. 2. Different RFC Lifecycles: E.g. RFC A belongs to a different business package than RFC B. This could lead to updates in RFC A that would not affect RFC B. If this is known at development time, then it is wise to also keep these RFCs independent of each other by Effective Web Dynpro Adaptive RFC Models 3

importing them into different models. This is usually only the case in larger development projects involving many developers. 3. Componentization: If you make strong use of Web Dynpro components that are contained in different DCs, then you may also want to split up RFC models to prevent them from getting too big, and to avoid unnecessary dependencies. E.g. Web Dynpro Component A (part of DC A) uses RFC A and Web Dynpro Component B (part of DC B) uses RFC B. But the two components have nothing to do with each other. In this case, you have the option of either importing a single common model and placing it in a different DC (lets say DC X) to prevent DC A and DC B from getting dependent on each other. Alternatively, you can import two different models and place each model in the DC in which it is used: RFC A is imported into Model A and placed in DC A. RFC B is imported into Model B and placed in DC B. Do (3): Place Web Dynpro Models into Separate DCs for Optimizing the Development Performance For optimizing the performance of a single edit-deploy-run cycle, the deployment granularity plays a decisive role. Consider the following rule of thumb regarding the separation of Web Dynpro models. Do: Principally, Web Dynpro models should be separated into separate (model) DCs (one model per DC). These models can be referenced in other Web Dynpro components based on a defined DC usage. It is a better strategy to separate models into another DC and expose them as public parts. Typically, models contain classes that do not change during development, especially if the interfaces have been defined thoroughly. Since it is optional to build dependant components during design and build time, the development component that holds the models can be excluded from the build, thereby reducing build time as well as deploy time. Since Different DCs are not allowed to share the same namespace, placing each model in a different DC enforces the following rule: Do: Put each model in its own namespace or Java package. Do (4): Consider Given Restrictions when Utilizing Adaptability When utilizing the adaptability features of an Adaptive RFC model, you have to consider some restrictions in SAP NetWeaver 04. Custom Fields Do Not Show Up in the Context Node at Design Time When adding custom fields, NO new code is generated. Therefore, these new fields are not accessible via typed APIs. But they are available at runtime using generic APIs. The following code can therefore be used for accessing a new field called CustomField. wdcontext.currentrfcstructureelement().getattributevalue("customfield"); For accessing runtime information about all fields in a given dictionary structure, you can access the IStructure-API: IWDNodeInfo nodeinfo = wdcontext.nodeaddressdata().getnodeinfo(); IStructure structure = nodeinfo.getstructuretype(); Effective Web Dynpro Adaptive RFC Models 4

Adding New Tables or Complex Structures It is not possible in SAP NetWeaver 04 to add new complex structures or tables as custom extensions, and also be able to access these via Adaptive RFC. Only existing structures and tables used within your RFC function modules can be extended (with scalar fields). Doing this will possibly cause runtime errors and may also lead to inconsistencies in your application, because the additional data (customer extensions) will not be available. Adding New Scalar Fields Directly as RFC Input or Output Parameters Due to a restriction in the RFC layer, it was not possible to dynamically identify new scalar parameters added directly to the input/output section of an RFC function module. Therefore, adding fields can only be done if the structure was defined using a dictionary structure. You can identify a model class, which can be extended by the customer, by checking if the model class has a dictionary structure binding. Simply open (double-click) the model class of your choice, and in the Overview tab you will see whether a dictionary structure binding exists. Notice that Input and Output model classes DO NOT have such a structure binding. Therefore, adding new fields to these structures will not work. It is not wise to directly manipulate the input and output structures of RFCs directly anyway, as this will lead to merge conflicts. By design, SAP suggests using Append Structures in combination with BAPIs for doing custom extensions. Changes in Append Structures are fully supported by the Adaptive RFC framework. 2. Recommended Don ts Don t (1): Do not Transfer Table Values as Export or Import Parameters In contrast to the recommended RFC design, the transmission of tables via RFC in import/export or changing parameters (which should never be used) is not recommended. In this case, tables are transported marshalled in XML as blob (binary large object). The transportation of XML is performance as well as memory intensive. The problem is based in RFC-communication and there is no generic performance optimization for this issue available in the current release. The solution for the problem is easy and not very work-intensive: Don t: Do not transfer table values as export or import parameters. Do: Change your Adaptive RFC interface so that all table values are transferred as table parameters and not within export/import/changing parameters. A model-reimport is only needed at design-time when a table that was defined as an import or export parameter before is then defined as a table parameter. In this case, some model classes must be extended by an additional relation. The described solution is only recommended if the SAP-datatype XString and complex structures are not used within the table, otherwise no solution exists yet. So please be aware of this known limitation in the design phase of your project and consequently use, if possible, a length-limited datatype, like char[10] instead of a XString. Don t (2): Do Not Embed Tables within RFC Import, Export or Table Parameters In addition to the problem with tables in export, input, or changing parameters, the existence of complex structures or tables in tables results in a performance-critical overhead of XML metadata Effective Web Dynpro Adaptive RFC Models 5

to be transferred. The reason is that the RFC implementation can not calculate the complete length of these structures. Consequently, all kinds of metadata for each row and column is transferred via XML: the amount of data for these tables is very large, which can possibly lead to a substantial decrease in performance. Don t: Do not embed, or at least try to avoid embedding tables within RFC import, export, or table parameters. Instead flatten all complex structures in the given RFC parameters. The recommended solution to the problem can only be seen as a workaround because it often results in time consuming reimplementations and adaptations on the client side (Web Dynpro Adaptive RFC model generation, context-to-model-binding). Don t (3): Do Not Implement Data-Intensive Operations on the UI Layer As already mentioned, the implementation of the Adaptive RFC adapter was optimized for typical user interface scenarios. Based on the defined binding mechanisms between the UI and the Adaptive RFC model (data binding, context mapping, and context-to-model binding) only the data directly required by and displayed on the user interface is unmarshalled, which yields lower memory consumption. Because the unmarshalling process of RFC-based data can be quite memory intensive, it is important to reduce it to a minimum. But this feature can be undermined if data-intensive operations like filtering or sorting take place on the UI layer (within Web Dynpro). Therefore you should obey the following rules: Don t: Do not implement data-intensive operations on the UI layer, for example sorting and filtering of context model node elements. Do: Instead, these data-intensive operations (such as sorting, filtering) should already take place in the backend implementation (the RFCs) itself. Don t (4): Do Not Put Different Models into the Same Java Package Don t: Do not put different models into the same Java package. Instead, every model should reside in its own separate namespace. The explanation of this recommendation is given in the following two sections: Do (2): Put as Many RFCs in a Single Adaptive RFC Model as Possible Do (3): Place Web Dynpro Models into Separate DCs for Optimizing the Development Performance Acknowledgements Many thanks to Markus Cherdron, Frank Weigel and Jörg Singler for their valuable feedback and helpful suggestions on the given recommendations. Effective Web Dynpro Adaptive RFC Models 6