DATA:l_usage TYPE REF TO if_wd_component_usage .
l_usage = wd_this->wd_cpuse_my_alv( ).
IF l_usage->has_active_component( ) IS INITIAL .
l_usage->create_component( ).
ENDIF.
*获取数据:
data:Lo_table type REF TO if_wd_context_node .
data:lt_flight type if_main=>elements_table .
lo_table = wd_context->get_child_node( name = 'TABLE' ).
select * FROM sflight into CORRESPONDING FIELDS OF TABLE lt_flight
up to 100 ROWS .
lo_table->bind_table( EXPORTING NEW_ITEMS = lt_flight ).
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_my_alv( ).
DATA:l_config TYPE REF TO cl_salv_wd_config_table .
l_ref_interfacecontroller->set_data( lo_table ).
l_config = l_ref_interfacecontroller->get_model( ).
l_config->if_salv_wd_table_settings~set_visible_row_count( 5 ) .
使用component table ALV Table Interface View 显示。