cancel
Showing results for 
Search instead for 
Did you mean: 

Mandatory Error Message of the view in Popup window

former_member252723
Participant
0 Kudos

Dear All,

I am able to display the custom error messages in the pop up window by creating a view & window for the popup.

My requirement is to display the "Fill in all required fields" error messages in the popup window and when they click on that message then it should take to that field of different view.

Regards,

Mustafa

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Mustafa,

CHK_MANDATORY_ATTR_ON_VIEW method of class  CL_WD_DYNAMIC_TOOL will help to handle error message for multiple mandatory fields on a single views.it  checks all the mandatory fields on the screens.


Property State value should be required  but it will make it as * m ark but it won’t work as a mandatory filed ,we have to code explicitly to handle the error message for emptiness.

Method CHECK_MANDATORY_ATTR_ON_VIEW of class CL_WD_DYNAMIC_TOOL to perform Mandatory check for input field UI elements with property STATE as 'required'.

you can write in hook method WDDOBEFOREACTION or on some event handler when you want to check the emptiness.

Below piece of code may be help you 

data: lt_msg TYPE cl_wd_dynamic_tool=>t_check_result_message_tab,

lo_view_controller TYPE REF TO if_wd_view_controller,

lo_message_manager type ref to if_wd_message_manager.

lo_view_controller ?= wd_this->wd_get_api( ).

lo_message_manager = lo_view_controller->get_message_manager( ).

cl_wd_dynamic_tool=>check_mandatory_attr_on_view(

EXPORTING

view_controller = lo_view_controller

display_messages = abap_true

IMPORTING

messages = lt_msg ).

if you want to move to main view after the POP Up action , you can use below code.

window  type ref to if_wd_window.

wd_this->window->set_close_in_any_case( abap_true ).

If above solution dose not fit your requirement please explain your issue clearly , so some one can try to answer .

Thanks

Nidhi

former_member252723
Participant
0 Kudos

Hi Nidhi,

I have already done this but what I actually want is to display this error messages in a pop up window and when the user clicks on this message it will take to that field on the main view.

Regards,

Mustafa

Szczerbowski
Active Participant
0 Kudos

Unless you have a really good reason for that you should use Message Area for that, and not a pop-up.

former_member252723
Participant
0 Kudos

Hi Michal,

It is a client requirement to display the messages in popup .

Regards,

Mustafa

Szczerbowski
Active Participant
0 Kudos

Then maybe you can try eventing, with a custom param of type error message, and rethrow the error message once popup is closed, but this time in the main view controller?

I don't want to sound smartass but if I had that requirement i would really argue with the business to drop it.

Szczerbowski
Active Participant
0 Kudos

Hi,

I am not sure a cross-window navigation is a good architecture.

Pop ups in general are better to be avoided, and messages should refer to the window you're workig on.

On the REPORT_ATTRIBUTE_ERROR_MESSAGE you have a parameter to specify the VIEW, but I don't know if it works properly, and even then a typical popup would prevent you from accessing the background screen, you'd have to go modal.

Then why would you keep a popup open if the fields to work on are in the other view.

If you want a 'popup' like behaviour of the message area, I think it's available in the recent netweaver versions even for WDA.