WDA: A Simple Test of ALV

WebDynpro ALV组件创建
本文介绍如何在WebDynpro应用中创建并使用ALV组件。主要内容包括:创建WebDynpro组件、添加ALV组件、创建节点及属性、设置ALV数据、实现方法以及在视图中嵌入ALV等步骤。

1)Create a Web Dynpro Component ZLM_WDA_0009 and add a ALV Component 
WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV

WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV

2)Create Node and Attribute
WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV

3)Add Elements
WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV

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

4)Implement the methods

Instantiate ALV when initial
WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV

WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV


5)Set ALV data
WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV

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 .

6)Embed view for ALV

WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV


WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV

7)Create Application and test
WDA: <wbr>A <wbr>Simple <wbr>Test <wbr>of <wbr>ALV
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值