ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Web Dynpro for ABAP(13):Messages

2022-06-11 11:34:53  阅读:202  来源: 互联网

标签:Web wd area manager Reports REPORT ABAP Dynpro message


3.18 Messages

WDA运行过程中显示提示信息。

示例:WDR_TEST_MSG_AREA;

使用接口类:IF_WD_MESSAGE_MANAGER;

类中方法:

CLEAR_MESSAGES:Deletes all messages

IS_EMPTY:Queries whether messages are available

REPORT_ATTRIBUTE_ERROR_MESSAGE:Reports a Web Dynpro exception for a context attribute

REPORT_ATTRIBUTE_EXCEPTION:Reports a Web Dynpro exception for a context attribute

REPORT_ATTRIBUTE_T100_MESSAGE:Reports a Web Dynpro exception for a context attribute

REPORT_ERROR_MESSAGE:Reports a Web Dynpro message with optional parameters

REPORT_EXCEPTION:Reports a Web Dynpro exception (may be returned)

REPORT_FATAL_ERROR_MESSAGE:Reports a fatal Web Dynpro message with optional parameters

REPORT_FATAL_EXCEPTION:Reports a fatal Web Dynpro exception

REPORT_SUCCESS:Reports a success message

REPORT_T100_MESSAGE:Reports a message using a T100 entry

REPORT_WARNING:Reports a warning

 

配置Message Area,使用接口类:IF_WD_MESSAGE_AREA方法。

示例:

l_api_mycomp type ref toif_wd_window_controller,

l_wd_message_area type ref toif_wd_message_area.

l_api_mycomp ?=wd_this->wd_get_api ( ).

l_wd_message_area = l_api_mycomp->get_message_area ( ).

l_wd_message_area->set_display_attributes (

i_for_all_instances =''

i_msg_lines_visible ='0'

i_use_toggle_area =' '

i_show_only_current ='' ).

设置参数说明:

i_use_toggle_area = '':New design of the message area (default setting)

i_use_toggle_area = 'X':Old design of the message area (with the toggle area)

i_msg_lines_visible = 0:All messages are immediately visible (default setting)

i_msg_lines_visible = <x>:x > 0. Only x messages are immediately visible; the rest become visible by scrolling.

i_show_only_current = 'X':Together with i_use_toggle_area = '' this means that no message log can be displayed (default setting)

i_show_only_current = '':Together with i_use_toggle_area = '' this means that a link takes you to where the message log can be displayed

 

Message使用实例:

在COMPONENTCONTROLLER中创建公共方法SHOW_MSG;

输入参数MSG,Type:STRING;

输入参数MSG_TYPE,Type:CHAR1;

 

示例:

  "显示信息
  DATA:l_current_controller TYPE REF TO if_wd_controller.
  DATA:l_message_manager    TYPE REF TO if_wd_message_manager.
  
  "获取message manager
  l_current_controller ?= wd_this->wd_get_api( ).
  CALL METHOD l_current_controller->get_message_manager
    RECEIVING
      message_manager = l_message_manager.

  IF msg_type = 'S'.
    "report message
    CALL METHOD l_message_manager->report_success
      EXPORTING
        message_text = msg.
  ELSEIF msg_type = 'E'.
    "report error
    CALL METHOD l_message_manager->report_error_message
      EXPORTING
        message_text = msg.
  ELSEIF msg_type = 'I'.
    "report information
    CALL METHOD l_message_manager->report_message
      EXPORTING
        message_text = msg.
  ENDIF.

 

标签:Web,wd,area,manager,Reports,REPORT,ABAP,Dynpro,message
来源: https://www.cnblogs.com/tangToms/p/16365498.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有