on 11-10-2008 4:07 PM
Hi friends,
How can we show the error messages on WDA?
I mean, if for example.. i have a product field on screen, and user enters it.. if it is wrong product.. i want to show an error message..
also some error messages which my Function modules returns to me..
How can we show them?
could you pls let me know.. thanks in advance,
Niraja
Hi,
Showing the error message is very simple in WD ABAP.
just click on the Code Wizard (ctrl-F7 ) and select Generate Message.
now when you press F4 in the methods u will get all the method names which u can use.
For the error message u can choose "REPORT_ERROR_MESSAGE" method.
If u does not want to hard code the message then u can create your own messages in SE91.
And then use "RAISE_T100_ERROR" method.
get back to me if any problem.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
PG,
I did this way what u told.. data: l_current_controller type ref to if_wd_controller,
l_message_manager type ref to if_wd_message_manager.
l_current_controller ?= wd_This->Wd_Get_Api( ).
CALL METHOD l_current_controller->GET_MESSAGE_MANAGER
RECEIVING
MESSAGE_MANAGER = l_message_manager
report message
CALL METHOD l_message_manager->REPORT_T100_MESSAGE
EXPORTING
MSGID = 'E1'
MSGNO = '360'
MSGTY = 'S'
P1 = ' -> REPORT_T100_MESSAGE'.
But initially i dont show any error messages, but when i have error messages showing up at the top of my WDA using above method, my complete wda is going out of alignment. I have transparent containers, between tables.. that transparent containers height is getting increased...
can you tell me is there a way out where its not going mis aligned.
kindlreply
Niraja
Hi friends,
i m using CALL METHOD l_message_manager->REPORT_T100_MESSAGE to display all error messages and it working fine showing up on top.
But when i have error messages showing up, my other ui elements are going crazy.
i have tables..
when error messges are coming,, i m getting gaps between tables..
is there anyway to figure this out friends..
i have 3 tables .. on my layout.
kindly respond,.
thanks in advance,
niraja
Hi Niraja,
You can try proceed in this way. Create a TransparentContainer at the area where you want your messages to be displayed. Specify fixed width & height for this TransparentContainer. Now embed the MessageArea ui element inside this TransparentContainer so it would also inherit the same properties as the TransparentContainer. Now if the number of messages increases the TransparentContainer would get a scrollbar & they would get displayed within the fixed area specified by you. You wouldn't be having the problem of them eating up too much of your screen space.
Regards,
Uday
Hi Niraja,
You don't have to do anything in order to have the messages displayed in the MessageArea. You just have to use any of the WDA techniques to report a message & they would all automatically get displayed in this MessageArea. So you dont have to worry about it. And 1 more thing which I had forgot in my earlier post is to set the scrollingMode property of the TransparentContainer to "Auto" so that you will have the scrollbars appear within the container depending up on the number of messages that are getting displayed. If you ommit setting this property you will find no difference & all the messages would get displayed like how they were getting earlier & eat up your screen space.
Regards,
Uday
Hi Niraja,
Since you are saying that you have an internal table, with message type, id, no & text then you can go for the message reporting using REPORT_T100_MESSAGE.
* 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 .
* report message
CALL METHOD lo_message_manager->report_t100_message
EXPORTING
msgid = " your message class name
msgno = " your message number within the message class
msgty = " The type of message error/warning
* p1 =
* p2 =
* p3 =
* p4 = .
You can use the P1, P2,.. P4 for passing any values using placeholders to the message.
Regards,
Uday
Hi Niraja,
WDA have a very friendly enviroment for displaying error messages.
Here you can use a UI element called message area to sho the error messages or u can use existing message classes to create error messages.
Now lets consider you want to use option 1 i.e message area then following code shoul be used where ever you want(the only consition is thta you need to include message area elemnt in your view)
get message manager
data: l_current_controller type ref to if_wd_controller,
l_message_manager type ref to if_wd_message_manager.
l_current_controller ?= wd_This->Wd_Get_Api( ).
CALL METHOD l_current_controller->GET_MESSAGE_MANAGER
RECEIVING
MESSAGE_MANAGER = l_message_manager
report message
CALL METHOD l_message_manager->REPORT_ATTRIBUTE_ERROR_MESSAGE
EXPORTING
MESSAGE_TEXT = 'Please enter from city'
ELEMENT = Elem_Flights
ATTRIBUTE_NAME = 'CITYFROM'.
Now lets consider you want to go for second option i.e error message by using T100 MESSAGE.(you must be knwing how to use se93 tcode)
get message manager
data: l_current_controller type ref to if_wd_controller,
l_message_manager type ref to if_wd_message_manager.
l_current_controller ?= wd_This->Wd_Get_Api( ).
CALL METHOD l_current_controller->GET_MESSAGE_MANAGER
RECEIVING
MESSAGE_MANAGER = l_message_manager
report message
CALL METHOD l_message_manager->REPORT_T100_MESSAGE
EXPORTING
MSGID = 'E1'
MSGNO = '360'
MSGTY = 'S'
P1 = ' -> REPORT_T100_MESSAGE'.
So the only difference between two processes is that in case two u dont have message area element in the view.
if you can any doubt feel free to ask.
regards
PG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Niraja,
U can use the UI Element 'MessageArea' on the view to display the Error/Warning messages.
Check the example : WDR_TEST_MESSAGE_AREA
Ranganathan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to display the messages on top of yoru screen always, then you don't need to create the UI element message area. But if you want display the messages in some speicific part of your view, then you need 'message area' UI element.
Ok for displaying the message call this method
CALL METHOD l_message_manager->report_t100_message
EXPORTING
msgid = ls_errores-id
msgno = ls_errores-number
msgty = ls_errores-type
p1 = ls_errores-message_v1
p2 = ls_errores-message_v2
p3 = ls_errores-message_v3
p4 = ls_errores-message_v4
view = 'ID_BODY'.
Here you need to pass message class, message number and message type (E,S,W etc..)
Hope it works.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.