![WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
2)Create Node and Attribute
![WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
3)Add Elements
![WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
a view container for alv
![WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
![WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
4)Implement the methods
Instantiate ALV when initial
5)Set ALV data
![WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
![WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
5)Set ALV data
![WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
Code:
METHOD wddoinit
.
"instantiate ALV conponent object
DATA lo_cmp_usage
TYPE
REF
TO if_wd_component_usage
.
lo_cmp_usage
= wd_this
->wd_cpuse_alv
(
)
.
IF lo_cmp_usage
->has_active_component
(
)
IS
INITIAL
.
lo_cmp_usage
->create_component
(
)
.
ENDIF
.
"create node
DATA lo_nd_node_spfli
TYPE
REF
TO if_wd_context_node
.
DATA lt_node_spfli
TYPE wd_this
->elements_node_spfli
.
* navigate from to via lead selection
lo_nd_node_spfli
= wd_context
->get_child_node
( name
= wd_this
->wdctx_node_spfli
)
.
"binding node
DATA lo_interfacecontroller
TYPE
REF
TO iwci_salv_wd_table
.
lo_interfacecontroller
= wd_this
->wd_cpifc_alv
(
)
.
lo_interfacecontroller
->set_data
(
* only_if_new_descr = " wdy_boolean
r_node_data
= lo_nd_node_spfli
" ref to if_wd_context_node
)
.
ENDMETHOD .
*
*
ENDMETHOD .
6)Embed view for ALV