cancel
Showing results for 
Search instead for 
Did you mean: 

additional field validation

StefanRoesch
Active Participant
0 Kudos

Hi,

for example - I have a table element and one of its coloums is of type TIME. The automatic field validation (only valid times allowed) is working fine, but now i need to check that only full and half hours are entered. So if the user enteres "11:11" in a row I want this input-cell to be displayed with a red border and a message to be displayed.

I can check and show a message, but how to highlight that special cell?

Can I assign additional value checks to a context node and how to do this?

Whats the best approach?

Thanks for any help,

Stefan.

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Stefan,

As how pointed out by Karri you can make use of the report_attribute_error_message to throw an error message and highlight a particular cell of the table as well. Try going through this [link|; in which Andreas was trying to validate & highlight an ALV's cell with the same report_attribute_error_message.

Regards,

Uday

CALL METHOD lo_message_manager->report_attribute_error_message
          EXPORTING
            message_text   = 'Sample message text'
            element        = lr_element " Reference of type if_wd_context_element to the cell u want to highlight
            attribute_name = ls_modified_cells-attribute. " The context attribute name to which the column of this cell is bound to

Answers (2)

Answers (2)

StefanRoesch
Active Participant
0 Kudos

thanks a lot for your help !!

the element needs to be of the right index and then it works perfect

Former Member
0 Kudos

Hi,

Have you checked all the methods of the message manager (which you already are using for producing the error)? There is a method REPORT_ATTRIBUTE_ERROR_MESSAGE that should do what you are looking for. You need to give it the corresponding attribute as an import parameter, and it will highlight the field. To be honest I am not sure if it will work with tables (=context nodes with cardinality 0...n), and I don't have access to a system currently to check it. But I would guess that it works... At least it works perfecly with "single" input fields.

Regards,

Karri