Using table UI element in webdynpro ABAP
2018-02-12 15:11
1586 查看
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.
Go to context of main view, click on change mode, right click on context -> create -> node.
A popup will open, provide node name as LFA1, data dictionary structure as LFA1, click on add attributes from structure button.
Select required attributes, enter.
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.
Step3:Create data binding for table.Right click on table, click on create binding, click on context.
Select LFA1.
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.
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.
Go to context of main view, click on change mode, right click on context -> create -> node.
A popup will open, provide node name as LFA1, data dictionary structure as LFA1, click on add attributes from structure button.
Select required attributes, enter.
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.
Step3:Create data binding for table.Right click on table, click on create binding, click on context.
Select LFA1.
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.
相关文章推荐
- Using drop down by key in webdynpro ABAP
- 个人收藏 Dropdown by index in ALV using in Web Dynpro
- Creating editable ALV using webdynpro for ABAP
- ABAP Web dynpro ALV report table
- Radio button group by Key in webdynpro ABAP
- 【转贴】【ABAP】Call web dynpro in web dynpro
- Programming dynamic ALV in WebDynpro for ABAP
- Web Dynpro for ABAP: creating Dynamic UI Elements and Context: Step by Step
- note about studying ALV in abap webdynpro
- changing the header text in the alv displayed in web dynpro abap
- Export Grid Data To Excel In Advance Kendo UI Using MVC WEB API And Entity Framework
- Dropdown by index in ALV using in Web Dynpro
- Hook Methods in webdynpro ABAP
- 【原创】【ABAP】Opening SAP Transaction Code in SAP GUI Window from WebDynpro through URL
- 个人收藏 Totals and Subtotals in ALV Web Dynpro (Web Dynpro for ABAP)
- Web Dynpro for ABAP "调用 SALV_WD_TABLE GET_MODEL 时没有数据" 报错解决
- 个人收藏 Programming dynamic ALV in WebDynpro for ABAP
- ABAP Web dynpro ALV report table
- 问题:iOS8设置tableview的setSeparatorInset:UIEdgeInsetsZero不起作用
- vue elementUI webpack 前端坑;