cancel
Showing results for 
Search instead for 
Did you mean: 

How to control the order of error messages for mandatory input field

yes_sapteam
Participant
0 Kudos

Hello,

I've created a form with five input fields using WD Abap.

I've marked all of thosse fields mandatory.

I'd like to display an error message if the user left one of those fields empty.

I'de like the order of the error messages to correlate with the order of ther fields on the screen.

Meaning the first error will point to the first empty field and so on...

Unfortunatly WD framework display the errors based on the field's data element name.

This behavior may cause a situation where the first error point to the last empty field

The next error will point to the field above that and so on.

This kind of behavior is not so intuitive to the end user, Can I control the order ?

Thanks

Ziv.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I am facing same issue.

Did you get solution for this?

Regards,

Apurva

Former Member
0 Kudos

You can do validations in the order of fields in the form.

Katrice

Former Member
0 Kudos

Hi,

I have written validation code as per the order of fields in the form.

However, error messages are displayed in different order.

Regards,

Apurva

former_member182372
Active Contributor
0 Kudos

Unfortunatly WD framework display the errors based on the field's data element name.

Really?? Never faced behavior like that.

Post your code where you report the exception

Former Member
0 Kudos

Hi,

Are you using "report_attribute_error_message" method for reporting errors in WD application.

You can pass the Message Text, element and the attribute name to this method, and it will display the message with a link, if user clicks on the link it will automatically take them to the field

CALL METHOD lo_message_manager->report_attribute_error_message

EXPORTING

message_text = 'Error'

element = lo_el_cn_inpf

attribute_name = 'CA_MATNR'

RECEIVING

message_id = lv_msg_id.

Hope this will help you,

Amit