Using Drop Down By Index in Table UI Element in WebDynpro ABAP

Similar documents
Table Popins and Business Graphics in Web Dynpro ABAP

Working with Tabstrip in Webdynpro for ABAP

Working with Dynamic Tables in Interactive Adobe Forms and WebDynpro ABAP

Table Row Popup in Web Dynpro Component

Working with the Roadmap UI Element in Web Dynpro ABAP

ALV with Dynamic Structure in Web DynPro

How to Integrate Web Dynpro ABAP in Portal and Capture Portal Logon User Name

Dialog Windows in WebDynpro ABAP Applications

Integration of Web Dynpro for ABAP Application in Microsoft Share Point Portal

Generating Self-Defined Functions for ALV in Web Dynpro for ABAP

WDA Tutorial II: Using Select Options in a WDA Application

POWL: Infoset Generation with Web Dynpro ABAP

How to Create Top of List and End of List of the ALV Output in Web Dynpro for ABAP

Sales Order Creation using Web Dynpro ABAP

How to pass data from ABAP to Web Dynpro ABAP - Part 1

Web Dynpro ABAP: Dynamic Table

SMT (Service Mapping Tool)

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

Web Dynpro ABAP: Changing ALV Contents and Saving in Database

Internationalization in WebDynpro ABAP Applications

A Simple Web Dynpro Application to Locate Employee s Location into Google Map

Web Dynpro: Coloring Table Conditionally

Easy Lookup in Process Integration 7.1

SDN Community Contribution

Integrating POWL with WebDynpro ABAP

Add /Remove Links on ESS Home Page in Business Package 1.5

Table Properties and Table Popin

Freely Programmed Help- Web Dynpro

BAPI Execution in offline Adobe Form

DB Connect with Delta Mechanism

SDN Community Contribution

Dynamically Enable / Disable Fields in Table Maintenance Generator

Using Radio Buttons in Web Template

Displaying SAP Transaction as Internet Application in Portal

Extracting Missing Fields of Data Source Which Are Present In Their Extract Structure

Creating Rules in Process Composer and using them in Process

Material Listing and Exclusion

MDM Import Manager - Taxonomy Data (Attribute Text Values) Part 3

Fetching User Details from the Portal and Displaying it in Web Dynpro with Authentication in the Portal

This article explains the steps to create a Move-in letter using Print Workbench and SAPScripts.

Maintaining Roles and Authorizations in BI7.0 - RSECADMIN

How to Create Business Graphics in Web Dynpro for ABAP

Linking Documents with Web Templates

ALV Object Model Hierarchical Sequential List The Basics

Material Master Archiving in Simple Method

Financial Statement Version into PDF Reader

Graphical Mapping Technique in SAP NetWeaver Process Integration

How to Default Variant Created for Report Developed In Report Painter/Writer

MDM Syndicator: Custom Items Tab

Upload Image file from system in Web dynpro view

Open Text DocuLink Configuration - To Access Documents which are Archived using SAP

How to Integrate SAP xmii Services with Web Dynpro Java

Data Extraction & DS Enhancement in SAP BI Step by Step

Dynamic Context Menus in Web Dynpro ABAP.

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

Step by Step Guide on How to Use Cell Definition in BEx Query

ABAP HR: Standard Info Type Enhancement

How to Create and Schedule Publications from Crystal Reports

Totals in Adobe forms

Creating, Configuring and Testing a Web Service Based on a Function Module

Web Dynpro Interactive Forms Data Transfer and Scripting

Exception Handling in Web Services exposed from an R/3 System

Routines in SAP BI 7.0 Transformations

Step by Step Guide How to Use BI Queries in Visual Composer

Custom Password Reset Tool in SAP Enterprise Portal Using Web Dynpro for Java

Triggering the Process Chains at Particular Date using Events

Implying Security on Business Object XI 3.1 Universe having SAP BW as Source

Limitation in BAPI Scheduling Agreement (SA) Create or Change

Transfer Material Attributes (Material Type) from R/3 to SAP GRC Global Trade Services (GTS)

Creation of Sets in SAP-ABAP, How to Read them INI SAP-ABAP Reports

Purpose of Goods Receipt Message indicator in Purchase Orders

Displaying HR Organizational Tree Structure in Web Dynpro

How to Create View on Different Tables and Load Data through Generic Datasource based on that View

ABAP Code - Recipients (Specific Format) SAP BW Process Chain

Federated Portal for Composite Environment 7.1

How to use Boolean Operations in the Formula as Subsidiary for IF Condition

Download SAP Query Output to Local/ Network Folders in Background

Adding Files as Attachments to SAP Interactive Forms in the Java Environment

Using Query Extract to Export Data from Business warehouse, With Pros and Cons Analyzed

Reporting Duplicate Entries

Open Hub Destination - Make use of Navigational Attributes

Step by Step Procedure for DSO Creation

How to Configure User Status in mysap SRM

Generate Export Data Source

Explore to the Update Tab of Data Transfer Process in SAP BI 7.0

Creating Custom SU01 Transaction Code with Display and Password Reset Buttons

Config Tool Activities

Developing Crystal Reports on SAP BW

SAP BW Copy Existing DTP for Data Targets

Replacement Path: Explained with an Illustrated Example

Validity Table in SAP BW/BI

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

Different Types of iviews in Enterprise Portal 7.0

Universal Worklist - Delta Pull Configuration

ecatt Part 6 System Data Container

Changing the Source System Assignments in SAP BW Objects without Affecting the Data Modeling

Recreating BIA Indexes to Address the Growth of Fact Index Table

How to Display Result Row in One Line While Reporting On Multiproviderer

Extraction of Hierarchy into Flat File from R/3 and Loading in BW System

A Step-by-Step Guide on IDoc-ALE between Two SAP Servers

Transcription:

Using Drop Down By Index in Table UI Element in WebDynpro ABAP Applies to: Enterprise portal, ECC 6.0, Web Dynpro ABAP. For more information, visit the Web Dynpro ABAP homepage. Summary This article would help ABAP developers, who are faced with a scenario of having a DropDownByIndex within the Table UI Element in their Web Dynpro Component. Author: Tulasi Palnati Company: Yash Technologies Created on: 15 September 2009 Author Bio Tulasi Palnati is an Enterprise Portal Consultant at Yash Technologies, Hyderabad-India 2009 SAP AG 1

Table of Contents Step 1: Create a WebDynpro Component... 3 Step 2: Create a Context to hold data... 3 Step 4: Create the Layout and Bind the context to UI Elements... 7 Step 5: Create Application and Test it... 9 Output:... 9 Related Content... 11 Disclaimer and Liability Notice... 12 2009 SAP AG 2

Step 1: Create a WebDynpro Component A. Create a new WebDynpro component by the name ZWD_DROPDOWN_TABLE. Step 2: Create a Context to hold data B. Double click on View. Go to Context Tab. C. Create Node as Shown below.. D. Click on Add Attribute from Structure F. Select components from the structure and Click on finish. 2009 SAP AG 3

G. Create another node under SPFLI node as below. 2009 SAP AG 4

H. Create two attributes under the Node SFLIGHT as below. I. Context of the view looks as below. J. Select the SFLIGHT and Double click on CARRID_DATA supply function. 2009 SAP AG 5

Step 3: Code for Supply Function. K. Copy the below code in the method CARRID_DATA. DATA: lt_carrid TYPE TABLE OF s_carr_id, ls_spfli TYPE wd_this->element_spfli, lt_spfli TYPE wd_this->elements_spfli, lt_sflight TYPE wd_this->elements_sflight, ls_sflight TYPE wd_this->element_sflight, wd_node TYPE REF TO if_wd_context_node, lr_element TYPE REF TO if_wd_context_element. SELECT DISTINCT carrid UP TO 20 ROWS FROM sflight INTO TABLE lt_carrid. *** This would create 20 blank rows in the table with only the dropdown filled with CARRID values DO 20 TIMES. APPEND ls_spfli TO lt_spfli. ENDDO. node->bind_table( new_items = lt_spfli set_initial_elements = abap_true ). LOOP AT lt_spfli INTO ls_spfli. 2009 SAP AG 6

LOOP AT lt_carrid INTO ls_sflight-carrid. ls_sflight-key = sy-index. CONDENSE ls_sflight-key. APPEND ls_sflight TO lt_sflight. CLEAR ls_sflight. ENDLOOP. lr_element = node->get_element( sy-tabix ). wd_node = lr_element->get_child_node( 'SFLIGHT' ). wd_node->bind_table( lt_sflight ). ENDLOOP. Step 4: Create the Layout and Bind the context to UI Elements L. Double Click on view layout tab. M. Click on ROOTUIELEMENTCONTAINER create element TABLE. N. Bind SPFLI node elements to the table as below. 0. Bind the texts Property of Carrid DropdownByIndex with MAIN.SPFLI.SFLIGHT.CARRID P. Create one action On_CARRID_SELECT. 2009 SAP AG 7

Q. Go to Methods tab. Select On_carrid_select method Double click on it. R. Copy the below code and Paste it. method ONACTIONON_CARRID_SELECT. DATA: lr_element TYPE REF TO if_wd_context_element, lv_index_table TYPE i, lv_index TYPE i, lt_sflight TYPE wd_this->elements_sflight, ls_sflight TYPE wd_this->element_sflight, wd_node TYPE REF TO if_wd_context_node, ls_spfli TYPE wd_this->element_spfli. *** Get row number from which dropdown value was selected lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ). lv_index_table = lr_element->get_index( ). wd_node = wd_context->get_child_node( 'SPFLI' ). wd_node->set_lead_selection_index( index = lv_index_table ). *** Get the index of value within dropdown which is selected wd_node = wd_context->get_child_node( 'SPFLI' ). wd_node->set_lead_selection_index( index = lv_index_table ). lv_index = wdevent->get_int( name = 'INDEX' ). *** Fetch all the dropdown values into an internal table wd_node = wd_context->path_get_node( 'SPFLI.SFLIGHT' ). CALL METHOD wd_node->get_static_attributes_table EXPORTING from = 1 to = 2000 IMPORTING table = lt_sflight. *** Obtain the value selected in the dropdown by the user using the index obtained READ TABLE lt_sflight INTO ls_sflight INDEX lv_index. wd_node->set_attribute( EXPORTING name = 'CARRID' value = ls_sflight-carrid ). SELECT SINGLE carrid connid countryfr cityfrom airpfrom countryto cityto airpto FROM spfli INTO CORRESPONDING FIELDS OF ls_spfli WHERE carrid = ls_sflight-carrid. 2009 SAP AG 8

*** Fill the fetched values into the corresponding textfields of table wd_node = wd_context->get_child_node( 'SPFLI' ). CALL METHOD wd_node->set_static_attributes EXPORTING index = lv_index_table static_attributes = ls_spfli. endmethod. Step 5: Create Application and Test it S. Now Create a WebDynpro Application and save and activate all. Output: 2009 SAP AG 9

2009 SAP AG 10

Related Content E-Learning Tutorials-WebDynpro ABAP WebDynpro ABAP in SDN 2009 SAP AG 11

Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document. 2009 SAP AG 12