Using table UI element in webdynpro ABAP

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  to  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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值