cancel
Showing results for 
Search instead for 
Did you mean: 

problem with *'REPORT_ATTRIBUTE_MESSAGE'* error message.

Former Member
0 Kudos

hello gurus,

i have one requirement in webdynpro abap regarding creation of employe.for this i need to check employee status.

if employee status is fulltime then only system should allow for employee creation or else raise error message please check the

status,this is my requirement. for this i used 'REPORT_ATTRIBUTE_MESSAGE' method.ok now i can check status successfully with this method and i can change the status and systm allowing me for cretion of employee in another view successfully.now i am navigate to initial screen the previously raised error message appears again in the initial screen but it should not raise again.

can any body suggest me regarding this issue and could any one send me sample logic regarding thsi if possibl

regards,

babu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

use CLEAR_MESSAGES method of IF_WD_MESSAGE_MANAGER to delete the messages in message area once you navigate to another view. So that when you come back, you wont see the messages again.

Hope this helps!

Best Regards,

Srilatha

Former Member
0 Kudos

hi,

thanks for your reply.

already i had used CLEAR_MESSAGES message .but it is not working.i got one dought.in which place i have to use this CLEAR_MESSAGES method to clear the messages.

could you suggest me any one on this.

regards

babu

Former Member
0 Kudos

Hi,

One question i have is where you are doing the validation for your status field?? i mean which method? i hope it will be an action handler method.

You have mentioned that you are already using CLEAR_MESSAGES in your code. It would have been good if you had mentioned where exactly you are calling that method.

My suggestion is to put call to CLEAR_MESSAGES method in wdDoInit( ) method of your first view. If incase, view's property lifetime is set to 'when visible', then i guess wdDoInit( ) method would be called when you are coming back from your second view to first view. Or alternatively you can place it in the handle<inbound_plg> method in the first view. Here <inbound_plg> in the first view is connected to the outbound plug of your second view.

Hope this helps!

Best Regards,

Srilatha

Former Member
0 Kudos

dear Srilatha,

thanks for your reply.

but my problem is not yet resolved. thats i will explain about my issue again then you can understand my problem.

i have two views.in first view i have one alv table in that employee details(empno , name, designation,status) and one button for

create clearence certificate against selected employee in the alv.if i select one row means one employee and i click on button of first view first it should validate status of employee as full time employee.if not status as 'full time employee' it should through error message.this i have achived with *REPORTATTRIBUTE_ERROR_MESSAGE*_ .to display this error i have used message area in first view at bottom level.it is working fine.now i changed staus to full time employee and that error message disappear in the message area.now it is allowing me to navigate to second view to create clearence certioficate against selected employee.now i saved the data in second view and click on back button in second view. now i can navigate to first view again,but that error message is displaying again and that attribute staus field also marked with red mark.but it should not displaying error message again .

NOTE1 : i have used one method in component controller for

  • Reference component controller API

DATA lo_api_controller TYPE REF TO if_wd_controller.

  • Determine component controller API

lo_api_controller ?= wd_this->wd_get_api( ).

  • Determine Message Manager

wd_this->messagemanager =

lo_api_controller->get_message_manager( ).

and i maintained one attribute messagemanager in attributes tab of component controller as public.

NOTE2 : i have used clear_message method in inbound plug of first view which was attached to outbound plug of second view which was triggered when we press back button.that logic was

CALL METHOD wd_comp_controller->go_mm->clear_messages

EXPORTING

including_permanent_msg = ABAP_TRUE

only_permanent_msg = ABAP_TRUE

.

also ia have maintained the clear_messages logic in doinit and under back action also.

could any one suggest me on this issue and is there any problem regarding calling of *REPORTATTRIBUTE_ERROR_MESSAGE_ method .what parameters should i pass to *REPORTATTRIBUTE_ERROR_MESSAGE_ .

Former Member
0 Kudos

Hi Rajasekhar,

while using Report_attrubute_message provide view name also. So that that message will appear in that view only.

CALL METHOD lo_message_manager->report_error_message
EXPORTING
message_text = ' Error messge Text'
* params =
* msg_user_data =
* is_permanent = ABAP_FALSE
* scope_permanent_msg = CO_MSG_SCOPE_CONTROLLER
 view =   VIEW_NAME // your veiw name.
* show_as_popup =
* controller_permanent_msg =
* msg_index =
* cancel_navigation = ' X'
receiving
message_id = .

Cheers,

Kris.

Former Member
0 Kudos

hi kris,

thanks for your valuable reply.

here i have two views i checked status in first view and i need to check employee status in this view only.

if employee status is fulltime then only system should allow for employee creation or else otherwise

raise error message please check the status,this is my requirement.

for this i used 'REPORT_ATTRIBUTE_MESSAGE' method and raised error message in first view.

now i changed the status in first view to fulltime and system allowing me to navigate to second view and i created employee in second view.

again i navigated to first view.now again i have found that error message in the first view displaying in message area like

please check the status. but once status change to fulltime it should not display error message in first view.

hi could you suggest me how can i resolve this issue.i have written the code same as what ever the code you have sended.

regards,

babu.