cancel
Showing results for 
Search instead for 
Did you mean: 

Validation

Former Member
0 Kudos

Hi gurus,

I have to views and the second view there is a submit button. On clicking of that button I am validating the inputs. And if first view has error i am firing an outbound plug to back in the view.

But the problem is the messages always displaying in the second view and the plug is not working.

I have tested the plug independently it is working fine.

Please suggest.

code for validation.

IF ls_type_of_appointment-appt_type IS INITIAL.

*clear the text used to display messages to ignore previous values stored

CLEAR l_text.

*get the final error message

CONCATENATE l_text_0 l_typ_of_appt l_text_1 INTO l_text.

  • report message

CALL METHOD l_message_manager->report_attribute_error_message

EXPORTING

message_text = l_text

element = lo_el_type_of_appointment

attribute_name = 'APPT_TYPE'

cancel_navigation = abap_false.

l_iserror = l_iserror + 1 .

ENDIF.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Use report element error message instead of attribute error message.

former_member515618
Active Participant
0 Kudos

Hi Prosun,

Method report_attribute_error_message is used to highlite the attribute which is incorrect/invalid.

In order to accomplish this, the WDA frame work ensures that the view in which the element exists is rendered back. So even though a plug is fired, it doesnt navigate to the other view.

Try using report_t100_message in the same class . It shud work ..

Hope this helps.

Regards,

Sravan Varagani

former_member182190
Active Participant
0 Kudos

Hi,

You can explicitly create a message area in your first view so that the message gets displayed in the First view.

Regards,

Ismail.

Former Member
0 Kudos

how to do that. please reply.

former_member182190
Active Participant
0 Kudos

Create a Message Area UI element as the top most element in your View.

Messages will be displayed there automatically.

Regards,

Ismail.

Former Member
0 Kudos

Hi Prosun Bondopadhyay ,

Usually it should work,

try putting the code for firing the plug inside a condition that check the message variable.. if the message variable is initial -> then fire else not

Regards

Sarath