Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Method to raise a warning

Former Member
0 Likes
781

Hi everyone,

I am trying to use this method to generate a warning message but somehow it's not working. can you please tell me what I am doing wrong.

data: abap_true type abap_bool value 'X'.

CALL METHOD lo_api_controller->get_message_manager

RECEIVING

message_manager = lo_message_manager.

CALL METHOD lo_message_manager->REPORT_WARNING

EXPORTING

SHOW_AS_POPUP = abap_true

message_text = 'You are leaving the current screen''.

Thank You

Rajeev

1 ACCEPTED SOLUTION
Read only

Subhankar
Active Contributor
0 Likes
730

Hi Rajeev,

You can try this way.

data: l_message_manager type ref to if_wd_message_manager.

l_message_manager = l_current_controller->get_message_manager( ).

call method l_message_manager->report_warning

exporting

message_text = i_message_text

show_as_popup = i_show_as_popup. " Flag need check

Thanks

Subhankar

Hi everyone,

I am trying to use this method to generate a warning message but somehow it's not working. can you please tell me what I am doing wrong.

data: abap_true type abap_bool value 'X'.

CALL METHOD lo_api_controller->get_message_manager

RECEIVING

message_manager = lo_message_manager.

CALL METHOD lo_message_manager->REPORT_WARNING

EXPORTING

SHOW_AS_POPUP = abap_true

message_text = 'You are leaving the current screen''.

Thank You

Rajeev

3 REPLIES 3
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
730

Wow ... I thought we could raise Warning messages using MESSAGE TYPE 'W'. Jokes apart, what is the reference object for lo_api_controller ?

If this is a custom object you need to provide the method implementation details as well.

Read only

Former Member
0 Likes
730

it's declared like this:

DATA lo_api_controller TYPE REF TO if_wd_controller.

Read only

Subhankar
Active Contributor
0 Likes
731

Hi Rajeev,

You can try this way.

data: l_message_manager type ref to if_wd_message_manager.

l_message_manager = l_current_controller->get_message_manager( ).

call method l_message_manager->report_warning

exporting

message_text = i_message_text

show_as_popup = i_show_as_popup. " Flag need check

Thanks

Subhankar