cancel
Showing results for 
Search instead for 
Did you mean: 

Reduce error list of required fields

Former Member
0 Kudos

Hi,

I'm using CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW( ) for validating my mandatory fields on the view. The problem is that I get the message "Fill all required entry fields" for each mandatory field. Is it possible to reduce this list to just one message but keep the red color and border on each field?

Accepted Solutions (0)

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

HI Christian,

The method CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW( ) has parameter "display_messages" that can be set to abap_false if we dont want the system to display all messages

        cl_wd_dynamic_tool=>check_mandatory_attr_on_view(

          EXPORTING

            view_controller  =     lo_api_controller

            display_messages = abap_false

          IMPORTING

            messages         = lt_messages

        ).

You can use the lt messages to display 1 message at a time and we can controll the subsequent messages display through program.

clear ls_messages-attribute_name


*     report message

    CALL METHOD lo_message_manager->report_attribute_t100_message

      EXPORTING

        msg                       = ls_messages-t100_message

        element                   = ls_messages-context_element

        attribute_name            = ls_messages-attribute_name


Yes.we can display just one message and keep red color of each field in context_element  by clearing attribute name.

If we dont pass attribute name in message display it highlights all the fields in context_element instance.

Note: it highlights & mark red for all fields including non-mandatory fields

Hence, highlighting only mandatory fields with one message is not possible.

Regards,

Rama