Professional Documents
Culture Documents
Applies to:
SAP ECC 6.0. For more information, visit the Web Dynpro ABAP homepage.
Summary
Table Popins are the additional feature to a Table UI element. The BusinessGraphics UI element can be used to display graphical illustrations of data and data relationships. This is a sample application which include Business Graphics and Table Popins Author: Shaira Madhu
Author Bio
Shaira Madhu is working as SAP Technology Consultant with Applexus Technologies (P) Ltd.
Table of Contents
Introduction ......................................................................................................................................................... 3 Table Popins ....................................................................................................................................................... 3 BusinessGraphics UI Element ............................................................................................................................ 4 A Sample Application .......................................................................................................................................... 5 Related Content ................................................................................................................................................ 23 Disclaimer and Liability Notice .......................................................................................................................... 24
Introduction
This is a sample application to which includes businessGraphics in Table Popins. The Output will looks like the below snapshot.
Table Popins
The TablePopin allows displaying detail information related to a data set (row popin) or a data cell (cell popin) as an insertion below the related row of the Table. With a cell popin the associated cell is assigned the background color of the popin, so popin and cell can be identified as belonging together. The UI element TablePopinToggleCell is provided for expanding and collapsing the TablePopin. However, the visibility of a TablePopin may also be toggled by clicking on any clickable UI element on the view. In this sample application we are using row popin.
BusinessGraphics UI Element
The BusinessGraphics UI element can be used to display graphical illustrations of data and data relationships For Web Dynpro ABAP, the following chart types are available: Column chart (columns and stacked columns) Bar chart (bars and stacked bars) Line chart (lines, stacked lines, profiles and stacked profiles) Area chart (area, stacked area, profile area, stacked profile area, and pipeline) Pie chart (pie and split pie) Doughnut chart Radar chart (radar and stacked radar) Polar chart Speedometer chart Scatter chart (scatter and time scatter) Portfolio chart Gantt chart MTAChartamet,
A Sample Application
Create a Web Dynpro Component. In ComponetController context a node FLIGHT with cardinality 0..n and Dictionary types SFLIGHT. Refer the below snapshot.
Create another node FLIGHT_SEATS with cardinality 1..1 and dictionary structure SFLIGHT. This node is used to display the row related TablePopins.
Select the node FLIGHT and remove the dictionary structure SFLIGHT as shown, so that we can add a new attribute POPIN_NAME to that node.
Add a new attribute POPIN_NAME type STRING. This attribute will contain the selected Popin name of the TABLE.
Select the Methods Tab and double click WDDOINIT method and write code to fetch data from table SFLIGHT.
method WDDOINIT . DATA lo_nd_flight TYPE REF TO if_wd_context_node. DATA t_flight TYPE TABLE OF wd_this->element_flight. lo_nd_flight = wd_context->get_child_node( name = wd_this->wdctx_flight ). *--Read the forst 10 rows from Table Sflight SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE t_flight UP TO 10 ROWS. *--Bind value to Context Node Flight CALL METHOD lo_nd_flight->bind_table EXPORTING new_items = t_flight . endmethod.
In Main view select the Context tab and drag and drop the nodes to the View context.
Select ROOTELEMENTCONTAINER and click wizard button. Create a table from the template.
Right click on TABLE UI element and create a table column as shown in snapshot.
The value of the TableColume Property SelectedCellVerient and the value of the TablePopinToggleCell property variantKey have to be identical. The TablePopinToggleCell is given an identifier by setting the
property variantKey to an appropriate value. The same value has to be assigned to the property selectedCellVariant of the related TableColumn. Refer the below snapshot.
Edit the Property of BUSINESSGRAPHICE . Bind the FLIGHT_SEATS to the property SeriesSource.
Right click the BUSINESSGRAPHICS and insert Category. Bind the CATEGORY description to FLDATE of node FLIGHT_SEATS.
Edit the property of SIMPLE SERIES with Lable Economy class and bind data to attribute SEATSOCC of node FLIGHT_SEATS.
Create two more Series with attribute SEATSOCC_B with lable Business class and SEATSOCC_F with label First class.
Come to TABLE_POPIN_TGL_CELL which created under TABLECOLUMN. Add an event as shown in below snapshot.
Double click on the action and write the logic for it as given below.
method ONACTIONTOGGLE DATA: v_carrid v_connid v_fldate x_flight lo_nd_seat lo_el_seat ls_seat lo_nd_flight ls_flight t_flight x_flight1 ind . TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE s_carr_id, s_conn_id, s_date, wd_this->element_flight_seats, REF TO if_wd_context_node, REF TO if_wd_context_element, wd_this->element_flight_seats , REF TO if_wd_context_node, wd_this->element_flight, TABLE OF wd_this->element_flight, wd_this->element_flight, i.
*--Get the CARRID CALL METHOD context_element->get_attribute EXPORTING name = 'CARRID' IMPORTING value = v_carrid. *--Get the CONNID CALL METHOD context_element->get_attribute EXPORTING name = 'CONNID' IMPORTING value = v_connid. *--Get the FLDATE CALL METHOD context_element->get_attribute EXPORTING name = 'FLDATE' IMPORTING value = v_fldate. *--Get the flight details with respect to CARRID CONNID FLDATE SELECT SINGLE * FROM sflight INTO CORRESPONDING FIELDS OF x_flight WHERE carrid = v_carrid AND connid = v_connid AND fldate = v_fldate.
lo_nd_seat = wd_context->get_child_node( name = wd_this->wdctx_flight_seats ). ls_seat-seatsocc = x_flight-seatsocc. ls_seat-seatsocc_f = x_flight-seatsocc_f. ls_seat-seatsocc_b = x_flight-seatsocc_b. ls_seat-fldate = x_flight-fldate. *--Bind the structure for current CARRID CONNID and FLDATE CALL METHOD lo_nd_seat->bind_structure EXPORTING new_item = ls_seat
set_initial_elements = abap_true RECEIVING element = lo_el_seat. *--To close the popin of all the rows other than current row lo_nd_flight = wd_context->get_child_node( name = wd_this->wdctx_flight ). CALL METHOD lo_nd_flight->get_static_attributes_table IMPORTING table = t_flight . *-- Get the current index CALL METHOD context_element->get_index RECEIVING my_index = ind. *--Clear all the Popin_name of rows except for the current row LOOP AT t_flight INTO x_flight1. IF sy-tabix NE ind. x_flight1-popin_name ENDIF.
= ''.
MODIFY t_flight FROM x_flight1. ENDLOOP. CALL METHOD lo_nd_flight->bind_table EXPORTING new_items = t_flight. endmethod.
Create an Action for event onColse in the property of TABLEPOPIN as in below snapshot.
Double click the Action and write the code for event as given below.
method ONACTIONCLOSE . CONTEXT_ELEMENT->set_attribute( name value = space ). endmethod. = 'POPIN_NAME'
Select the POPIN_NAME attribute under FLIGHT node to the SelectedPopin property of TABLE UI element. Binding this property is the prerequisite for defining the Table Popins and its visibility row dependent.
Activate the entire component and Create Web Dynpro Application. The output will look like as shown below. Click on the small arrow till display the Seats details of the Flight on that date.
Related Content
Web Dynpro table Popin BusinessGraphics For more information, visit the Web Dynpro ABAP homepage.