做了个简单的WDA的程序,效果如下
DATA lo_el_context
TYPE
REF
TO if_wd_context_element
.
DATA ls_context
TYPE wd_this
->element_context
.
DATA lv_att_carrid
TYPE wd_this
->element_context
-att_carrid
.
* get element via lead selection
lo_el_context
= wd_context
->get_element
(
)
.
* @TODO handle not set lead selection
IF lo_el_context
IS
INITIAL
.
ENDIF
.
* get single attribute
lo_el_context
->get_attribute
(
EXPORTING
name
=
`ATT_CARRID`
IMPORTING
value
= lv_att_carrid
)
.
然后set 内表的值,代码也会生成
具体实现过程如下:
创建web dynpro component
node存spfli 的内表,attribute 存搜索条件 单值CARRID
具体0-n什么意思按F1 查看
选择需要的字段
attribute
到view界面,添加element。可以拖拽,我喜欢邮件添加
首先是label
![web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
具体0-n什么意思按F1 查看
![web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
选择需要的字段
![web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
attribute
![web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
![web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
到view界面,添加element。可以拖拽,我喜欢邮件添加
![web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
首先是label
![web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID web <wbr>dynpro <wbr>for <wbr>abap <wbr>:Search <wbr>SPFLI <wbr>based <wbr>on <wbr>CARRID](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
搜索按钮
创建search action
*
*
*
然后set 内表的值,代码也会生成
然后创建application