SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software Kodyaz SAP and ABAP Programming Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Vista, etc.




Win FREE BOOK
from Kodyaz



CRM Companies List
Web Based CRM Software

Display Data on Web DynPro Table Element


ABAP Web Dynpro software developers will display data from SAP tables on a Web Dynpro table element in this tutorial part. If you missed the previous parts, you can start from Display Spool Requests using Web DynPro Table for the whole Web Dynpro tutorial.

Up to this point, we have already created SAP Web Dynpro application (component) using SE80 and activate WEb Dynpro components without any error or problem. It is time to create context elements that will store data and can be also used to store data from one Wen Dynpro application page to an other. Besides the data for context nodes and context attributes will be selected from SAP tables, or can also be provided by using ABAP function modules. And the last part of this Web Dynpro will bind data to table elements placed on the page using Layout tab.





Now, open Web Dynpro component using SE80 ABAP Workbench editor. Then double click on Main view and navigate to Context tab. Change your editor mode to Edit (Ctrl+F1) in order to create a node context which will store data that is returned from TSP01 Spool Requests ABAP table for related user. We will also use this context node while data bind process to Web DynPro Table object on the user interface (layout)

Right click on CONTEXT, choose "Create > Node" menu options

create new context node in Webdynpro component

In order to create a new node provide the following data : Node Name and Cardinality

create nodes detail screen cardinality and structure

Since we will use this context node to store spool requests for Web Dynpro table object, I change the Cardinality to 0..n

It might happen that there will be no rows as the result of the ABAP SELECT query or many rows might return.

I did not enter a Dictionary structure name like TSP01, because I will add column names (or field names) manually by adding attributes to the context node.

Press Enter when finished

Now we can continue by creating attributes for the new context node

create attribute

Give the Attribute Name and Type (RQIDENT, RSPOID). You can refer to TSP01 ABAP table using SE11 to get field name and data element name for Spool request number in this case

context attribute for spool request number

After you add required fields to the context node, activate your Web Dynpro component.

Now we are ready to populate context node with data.
Go to Methods tab of the Main view.

Web Dynpro component view methods

Double click WDDOINIT method which is the Controller Initialization Method

TYPES :
 BEGIN OF gty_TSP01,
  RQIDENT TYPE RSPOID,
  RQ0NAME TYPE RSPO0NAME,
  RQ1NAME TYPE RSPO1NAME,
  RQ2NAME TYPE RSPO2NAME,
  RQOWNER TYPE RSPOUSER,
  RQCRETIME TYPE RSPOCRTIME,
 END OF gty_TSP01.
 DATA :
  ls_TSP01 TYPE gty_TSP01,
  lt_TSP01 TYPE TABLE OF gty_TSP01.

 SELECT
  RQIDENT
  RQ0NAME
  RQ1NAME
  RQ2NAME
  RQOWNER
  RQCRETIME
 INTO TABLE lt_TSP01
 FROM TSP01
 WHERE RQOWNER = syst-UNAME.

Now we have the data for the table. In this step, we will set context node with data we Select from spool requests table.

We can use Web Dynpro Code Wizard (Ctrl+F7) for this task. Web Dynpro code wizard icon

Click Code Wizard icon

Select "Set" option. Mark Table Operation and press icon on the right side of the Node/Attribute entry.

Choose the SpoolRequests node under the Context

set context node element data

Press Enter twice to return to method code source.

Code wizard added required ABAP code to set context node data

DATA lo_nd_spoolrequests TYPE REF TO if_wd_context_node.

DATA lt_spoolrequests TYPE wd_this->elements_spoolrequests.

* navigate from <CONTEXT> to <SPOOLREQUESTS> via lead selection
lo_nd_spoolrequests = wd_context->get_child_node( name = wd_this->wdctx_spoolrequests ).

* @TODO handle non existant child
* IF lo_nd_spoolrequests IS INITIAL.
* ENDIF.

** @TODO compute values
** e.g. call a model function
*
lo_nd_spoolrequests->bind_table( new_items = lt_spoolrequests set_initial_elements = abap_true ).

Now you can add the following line before bind_table method is called. Here is the modified code.

DATA lo_nd_spoolrequests TYPE REF TO if_wd_context_node.

DATA lt_spoolrequests TYPE wd_this->elements_spoolrequests.

* navigate from <CONTEXT> to <SPOOLREQUESTS> via lead selection
lo_nd_spoolrequests = wd_context->get_child_node( name = wd_this->wdctx_spoolrequests ).

* @TODO handle non existant child
* IF lo_nd_spoolrequests IS INITIAL.
* ENDIF.

** @TODO compute values
** e.g. call a model function
*
lt_spoolrequests = lt_TSP01.

lo_nd_spoolrequests->bind_table( new_items = lt_spoolrequests set_initial_elements = abap_true ).

Now context node is populated with data. Let's bind this context node data to a Web Dynpro table on the layout tab. Switch to Layout tab.
On the Layout form, click Code Wizard

Web Dynpro template gallery

double click on Table

context binding empty

Click on Context button

choose context element

Press Enter icon

create context binding for table

Press Enter icon

Web Dynpro Table element on Layout

When ABAP developers look at the Table element's properties in the properties window, they can see that the dataSource property is automatically filled. The dataSource property is used for databinding relationship between the Table user interface element and the context node element of the Web Dynpro component.

dataSource property of the Table user interface element

Activate Web Dynpro component codes

Now our sample Web Dynpro application is ready for test. If you wonder how data will be displayed on table element of our sample application of the Web Dynpro tutorial, we can continue with the next step : test Web Dynpro Application.







SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table






Recent and Top SAP Tutorial and ABAP Tutorials

Read Pricing Condition Text using ABAP in SAP Sales Document Output
Export SAP Data to Fixed Length Text File
Save Table Contents into Text File and Download File
Business Document Service Error: Error when accessing graphic (BDS), RC = 5
Get Proforma Invoice from Commercial Invoice in ABAP
Convert Sales Unit into Text using Function Module in Target Language
Get Fullname of SAP user using Function Module in ABAP Program
ABAP Submit Report to Run Another ABAP Program within Code
Message no XS826: Cannot process message; no node determined for 76550052
SE63 Smartform Translation and Export using SLXT Program
VF31 SAP Transaction to Reprocess Billing Output Messages
Import and Export SO10 Standard Text using RSTXSCRP ABAP Program
CALL_FUNCTION_NOT_FOUND ABAP Run Time Error
SAP Output Management - Create New SAP Output Type
SAP Purchase Order Tables, Transaction Codes and Output
Assign SAP Item Category to Sales Document Type using SPRO
Window MAIN does not fit onto page PAGE (height)
SAP Invoice Output ZZZZ is not Defined
Invoice Output fail because of missing Billing Type text in TVFKT table
Read Integer and Decimals of a Numeric Value in ABAP Programming
SAP Smartforms Table Parameter in Form Routine
Complex Conditions in SAP Smartform with AND/OR
Free Adobe LiveCycle Designer Download
Create SAP Dynamic Variant using Date Calculation
Translate Web Dynpro Header Title displayed on Web Browser
ABAP RegEx for ABAP Regular Expression to fetch Date from String
Change Output Condition Records
Web Dynpro Text Translation using Assistance Class
Move Minus Sign from Right to Left of Negative Number in SAP Smartform
Read Address Data using FM ADDR_GET instead of Querying ADRC Table
Add Value Help to Web Dynpro Select Options
Add Web Dynpro Applications to SAP Favorites Menu
Component Usage ALV Does Not Have an Active Component
Web Dynpro Component Service Syntax Error in Program /1BCWDY/O3EC1AX6A3OVKK9L5FXO==CP
Web DynPro Tutorial - Display Spool Requests using Web DynPro Table
Web DynPro Tutorial - How to create Web Dynpro Application (Web Dynpro Component)
Display Data on Web DynPro Table Element
Test Web Dynpro ABAP Component by Creating Web Dynpro Application
Insert SAP Icons and Symbols on Smartform Documents
How to Display Text on Sap Smart Forms
Graphics White Background Displayed Grey on SAP Smartform Output
Get SAP Document Flow using SD_DOCUMENT_FLOW_GET ABAP Function Module
Convert Numeric Value or Currency into String Spell_Amount Function Module
How to Transport SAP Graphics using SE78 Transaction
How to Delete Standard Text using SO10 SAP Transaction
Dynamic Programming using Field Symbols in ABAP Reports
How to Disable Word Editor in SAP Smartform Text
How to Debug Popup Screen in ABAP
TVAP Item Category and SAP Table TVAPT for Text Translations
ABAP Runtime Error ST22 Transaction using Short Dump Analysis
Create Transport Request for Text Translations using RS_LXE_RECORD_TORDER
SAP Invoice Output Determination Analysis for Not Created Output Message
Set Default Single Values List for SAP Selection Screen Parameter
SAP Payment Terms Table and ZTERM Texts Table for ABAP Developers
How to Create SAPScript Text using SO10 Transaction Code
SAP Smartforms Tutorial - Table Calculations using Sum Total
SAP Smartforms Tutorial - Table Calculations using Count
SAP Smartforms Tutorial - How to Create Smartform
SAP NetWeaver Installation Guide using installshield wizard
SAP Smartforms Table for Sales Order and Invoice Outputs
Email Spool Request using SAPOffice - Spool to PDF
How to Display SAP Graphics using SE78 Transaction Code
SAPScript Transaction Codes
ABAP Tutorial - ABAP String Split Example Code
Sales Tables among ABAP Tables (SAP Sales and Distribution SD Tables)
How to Upload Data to SAP from Excel File using alsm_excel_to_internal_table Function Module
ALV Grid Color - Table Row Background Color in ALV List
Multi Color ALV Grid Color Alternate using ALV Layout info_fname Property
How to Debug SmartForms - Debugging SAP SmartForm in ABAP ?
ABAP - Create Hierarchy Tree List using rs_tree_construct, rs_tree_list_display and snodetext
Create CL_GUI_ALV_GRID ALV Grid Column Header using ABAP Data Element
ABAP Tutorial - SAP Split and ABAP Split String Function
Upload Data from Excel File in ABAP using TEXT_CONVERT_XLS_TO_SAP
SAP Tutorial - Convert Spool Request to PDF File using RSTXPDFT4 ABAP Report
SAP ABAP Tutorial - ALV Grid Example with cl_gui_alv_grid and Screen Painter
Convert Smartform to PDF in Print Preview Mode
SAP Smartforms Tutorial - Create Smartforms Example
SAP Smartforms - How to Call Smartform within ABAP Program
Complete List of SAP Modules






Copyright © 2004 - 2013 Eralper Yilmaz. All rights reserved.
Community Server by Telligent Systems