cancel
Showing results for 
Search instead for 
Did you mean: 

Messages in Web DYNPRO

Former Member
0 Kudos

Hi Gurus,

Can anybody help me to learn different types of messaging in Web Dynpro?

And some links to learn all about messaging in web dynpro.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Veera

There are two ways to define where messages are to be displayed on the screen:

1. The default position of the message area is on top of the page. If this position

is fine, the developer does not have do anything.

2. If a position different from the default message area position is desired,

the MessageArea container UI element has to be used. A MessageArea UI

element can be defined as a sub-element of all other container elements.

Message Handling

In the Web Dynpro application, you can set the way messages are displayed. On

the Properties tab of a Web Dynpro application, message handling can be defined

by setting the radio button to the following values:

• Show Message Component on Demand

If at least one message is reported, the message area is displayed in a

group-box style. The message area contains the last message and information

about the number of messages reported in total. In addition, a button is

displayed, allowing the user to display all messages in a list. Messages

related to UI elements are displayed as links. Selecting such a link navigates

to the UI element related to the message.

• Always Display Message Component

In addition to the behavior described above, the message area is also

displayed if no message is reported.

• Display Messages Without Message Component

All messages reported are displayed in the message area. This area does not

have a group-box style, but it is transparent. All messages are displayed

at once; no extra navigation is required to obtain the list of all messages.

Messages related to UI elements are displayed as links. Selecting such a link

navigates to the UI element related to the message.

Methods for Defining Messages:

In order to report a message, methods of the IF_WD_MESSAGE_MANAGER

interface have to be used. The Web Dynpro runtime automatically instantiates a

class implementing this interface. The reference to this class can be obtained from

the self reference WD_THIS, using the expressions:

r_api = wd_this->wd_get_api().
r_mmanager = r_api->get_message_manager().

Methods

REPORT_ATTRIBUTE_ERROR_MESSAGE (Parameter PARAMS)

REPORT_SUCCESS (Parameter PARAMS)

REPORT_WARNING (Parameter PARAMS)

REPORT_ERROR_MESSAGE (Parameter PARAMS)

REPORT_FATAL_ERROR_MESSAGE (Parameter PARAMS)

REPORT_ATTRIBUTE_EXCEPTION NO (Parameters ELEMENT, ATTRIBUTE_NAME)

REPORT_FATAL_EXCEPTION

REPORT_ATTRIBUTE_T100_MESSAGE (Parameters P1, P2, P3, P4)

REPORT_T100_MESSAGE (Parameters P1, P2, P3, P4)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi,

You can use Message class & Code Wizard for this. There are diffent kind of messages that you can also handle at attribute level also.

Please use code wizard for this. you can also include standard messages i.e. se91 also to this message class.

Best Regards

Ravi

Former Member
0 Kudos

HI Veera,

You can use MESSAGE AREA ui element on you webdynpro VIEW to fix place where messages would be displayed. Next you can use Message Manager, its and interface IF_WD_MESSAGE_MANAGER that needs to be instantiated like any other component.

Well the easiest way to use it is thru the code wizard CTRL+ F7 Generate Message. It has lots of methods that accept STRING , thus allowing you to easily specify the User Understandable instruction.

All thru the course ABAP regular exception handling , messages from the abap classes can be first stored in string variables then presented in WD Abapa using the MESSAGE_MANAGER

[http://help.sap.com/saphelp_nw70/helpdata/en/6c/7aae42cd7fb611e10000000a155106/frameset.htm]

Greetings

Prashant

vivekananthan_sellavel
Active Participant
0 Kudos

hi can use;

data l_message_manager type ref to if_wd_message_manager.

data l_current_controller type ref to if_wd_controller.

  • Get the API of the Current Controller

l_current_controller ?= wd_this->wd_get_api( ).

  • Get the Message manager from the Controller

call method l_current_controller->get_message_manager

receiving

message_manager = l_message_manager.

data: mess type string value 'Sample Message'.

if ls_input is initial.

  • Set Message on the Screen Using Message Manager

  • Commanlly used Messages

call method l_message_manager->report_success( mess ).

l_message_manager->report_warning( mess ).

l_message_manager->report_error( mess ).

  • Dont use Report message

Because it totally come out from the process.

Former Member
0 Kudos

hi Veera

  • DECLARATION FOR MESSAGE MANAGER.

data l_message_manager type ref to if_wd_message_manager.

data l_current_controller type ref to if_wd_controller.

  • Get the API of the Current Controller

l_current_controller ?= wd_this->wd_get_api( ).

  • Get the Message manager from the Controller

call method l_current_controller->get_message_manager

receiving

message_manager = l_message_manager.

if ls_input is initial.

  • Set Message on the Screen Using Message Manager

call method l_message_manager->report_t100_message

exporting

msgid = 'ZGDEMO'

msgno = '000'

msgty = 'E'.

endif.

In if_wd_message_manager interface you will find different methods for displaying Erros,messages, and Warnings.

Just refer the interface if_wd_message_manager, and use the above code for reference.

Regards,

Xavier.P

Former Member
0 Kudos

Hi,

Using messages in WD ABAP is very simple. U need to go to the code wizard( Ctrl F7 ) and then select generate message.

Here in the method press F4. U will get a no of methods which u can use.

Check the link below for details of all the methods of interface IF_WD_MESSAGE_MANAGER

http://help.sap.com/saphelp_nw04s/helpdata/en/6c/7aae42cd7fb611e10000000a155106/frameset.htm

Regards

Pankaj Aggarwal

Former Member
0 Kudos

hi,

Messages are integrated into the message log of a component using the Message Manager (interface IF_WD_MESSAGE_MANAGER)

->For Creating messages in Webdynpro Abap, you need to go to code wizard(control +F7).

->When you go to code wizard, you will se message manager there.

-> Use this code wizard to generate different types of message like -

Error message

Report success message.

Info message.

-> You can create which ever message you want and use the same in your code.

I hope it helps.

Thanx.

former_member402443
Contributor
0 Kudos

Hi Karthik,

Please go thru the Link provided below regarding the messages in WDA.

[Messages in Web Dynpro|http://help.sap.com/saphelp_nw04s/helpdata/en/77/3545415ea6f523e10000000a155106/frameset.htm]

Regard

Manoj Kumar