Displaying data with ABAP WebDynpro table

Below are the steps for displaying data within an ABAP WebDynpro table.

Step 1
Create new Web dnpro component (WDP_SEL_TABLE), double click on the ComponentController and select the 'Context' tab. Now add a new node to the contect node (right click the context and select Create->Node).


Step 2
Give the new node a name and enter which table structure you want to base it on (i.e. table you want to display). Also rememeber to set the cardinality to 0:n (or 1:n) to denote a table.


Step 3
Now click on the 'add attributes from structure' button, and select your desired table fields.


Step 4
Press the green tick on both the new popup screens to return to your context section, your new context node should now have been added.


Step 5
Now click on the 'Methods' tab


Step 6
Double click on the 'WDDOINIT' method so that you can modify the ABAP code. Add the following code:

Data: it_scarr type standard table of scarr,
      context_node type ref to if_wd_context_node.
select * from scarr into table it_scarr.
  if sy-subrc eq 0.
    context_node = wd_context->get_child_node( name = 'CARRIERS').
*                   Note: CARRIERS' is the name you gave you new node
    context_node->bind_table( it_scarr ).
  endif.


Step 7
Now create a new view



Step 8
Goto the context tab of the newly created view, and drag the CARRIERS node from the right hand window (ComponentController) to the view context window.



Step 9
The ComponentController node should now be mapped onto view node


Step 10
Select the layout tab and add a new Element of type 'Table'. Right click on the new table and select the 'Create Binding' option.


Step 11
Press the context button and then select the CARRIERS node (or the node you created earlier).


Step 12
You should now see the the list of fields contained in your node.


Step 13
Press the green tick to insert the the fields into your table element!


Step 14
Goto the window section and embed the view into the window!


Step 14
Create a WDpro application and test it!


Related Articles

Web Dynpro for ABAP tutorials example souce code for developing SAP Webdynpro applications
Displaying a web dynpro field with F1 dictionary help
Adding a UI element to a view of and ABAP Webdynpro
Make WebDynpro view part of the WebDynpro window
My First ABAP WebDynpro - simple WebDynpro to display 'Hello world'
ABAP Web Dynpro layout development and how it looks in your browser
Adding a IMAGE UI element to an ABAP Web Dynpro view
Adding inbound and outbound plugs to your ABAP WebDynpro
Triggering ABAP WebDynpro inbound and outbound plugs