cancel
Showing results for 
Search instead for 
Did you mean: 

Display Error Message in ESS

Former Member
0 Kudos


Dear all,

I have a requirement in WEB DynPro, Our ESS system using WEB DynPro.

In ESS leave system need to display error message.ie

once leave approved, employees are not allowed to change the leave.

Any idea to write code to display error message.

Thanks.

Shruthi.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Error messages can be displayed in two ways:

1. In the message area

2. As a popup

Below are the code snippets for it.

1.

* get message manager

  DATA lo_api_controller     TYPE REF TO if_wd_controller.

  DATA lo_message_manager    TYPE REF TO if_wd_message_manager.

  lo_api_controller ?= wd_this->wd_get_api( ).

  CALL METHOD lo_api_controller->get_message_manager

    RECEIVING

      message_manager = lo_message_manager.

    CALL METHOD lo_message_manager->report_error_message

      EXPORTING

        message_text = 'Error message'.


2.

"Display Popup 

  DATAl_popup  TYPE REF TO if_wd_window,

         l_text  TYPE string_table.

  APPEND `Error Message` TO l_text.

  l_popup = wd_comp_controller->wd_get_api( )->get_window_manager( )->create_popup_to_confirm(

    text  = l_text

    close_button = abap_false

    button_kind  = if_wd_window=>co_buttons_ok

    message_type  = if_wd_window=>co_msg_type_error

    window_title  = 'Error'

    window_position = if_wd_window=>co_center ).

  l_popup->open( ).



Hope this helps!

Former Member
0 Kudos

Hi I tried the first part of the code , just to display er message in a screen.

error - Field 'WD_THIS'  is unknown.

0 Kudos

The code should be implemented in one of the controller methods of your Webdynpro component.

Each controller contains a local interface which can be accessed in the controller.

The controller attribute WD_THIS is a reference to this local interface. Depending on the controller, a reference variable is of the following type:

  • IF_COMPONENTCONTROLLER
  • IF_<MY_CUSTOM_CONTROLLER>
  • IF_<MY_VIEW>
  • IF_<MY_WINDOW>
Former Member
0 Kudos

I am very new to this , so I write the above code in ABAP Editor, so how to declare that 'WD_THIS'?

0 Kudos

Could you post a screenshot of how and where you are trying to implement the code?

Former Member
0 Kudos

Can you send ur email account.

former_member197475
Active Contributor
0 Kudos

Hi Shruthi,

I guess you should have deleted the reference piece of code.

BR,

RAM.