Professional Documents
Culture Documents
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:
Anusha Vupalapathi
Company:
Created on:
Author Bio
Anusha V is a senior associate consultant currently working for Intelligroup Asia Pvt. Ltd. She is having good
knowledge in SAP ABAP.
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
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:
Go to transaction SE80.
Select Webdynpro Comp. /Intf from the list.
Create a new Webdynpro component by the name ZWDA_TABSTRIP.
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.
Select the fields you want to display from the table SFLIGHT using Add attribute from
structure button.
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
z
z
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.
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.
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.
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.
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.
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.
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(
).
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.