其他分享
首页 > 其他分享> > Web Dynpro for ABAP(15):Print

Web Dynpro for ABAP(15):Print

作者:互联网

3.20 Print

WDA调用浏览器打印界面

1.创建Print按钮,绑定事件PRINT;

2.实现ONACTIONPRINT事件;

method ONACTIONPRINT.
  DATA:l_api_componentcontroller TYPE REF TO if_wd_component.
  DATA:l_appl TYPE REF TO if_wd_application.
  l_api_componentcontroller = wd_comp_controller->wd_get_api( ).
  l_appl = l_api_componentcontroller->get_application( ).
  l_appl->print_page( ).
endmethod. 

3.在WDDOINIT事件中注册Action,好像不用?

"注册Print事件
  DATA:lo_api_controller TYPE REF TO if_wd_view_controller.
  DATA:lo_action TYPE REF TO if_wd_action.
  lo_api_controller = wd_this->wd_get_api( ).
  lo_action = lo_api_controller->get_action( name = 'PRINT' ).
  IF lo_action IS BOUND.
    lo_action->set( keep_messages = abap_true ).
  ENDIF.

标签:Web,wd,lo,Print,controller,action,ABAP,api,Dynpro
来源: https://www.cnblogs.com/tangToms/p/16365518.html