Working with Select Options in Web Dynpro for ABAP

Similar documents
MDM Syndicator Create Flat Syndication File

Visual Composer - Task Management Application

Value Help in Web Dynpro ABAP - Tutorial.

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

Consuming Web Dynpro components in Visual Composer.

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

What s New / Release Notes SAP Strategy Management 10.1

Do Exception Broadcasting

Web Page Composer anonymous user access

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

Cache Settings in Web Page Composer

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

Data Validation in Visual Composer for SAP NetWeaver Composition Environment

Install TREX for CAF Version 1.00 March 2006

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

Visual Composer Build Process

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

How to Use Function Keys in Mobile Applications for Handhelds

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

How to Translate a Visual Composer Model Part I

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

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

How to Browse an Enterprise Services Registry in Visual Composer

configure an anonymous access to KM

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

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

How to Create a New SAPUI5 Development Component

Configure SSO in an SAP NetWeaver 2004s Dual Stack

Building a Tax Calculation Application

Enterprise Portal Logon Page Branding

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

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

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

How To...Configure Integration of CUP with SPM

View Time Security for crystalreports.com

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

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

How To Extend User Details

SAP NetWeaver How-To Guide

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

Integrate a Forum into a Collaboration Room

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

Create Partitions in SSAS of BPC Version 1.00 Feb 2009

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

Introducing SAP Enterprise Services Explorer for Microsoft.NET

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

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

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

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

Consuming Directory API in ABAP

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

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

How To Troubleshoot SSL with BPC Version 1.01 May 2009

How To Configure IDoc Adapters

Create Monitor Entries from a Transformation routine

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

Create Monitor Entries from an update routine

Tutorial: Consuming Web Services in Web Dynpro Java

Monitoring System Landscapes Using the DBA Cockpit

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

Extracting Product Attributes in XML using Web Service

SAP Composite Application Framework. Creating a Content Package Object

xmii UDS Overview and Troubleshooting

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

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

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

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

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

SAP NetWeaver How-To Guide

Accessing ABAP Functions in Web Dynpro Java

Extract Archived data from R3

Installation Guide Business Explorer

WDJ: Adaptive Web Service Model Controller Coding Explained

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

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

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

BusinessObjects Enterprise XI 3.0 with Complex NAT Networks

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

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

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

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

Building Custom Applications Using IBOM

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

How To Generate XSD Schemas from Existing MDM Repositories

How To Customize the SAP User Interface Using Theme Editor

Business Rules Framework plus Workbench

How to Use Definitions in Rules Composer

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

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

DOE s Attachment Capability - with a Sample Application

JMS Clustering and Failover

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

What's New in the DBA Cockpit with SAP NetWeaver 7.0

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

Configure Peripheral Drivers with Mobile Infrastructure

Project Systems: Hierarchical structure and Table Links

Using Business Graphics

Transcription:

Working with Select Options in Web Dynpro for ABAP Applies to: SAP ECC 6.0 (Release 700, SP 12). Summary To show a select options screen in Web Dynpro ABAP we have to use SAP s Standard component. This article will brief you about how to use sap standard Web Dynpro component WDR_SELECT_OPTIONS. Select options in Web Dynpro work the same way as in ABAP reports. Author: Abhimanyu Lagishetti Company: Satyam Computer Services Ltd. Created on: 17 December 2007 Author Bio Abhimanyu L, Satyam Computer Services Ltd B.Tech Computer Science Graduate, working on Technologies like Web Dynpro Java, Web Dynpro ABAP, Enterprise Portals and Business Workflows. 2007 SAP AG 1

Table of Contents Applies to:...1 Summary...1 Author Bio...1 Introduction...2 Select-Options in ABAP...2 Select-Options in Web Dynpro for ABAP...3 Related Content...6 Copyright...7 Introduction Let s start with an application which shows a select-options screen field Airline ID of type S_CARR_ID and displays the entered values in a table control. Select-Options in ABAP Using Select-Options, the user can specify complex selection criteria. If the selection criteria is complex, you need not write lengthy logical expressions in the select query, which is solved by the select-options statement. Select-Options defines a range table which is having four columns Sign, Option, Low and High. In Reports you use select-options statement to hold range of values, which can be illustrated from the following ABAP code: data: s_carr_id type s_carrid. select-options : r_carrid for s_carr_id. This will declare a range table called r_carrid to hold single values and ranges. The selection screen will look like this: 2007 SAP AG 2

Select-Options in Web Dynpro for ABAP Create a Web Dynpro Component ZTEST_SELECT_OPTIONS. Add the Component Usage to use the standard component WDR_SELECT_OPTIONS Create a View and create the context to store the Range table. SIGN TYPE SIGN, OPTION TYPE OPTI, LOW TYPE S_CARR_ID, HIGH TYPE S_CARR_ID 2007 SAP AG 3

Add the Component Usage and the Interface Controller of the Select Option to the created View in Properties Tab. Design the View as shown, place a viewcontaineruielement to show the Select-Options screen, a button to fetch the entered values and a table to display the range table. At this point of time, the selection-screen is empty as we have not supplied any data to the component WDR_SELECT_OPTIONS to display a selection-screen. The following code is to show Airline ID as the selection screen item, put this code in the WDDOINIT. method WDDOINIT. DATA: LR_SELECT_OPTIONS TYPE REF TO IWCI_WDR_SELECT_OPTIONS. DATA LR_HELPER TYPE REF TO IF_WD_SELECT_OPTIONS. DATA: LT_RANGE TYPE REF TO DATA. DATA: LR_COMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE. 2007 SAP AG 4

*This code is to instantiate the component WDR_SELECT_OPTIONS LR_COMP_USAGE = WD_THIS->WD_CPUSE_SELECT_OPTIONS( ). IF LR_COMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL. LR_COMP_USAGE->CREATE_COMPONENT( ). ENDIF. *call the interface controller method init_selection_screen to get the helper class LR_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ). LR_HELPER = LR_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ). *Use the helper class to create a range table for the data element S_CARR_ID LT_RANGE = LR_HELPER->CREATE_RANGE_TABLE( I_TYPENAME = 'S_CARR_ID' ). *Add a Selection Screen Field LR_HELPER->ADD_SELECTION_FIELD( I_ID = 'S_CARR_ID' IT_RESULT = LT_RANGE ). endmethod. Create an Action and bind the action to the Button you placed in the Layout, Provide the following code in the event handler to fetch the input values that user entered at runtime. method ONACTIONSEARCH. DATA: LR_SELECT_OPTIONS TYPE REF TO IWCI_WDR_SELECT_OPTIONS. DATA LR_HELPER TYPE REF TO IF_WD_SELECT_OPTIONS. DATA: LT_RANGE TYPE REF TO DATA. FIELD-SYMBOLS: <LT_RANGE_TABLE> TYPE WD_THIS->ELEMENTS_RANGE, <LS_FIELD> TYPE LINE OF IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM. DATA: LR_COMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE. DATA: LT_FIELDS TYPE IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM. LR_COMP_USAGE = WD_THIS->WD_CPUSE_SELECT_OPTIONS( ). IF LR_COMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL. LR_COMP_USAGE->CREATE_COMPONENT( ). ENDIF. LR_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ). LR_HELPER = LR_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ). LR_HELPER->GET_SELECTION_SCREEN_ITEMS( IMPORTING ET_SELECTION_SCREEN_ITEMS = LT_FIELDS ). READ TABLE LT_FIELDS ASSIGNING <LS_FIELD> INDEX 1. ASSIGN <LS_FIELD>-MT_RANGE_TABLE->* TO <LT_RANGE_TABLE>. DATA : LR_RANGE TYPE REF TO IF_WD_CONTEXT_NODE. LR_RANGE = WD_CONTEXT->GET_CHILD_NODE( 'RANGE' ). LR_RANGE->BIND_TABLE( <LT_RANGE_TABLE> ). endmethod. 2007 SAP AG 5

Related Content Please include at least three references to SDN documents or web pages. Web Dynpro Tutorials 2007 SAP AG 6

Copyright Copyright 2007 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, 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. 2007 SAP AG 7