Value Help in Web Dynpro ABAP - Tutorial.

Similar documents
Visual Composer - Task Management Application

MDM Syndicator Create Flat Syndication File

Working with Select Options in Web Dynpro for ABAP

Consuming Web Dynpro components in Visual Composer.

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

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

Install TREX for CAF Version 1.00 March 2006

What s New / Release Notes SAP Strategy Management 10.1

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

Web Page Composer anonymous user access

Cache Settings in Web Page Composer

Visual Composer Build Process

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

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

How to Use Function Keys in Mobile Applications for Handhelds

Dynamic Context Menus in Web Dynpro ABAP.

Do Exception Broadcasting

Data Validation in Visual Composer for SAP NetWeaver Composition Environment

Building a Tax Calculation Application

How to Translate a Visual Composer Model Part I

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

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

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

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

How to Create a New SAPUI5 Development Component

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

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

configure an anonymous access to KM

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

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

Create Partitions in SSAS of BPC Version 1.00 Feb 2009

Tutorial: Consuming Web Services in Web Dynpro Java

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

SAP MII: Leveraging the Data Buffering Feature for Connection Error Handling.

How to Browse an Enterprise Services Registry in Visual Composer

View Time Security for crystalreports.com

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

How To Extend User Details

Configure SSO in an SAP NetWeaver 2004s Dual Stack

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

Enterprise Portal Logon Page Branding

How To...Configure Integration of CUP with SPM

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

Process Control 2.5 Implementation Checklist

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

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

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

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

Introducing SAP Enterprise Services Explorer for Microsoft.NET

How To Troubleshoot SSL with BPC Version 1.01 May 2009

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

SAP NetWeaver How-To Guide

Extracting Product Attributes in XML using Web Service

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

Simplified Configuration of Single System Update in Maintenance Optimizer

Web Dynpro Java for Newbies: a Quick Guide to Develop Your First Application

How To Configure IDoc Adapters

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

How To... Master Data Governance for Material: File Down- and Upload

Create Monitor Entries from a Transformation routine

xmii UDS Overview and Troubleshooting

Consuming Directory API in ABAP

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

Integrate a Forum into a Collaboration Room

Installation Guide Business Explorer

Monitoring System Landscapes Using the DBA Cockpit

Simplifying the Capturing, Evaluation, and Communication of Class-Based Exceptions

Create Monitor Entries from an update routine

Extract Archived data from R3

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

SAP NetWeaver How-To Guide How to use Process Execution Manager Using SAP Test Data Migration Server

BusinessObjects Enterprise XI 3.0 with Complex NAT Networks

How To Generate XSD Schemas from Existing MDM Repositories

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

How To Customize the SAP User Interface Using Theme Editor

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

How To...Custom BADI for rounding off values in SAP BUSINESSOBJECTS Planning and Consolidation, version for SAP NetWeaver.

Business Rules Framework plus Workbench

SAP - How-To Guide MDG Custom Object Data Replication How to Configure Data Replication for MDG Custom Objects (Flex Option)

Setting up Single Sign On Between xmii and Enterprise Portal

SAP Composite Application Framework. Creating a Content Package Object

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

SAP NetWeaver How-To Guide. SAP NetWeaver Gateway Virtualization Guide

WDJ: Adaptive Web Service Model Controller Coding Explained

Setting Up an Environment for Testing Applications in a Federated Portal Network

How to Use Definitions in Rules Composer

Accessing ABAP Functions in Web Dynpro Java

Using Business Graphics

Access Control 5.3 Implementation Considerations for Superuser Privilege Management ID-Based Firefighting versus Role-Based Firefighting Applies to:

Using Tools to Represent Appraisal Status Flow (HR module Objectives Settings and Appraisals ) as Diagram

Setup an NWDI Track for Composition Environment Developments

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

Use the BI Java SDK in a Web Dynpro Application Version 1.01 July 2005

DOE s Attachment Capability - with a Sample Application

SAP NetWeaver How-To Guide

Project Systems: Hierarchical structure and Table Links

How To... Use the BPC_NW Mass User Management Tool

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

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

Line Items in BI Integrated Planning

Transcription:

Value Help in Web Dynpro ABAP - Tutorial. Applies to: Web Dynpro for ABAP, For more information, visit the Web Dynpro ABAP homepage. Summary In this tutorial I want to explain how to set value help for UI elements of your Web Dynpro ABAP application. Author: Patrick Johann Company: SAP Created on: 12. March 2009 Author Bio Patrick Johann is in the first year of Vocational Training as an IT Specialist Application Development at SAP. At the moment he is working in a SAP Net Weaver Product Management User Interaction Team and is doing Web Dynpro for ABAP. 2008 SAP AG 1

Table of Content Exercise Objectives:...3 Know and use the different kinds of value helps...3 Process at runtime:...3 Procedure:...3 READ_CARRID:...3 VALUESET_CARRID:...4 Related Contents...5 Copyright...6 2009 SAP AG 2

Exercise Objectives: Know and use the different kinds of value helps Create a DropDownByKey UI-element and define the value help dynamically Process at runtime: The user looks at a view which offers a drop down input field and three regular input fields. They don t have an effect but every element has its own value help. Procedure: 1. Start the Object Navigator (transaction code SE80). Create a new Web Dynpro component (suggested name: Z##_VALUE_HELP ), one window and one view (suggested names: MAIN_WINDOW and MAIN_VIEW ). Embed the view in the window if it hasn t been done automatically. 2. Navigate to COMPONENTCONTROLLER. Create a context node named FLIGHTINFO (cardinality 1:1) with the type of the dictionary structure SFLIGHT, and with the attributes CARRID, CONNID, FLDATE und PRICE. 3. Click on the attribute CARRID. With the click the attribute properties appear below. Look at the Input Help Mode property and change it to automatically if it isn t set already to it. Do the same with the FLDATE attribute. For CONNID choose Dictionary Search Help, and for PRICE deactivate the help mode, because we don t want a value help for this input. The automatic help mode will be defined at Web Dynpro runtime. It uses an already defined value help from the dictionary element you use. The Dictionary Search Help property allows the developer to choose a dictionary defined value help. 4. Now we want to set an individual value set for the CARRID attribute. This has to been done dynamically in the view controller, but first we have to write a few lines of code to get the data from the dictionary. Create a new method in the component controller (suggested name: READ_CARRID ). Define an exporting parameter of type WDY_KEY_VALUE_TABLE in the signature of your created method. To get the data from the dictionary you only have to code an array fetch on the table SCARR into your itab. Select the fields Carrid and Carrname. Then order the itab by carrid. READ_CARRID: METHOD read_carrid. SELECT carrid carrname FROM scarr INTO TABLE e_carrier_vs ORDER BY carrid. ENDMETHOD. 2009 SAP AG 3

5. Now navigate to the view controller and add a new method (suggested name: VALUESET_CARRID ). Use the code wizard to call the created method in your component controller. Moreover declare two local objects with reference to IF_WD_CONTEXT_NODE and IF_WD_CONTEXT_NODE_INFO. Navigate from the context to FLIGHTINFO with the context method get_child_node( ). After that, call the method get_node_info( ). To set the new value set, call the method set_attribute_value_set( ) of your local node info. VALUESET_CARRID: METHOD valueset_carrid. DATA lo_nd_flightinfo TYPE REF TO if_wd_context_node. DATA lo_nd_info_flightinfo TYPE REF TO if_wd_context_node_info. DATA lt_value_set TYPE wdy_key_value_table. DATA lo_componentcontroller TYPE REF TO ig_componentcontroller. lo_nd_flightinfo = wd_context->get_child_node( name = 'FLIGHTINFO' ). lo_nd_info_flightinfo = lo_nd_flightinfo->get_node_info( ). lo_componentcontroller = wd_this->get_componentcontroller_ctr( ). lo_componentcontroller->read_carrid( IMPORTING e_carrier_vs = lt_value_set ). lo_nd_info_flightinfo->set_attribute_value_set( name = 'CARRID' value_set = lt_value_set ). ENDMETHOD. 6. Open the hook method WDDOINIT of the view and implement the method that you created in the previous step to get the value set BEFORE the view is displayed. 7. Now we go back to the COMPONENTCONTROLLER and have a look at the node attribute CONNID. In step three we chose the dictionary search as the help mode. You get another input field called Dictionary search help. Enter ZSHG_H_SPFLI_CONNID. This value help shows more details to the connection than the regular help for the CONNID field. 8. Map the Context from your controller to the context of the view and implement a form on the layout with the code wizard and display all node attributes. 9. Finally delete the generated Input Field for Carrid and replace it by a DropDownByKey UI element. Bind the necessary selectedkey property to Carrid and correct the generated label. 2009 SAP AG 4

Related Contents For more information, visit the Web Dynpro ABAP homepage. For more information, visit the User Interface Technology homepage. 2009 SAP AG 5

Copyright 2009 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iseries, pseries, xseries, zseries, System i, System i5, System p, System p5, System x, System z, System z9, z/os, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/os, POWER, POWER5, POWER5+, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mysap, mysap.com, xapps, xapp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. These materials are provided as is without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. Any software coding and/or code lines/strings ( Code ) included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent. 2009 SAP AG 6