Working with Tabstrip in Webdynpro for ABAP

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

Working with the Roadmap UI Element in Web Dynpro ABAP

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

Working with Dynamic Tables in Interactive Adobe Forms and WebDynpro ABAP

ALV with Dynamic Structure in Web DynPro

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

Table Row Popup in Web Dynpro Component

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

Sales Order Creation using Web Dynpro ABAP

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

Table Popins and Business Graphics in Web Dynpro ABAP

WDA Tutorial II: Using Select Options in a WDA Application

Web Dynpro ABAP: Changing ALV Contents and Saving in Database

Web Dynpro: Coloring Table Conditionally

Dialog Windows in WebDynpro ABAP Applications

POWL: Infoset Generation with Web Dynpro ABAP

Web Dynpro ABAP: Dynamic Table

Dynamically Enable / Disable Fields in Table Maintenance Generator

SDN Community Contribution

Freely Programmed Help- Web Dynpro

Internationalization in WebDynpro ABAP Applications

Table Properties and Table Popin

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

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

Using Radio Buttons in Web Template

Creating Rules in Process Composer and using them in Process

BAPI Execution in offline Adobe Form

Totals in Adobe forms

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

How to Create Business Graphics in Web Dynpro for ABAP

Loading the Data for Time Dependent Hierarchy in SAP BI

Triggering the Process Chains at Particular Date using Events

Easy Lookup in Process Integration 7.1

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

SAP BW Copy Existing DTP for Data Targets

Creating Multiple Methods/Operations and Exposing BAPI as a Webservice

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

Federated Portal for Composite Environment 7.1

Dynamic Context Menus in Web Dynpro ABAP.

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

Linking Documents with Web Templates

Material Master Archiving in Simple Method

SMT (Service Mapping Tool)

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

Integrating POWL with WebDynpro ABAP

How to Integrate SAP xmii Services with Web Dynpro Java

MDM Syndicator: Custom Items Tab

Methods of Selecting BOM Variant Parts in Variant Configuration

Displaying SAP Transaction as Internet Application in Portal

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

Material Listing and Exclusion

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

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

Financial Statement Version into PDF Reader

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

Routines in SAP BI 7.0 Transformations

How to Extend an Outbound IDoc

Procedure to Trigger Events in Remote System Using an ABAP Program

Download SAP Query Output to Local/ Network Folders in Background

Data Extraction & DS Enhancement in SAP BI Step by Step

Graphical Mapping Technique in SAP NetWeaver Process Integration

Customized Transaction to Trigger Process Chain from Failed Step

Step by Step Procedure for DSO Creation

ABAP HR: Standard Info Type Enhancement

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

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

Step By Step: the Process of Selective Deletion from a DSO

DB Connect with Delta Mechanism

Different Types of iviews in Enterprise Portal 7.0

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

Limitation in BAPI Scheduling Agreement (SA) Create or Change

Load Info Cube in SCM 5.0 (BI 7.0)

Customizing Characteristic Relationships in BW-BPS with Function Modules

Web Dynpro Interactive Forms Data Transfer and Scripting

Reporting Duplicate Entries

Maintaining Roles and Authorizations in BI7.0 - RSECADMIN

SDN Community Contribution

ALV Object Model Hierarchical Sequential List The Basics

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

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

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

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

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

Replacement Path: Explained with an Illustrated Example

Restricting F4 (Input Help) Values While Running a SAP BW Query

Solution to the Challenges in Pivoting

Displaying HR Organizational Tree Structure in Web Dynpro

How to Work with F4 Input Help Effectively in BEX

Common Queries/Errors while working with Adobe Print PDF Forms

Config Tool Activities

Purpose of Goods Receipt Message indicator in Purchase Orders

SDN Community Contribution

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

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

Applies To:...1. Summary...1. Table of Contents...1. Procedure..2. Code... Error! Bookmark not defined.0

Value Help in Web Dynpro ABAP - Tutorial.

Step by Step Guide to Creating a Process Type to Close an Open Request in a Cube in BI 7.0

Developing Crystal Reports on SAP BW

Standalone BW System Refresh

ABAP Program to Read/Populate Selection Screen Parameters Dynamically

Transcription:

Working with Tabstrip in Webdynpro for ABAP Applies to: SAP ECC 6.0 (Release 700, SP 12). For more information, visit the Web Dynpro ABAP homepage.. Summary This tutorial explains about Step-By-Step procedure for creating a Tabstrip in Webdynpro ABAP. It makes use of a number of UI elements as well. We will also see how to clear the selection screen context and how to call a POPUP window. Author: Company: Anusha Vupalapathi Intelligroup Asia Pvt Limited Created on: 8th JUNE 2009 Author Bio Anusha V is a senior associate consultant currently working for Intelligroup Asia Pvt. Ltd. She is having good knowledge in SAP ABAP. 2009 SAP AG 1

Table of Contents Description... 3 Create Webdynpro Component... 4 Creating context in Component Controller... 4 Design View... 6 Implementation of the methods... 12 Embedding view to window... 13 Create a WebDynpro Application... 15 Output 1: If an entries exits for the selection criteria.... 15 Related Content... 18 Disclaimer and Liability Notice... 19 2009 SAP AG 2

Description The Tabstrip UI element allows the display of a tab page. The user can toggle between several tab pages by selecting a specific tab. The same window is shared by all tab pages and used for displaying the content. The user can display the content of a tab by selecting a tab title. Scenario: To create a Webdynpro application with a Tab strip. UI Elements on the output screen: Parameter: Airline Code: SFLIGHT-CARRID Button: SUBMIT. Tables in Tabstrip: Displays the list of all flights and Flight schedules in two different tabs based on the input given by user on Screen. And also displays a popup window with a message if no flight detail exists with given input. Snap Shot of output Screen: 2009 SAP AG 3

Create Webdynpro Component Go to transaction SE80. Select Webdynpro Comp. /Intf from the list. Create a new Webdynpro component by the name ZWDA_TABSTRIP. Creating context in Component Controller In component Controller create the nodes and attributes. We are taking Airline code i.e. CARRID as input and displaying the list of all flights (SFLIGHT) and Flight schedules (SPFLI) as output. So create these attributes in the context of component controller. Right click on the context tab create node. For CARRID create node as shown below and select Add Attribute from structure and create attribute to the node. Make sure that the cardinality is 1..1 as it is the input field. 2009 SAP AG 4

Select the fields you want to display from the table SFLIGHT using Add attribute from structure button. 2009 SAP AG 5

Similarly create the remaining two nodes SFLIGHT and SPFLI with corresponding attributes. Make the cardinality as 0..N for these two nodes. Finally the context in the component controller looks like the below figure. Design View Create a view for the selection. Activate the component at this point of time. On the Context Tab, drag the nodes from the Component Controller context and drop it onto the Main View Context. Define the layout of the view. Create a label to the input field. Right click on ROOTUIELEMENTCONTAINER and insert element as shown below. 2009 SAP AG 6

Create a label by specifying the type as label. Create the INPUT field and set the Property as shown in the figure. Click on the value field and select the Carrid node from the context Main view. This will be input field for the application. Create one Button and if you click this button the flight details will be display in the table. In button properties give action as SELECTION. 2009 SAP AG 7

If you give the property as SELECTION, then one event handler will generate for this button with name ONACTIONSELECTION. In this handler you need to write the code that you want to execute when ever button is pressed. Creation of TABSRIP. To create Tabstrip insert Tabstrip element in your layout, further to create n no. of tabs, right click on the Tabstrip and insert tab as shown below. In the current application insert two tabs. 2009 SAP AG 8

Note: In each tab only one element can be created. The UI Element transparent container can be used to have multiple elements in a single tab. We need to add elements to tab separately. In the first tab add a table with Sflight node details. And in the second tab add a table with Spfli node details. 2009 SAP AG 9

After adding table element to the tab, Bind the Table with the corresponding Nodes we created in the Context Component. The same is shown below. Select the context and we get the nodes in the context of the view. Select the Sflight node and we get the below details. 2009 SAP AG 10

After binding the table this is the screen with table values binded with context. Similarly create a table and bind the values of Spfli node for the second tab. After all it looks like the below screen. 2009 SAP AG 11

Implementation of the methods Write the code you want to execute in ONACTIONSELECTION method of the Button. Go to Wizard and select the radio button READ Context and insert the nodes names CARRID. Press the OK button. Now the Wizard generates the code to access the node Carrid. Similarly do for the remaining two nodes i.e. SFLIFGT and SPFLI. We are reading the context of Node CARRID. Similarly get the nodes of SFLIGHT and SPFIL from context using via lead selection. Fetch the data from Sflight and Spfli into tables based on the input field Carrid. See the below code for more information. METHOD onactionselection. * Types declaration DATA lo_nd_carrid TYPE REF TO if_wd_context_node. DATA lo_el_carrid TYPE REF TO if_wd_context_element. DATA ls_carrid TYPE wd_this->element_carrid. * navigate from <CONTEXT> to <CARRID> via lead selection lo_nd_carrid = wd_context->get_child_node( name = wd_this->wdctx_carrid ). * get element via lead selection lo_el_carrid = lo_nd_carrid->get_element( ). * get all declared attributes lo_el_carrid->get_static_attributes( IMPORTING static_attributes = ls_carrid ). * Internal table declaration DATA: it_flight TYPE STANDARD TABLE OF sflight, it_spfli TYPE STANDARD TABLE OF spfli, wa_flight TYPE sflight, wa_spfli TYPE spfli, text TYPE string, lv_carrid TYPE string. DATA: lo_nd_sflight TYPE REF TO if_wd_context_node, lo_nd_spfli TYPE REF TO if_wd_context_node. * navigate from <CONTEXT> to <SFLIGHT> via lead selection 2009 SAP AG 12

lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ). * navigate from <CONTEXT> to <SPFLI> via lead selection lo_nd_spfli = wd_context->get_child_node( name = wd_this->wdctx_spfli ). *Fetch Flight details CLEAR text. SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE it_flight WHERE carrid = ls_carrid-carrid. IF sy-subrc = 0. SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE it_spfli WHERE carrid = ls_carrid-carrid. ELSE. *Display a popup window with an error message if the data does not exist DATA: l_cmp_api TYPE REF TO if_wd_component, l_window_manager TYPE REF TO if_wd_window_manager, l_popup TYPE REF TO if_wd_window, l_text TYPE string_table, l_api TYPE REF TO if_wd_view_controller, message TYPE string. l_cmp_api = wd_comp_controller->wd_get_api( ). l_window_manager = l_cmp_api->get_window_manager( ). lv_carrid = ls_carrid-carrid. CONCATENATE 'No Flights avilable for' lv_carrid INTO text SEPARATED BY ' '. APPEND text TO l_text. l_popup = l_window_manager->create_popup_to_confirm( text = l_text button_kind = if_wd_window=>co_buttons_ok message_type = if_wd_window=>co_msg_type_information window_title = 'Information' window_position = if_wd_window=>co_center ). l_popup->open( ). *Clear the selection screen. DATA: l_node TYPE REF TO if_wd_context_node. l_node = wd_context->get_child_node( 'CARRID' ). l_node->invalidate( ). ENDIF. IF sy-subrc EQ 0. * binding the table it_flight lo_nd_sflight->bind_table( it_flight ). lo_nd_spfli->bind_table( it_spfli ). ENDIF. ENDMETHOD. Embedding view to window In window embed the view MAINVIEW. 2009 SAP AG 13

After embedding the screen would be 2009 SAP AG 14

Create a WebDynpro Application Create WebDynpro application. And save it. Activate the WebDynpro component. Test WebDynpro component. Output 1: If an entries exits for the selection criteria. Select the value from the search help and click on Display button. Data for selected values will be displayed in Tabstrip element like below. Values in the first tab Sflight Details. 2009 SAP AG 15

Values in the second tab Spfli Details. OUTPUT 2: If there doesn t exits entries for the selection criteria. Give any Airline code as an input which doesn t have entries in Sflight and Spfli. 2009 SAP AG 16

This is the final Output. 2009 SAP AG 17

Related Content http://help.sap.com/saphelp_nw70ehp1/helpdata/en/e8/ac884118aa1709e10000000a155106/content.htm Web Dynpro ABAP Basic UI Elements For more information, visit the Web Dynpro Java homepage. 2009 SAP AG 18

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 19