cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrurn error message to main view?

Former Member
0 Kudos

Hi

I have a Z WebDynpro that has 2 view: Main and PopUp view

When i press a button in the main view it calles the popup view in a popup window.

The PopUp contains to buttons "yes" and "No"

when user press YES it update the db with some details. Before the DB update is executed i have some check, when the checkes failed the popup window is closed and i want the user will see them in the main view.

is it possible to display the messages in the main view ? cause the checks happens when i m in the popup view/window.

Thanks Ami

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

i added the following code

call method lo_api_controller->get_message_manager

reciving

message_manager = lo_messge_manager.

call method lo_message_manager->report_message

exporting

message_text = 'error in update'.

return .

and now colsing command to the popup window

but i dont get the message in the main view but in the popup view

how can i fix it - cause  i want the error message to b displayed in the main view

thanks

ramakrishnappa
Active Contributor
0 Kudos

Hi Ami,

The messages will be deleted on subsequent action.i.e. let us say you have shown an error message during update on popup window and pressed close button. hence the message no more available in the message manager to display in main view.

I suggest you to put the code for reporting error message during close action of popup window.

Otherwise, you can set the messages as permanent so that it stays even during further action.


call method lo_message_manager->report_message

exporting

message_text = 'error in update'

is_permanent    = abap_true.

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

also check, that CANCEL_NAVIGATION = SPACE.

former_member184578
Active Contributor
0 Kudos

Hi,

Pass the view name in VIEW parameter of report message to display in corresponding view,

modification to your code:


call method lo_api_controller->get_message_manager

reciving

message_manager = lo_messge_manager.

call method lo_message_manager->report_message

exporting

message_text = 'error in update'

view     = 'MAIN' .

then the message will be displayed on MAIN view when the popup is closed.

hope this helps u,

Regards,

Kiran

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Create Event Handler onaction method when that check fails in your Pop up Screen, and in onaction method implement a code to handle error message in your main view by using interface IF_WD_MESSAGE_MANAGER using method REPORT_ERROR_MESSAGE.

Regards

Shiv

ramakrishnappa
Active Contributor
0 Kudos

Hi Ami,

Yes, you can do it.

The message manager is at component level and you can still able to see the messages at main view when messages are reported and closed the popup at same time.

Hope you are using the methods from the interface : IF_WD_MESSAGE_MANGER

Regards,

Rama