cancel
Showing results for 
Search instead for 
Did you mean: 

Highlight input field at runtime

YogSSohanee
Participant
0 Kudos

Hello,

I have a requirement of highlighting a inputfield.

This inpufield is binded with an attribute DATE. I want to create an error message if the date is in the past and at the same time the inpufield for DATE attribute should be highlighted( = red border).

Please suggest.

Regards,

Yogesh

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi,

Make use of REPORT_ATTRIBUTE_ERROR_MESSAGE method. This method will generate the error message. If the error message is clicked, the focus will be transferrred to the UI element which has caused the error.

Regards

Arjun

YogSSohanee
Participant
0 Kudos

Thanks arjun for your reply, i already tried this method but not getting the desired output with this method. Could you please provide any available implementation of this method...so it would be more clear for me.

Thanks in advance!

Former Member
0 Kudos

Dear Yogesh,

You need to declare a field-symbol of type csequence.

FIELD-SYMBOLS: <LV_MSG> TYPE CSEQUENCE.

And the implementation methodology for this method is:

 ASSIGN 'Entered date is invalid' TO <LV_MSG>.

     *       get message manager
      DATA lo_api_controller     TYPE REF TO if_wd_controller.
      DATA lo_message_manager    TYPE REF TO if_wd_message_manager.

      lo_api_controller ?= wd_this->wd_get_api( ).

      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager.


      CALL METHOD lo_message_manager->report_attribute_error_message
        EXPORTING
          message_text   = <LV_MSG>
          element        = LO_EL_<ELEMENT> --> THIS IS YOUR CONTEXT ELEMENT.
          attribute_name = 'DATE'.

Regards,

-Syed.

Edited by: wahid hussain syed on Feb 10, 2010 9:08 AM

Answers (0)