cancel
Showing results for 
Search instead for 
Did you mean: 

problem with message area.....

Former Member
0 Kudos

Hi friends, I am using the below code to display any errors which my Function module returns.

l_current_controller ?= wd_this->wd_get_api( ).

CALL METHOD l_current_controller->get_message_manager

RECEIVING

message_manager = l_message_manager.

CALL METHOD l_message_manager->report_t100_message

EXPORTING

msgid = ls_messages-msgid

msgno = ls_messages-msgno

msgty = ls_messages-msgty

p1 = lv_msg1

p2 = lv_msg2

p3 = lv_msg3

p4 = lv_msg4.

If i have errors in my WDA.. once when i hit a button or trigger any action.. the errors are going (not visible any more). I want them to be there till i use clear_messages( ) method .

Becuase the user is not able to know what errors are there and what he has to change in the screen.

can be this possible in WDA// i want the message area to be displayed the errors though i do any other actions..

kindly reply,

Niraja

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi neerja,

When r u calling this fuction module? If you do it in Domodifyscreen method, it should be always there?

Best regards,

Rohit Mahajan

Former Member
0 Kudos

Rohit,

I am callign this in wddoinit of comp controller.

along with my WDA loads, i want to show the sales orders errormesages..

once the page loads with errors if i click somewhere like adding a new row to a table or a dropdown value chagne.. its gone..

and also again on submit button aswell, i am calling a FM which can also return error messages..

can some one tell me how to permanenty make that error messages there.. till i again hit submit button and clear them, and make if possible with new errors????

Niraja

Former Member
0 Kudos

hi,

i am calling same kind of thing in WDDOMODIFYVIEW of the view and it is displaying always.

May be you can try same and check if helps?

Best regards,

Rohit

Former Member
0 Kudos

Rohit that doenst work for me..

because i have to hit submit button to savve the sales order Once that button is hit, im caling a FM to save that sales order, which can return the messages.

so i dont have a scope to use that method?

if possible then how can i acheive this is there any solution?

niraja

arjun_thakur
Active Contributor
0 Kudos

hi niraja,

do all the coding in domodifyview method. it'll work.

regards

arjun

uday_gubbala2
Active Contributor
0 Kudos

Hello Niraja,

Did you try displaying the error messages in the WDDOAFTERACTION hook method. I guess that it should work from in there coz it would get triggered whenever any action is triggered within your view.

Regards,

Uday

Former Member
0 Kudos

Hi

Do the coding in WDDOMODIFYVIEW. it is working fine, handle the actions in this method only

i checked this.

Best regards,

Rohit

Answers (1)

Answers (1)

pranav_nagpal2
Contributor
0 Kudos

hi Niraja,

write this code in wddomodify************************

method WDDOMODIFYVIEW .

if first_time eq ABAP_TRUE.

else.

  • get message manager

DATA lo_api_controller TYPE REF TO if_wd_controller.

DATA lo_message_manager TYPE REF TO if_wd_message_manager.

types:

begin of ty_s_message,

msg_index type i,

element type ref to

if_wd_context_element,

attribute_name type string,

err_message type string,

msg_type type i,

msg_object type ref to if_message,

msg_user_data type ref to data,

msg_parameter type wdr_name_value_list,

is_permanent_msg type abap_bool,

scope_permanent_msg type wdr_message_scope,

controller_permanent_msg type ref to if_wd_controller,

view type string,

show_as_popup type abap_bool,

attributes type string_table,

is_validation_independent type abap_bool,

msg_id type string,

end of ty_s_message .

data:

ty_t_messages type table of ty_s_message with default key .

data wa_msg TYPE ty_s_message.

lo_api_controller ?= wd_this->wd_get_api( ).

CALL METHOD lo_api_controller->get_message_manager

RECEIVING

message_manager = lo_message_manager

.

IF wd_this->IFLAGTEST = 3.

  • get message manager

  • report message

CALL METHOD lo_message_manager->report_error_message

EXPORTING

message_text = wd_this->msgtext

  • params =

  • msg_user_data =

  • is_permanent = ABAP_FALSE

  • scope_permanent_msg = CO_MSG_SCOPE_CONTROLLER

  • view =

  • show_as_popup =

  • controller_permanent_msg =

  • msg_index =

  • cancel_navigation =

.

else.

  • report message

CALL METHOD lo_message_manager->get_messages

receiving

RESULT = ty_t_messages

.

loop at ty_t_messages INTO wa_msg.

wd_this->msgtext = wa_msg-err_message.

ENDLOOP.

wd_this->IFLAGTEST = 3.

endif.

endif.

endmethod.

NOTE: msgtext is a global variable of type string.

and IFLAGTESt is also a global variable of type integer.

keep all your messages as it is...... note this is for just keeping the error message as it is........ you have to do some coding to clear these messages.

regards

Pranav