Using table UI element in webdynpro ABAP

Working with table UI element in SAP web dynpro ABAP programming, table UI element properties

+ -
Requirement : Develop a web dynpro component to display list of vendors .

UI elements to be used in this requirement are INPUT FIELD,LABEL, BUTTON and TABLE .

Step1 : Create context for storing table data.

Step2: Insert TABLE UI element .

Step3: Create data binding for table.

Step4: Add logic to get data.

Step1: Go to Context and Create a node.Go to SE80, create a web dynpro component ZSAPN_TABLE, save it in a local object.

Using Table in web dynpro ABAP

Go to context of main view, click on change mode, right click on context -> create -> node.

Using Table UI element in Web Dynpro

Using Table in web dynpro ABAP

A popup will open, provide node name as LFA1, data dictionary structure as LFA1, click on add attributes from structure button.

Using Table in web dynpro ABAP

Select required attributes, enter.

Using Table in web dynpro ABAP

Step2: Go to layout and insert table UI element.Go to view layout, right click on ROOTUIELEMENTCONTAINER, insert element, provide a id and select table, enter.

Using Table in web dynpro ABAP

Step3:Create data binding for table.Right click on table, click on create binding, click on context.

Using Table in web dynpro ABAP

Select LFA1.

Using Table in web dynpro ABAP

Step4: Add logic to get data.Go to METHODS tab, double click on WDDOINIT add below code.

DATA LO_ND_LFA1 TYPE REF TO IF_WD_CONTEXT_NODE.

  DATA LT_LFA1 TYPE WD_THIS->ELEMENTS_LFA1.

*   navigate from <context> to <lfa1> via lead selection
  LO_ND_LFA1 = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_LFA1 ).

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

*  * @TODO compute values
*  * e.g. call a model function
*
  SELECT LIFNR NAME1 LAND1 ORT01 FROM LFA1 INTO TABLE LT_LFA1 UP TO 50 ROWS.
  LO_ND_LFA1->BIND_TABLE( NEW_ITEMS = LT_LFA1 SET_INITIAL_ELEMENTS = ABAP_TRUE ).

Step5: Right click on component, create application and test.

Table UI element in web dynpro ABAP

Learner Questions


No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question

    Was this lesson helpful to you? Yes No 22 People out of 22 think this lesson helpful


    Lesson Navigation

    ←Previous Chapter
    Next Chapter →