cancel
Showing results for 
Search instead for 
Did you mean: 

Check mandatory field

Former Member
0 Kudos

Hello!

We use ABAP Web Dynpro (AGS_WORK_INCIDENT_CREATE) for the creation of messages in our Solution Manager (CRM).

In order to categorize the messages we would like to use 4 level category.

Question:

How can we make the fields of categorization mandatory and implement a simple error in case the the fields are empty?

(see the picture below)

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Dear Alex,

You can refer to the following link,.hope it will be useful.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/207e4467-227e-2e10-6fbb-e3a562038...

Cheers

Katrice

hendrik_brandes
Contributor
0 Kudos

Hello Alex,

I would suggest, to make an Enhancement for this WD-Component.

Search for the view ( sorry, just I have no CRM System at the moment), which holds the category items and set the attribute for every field to "required = true".

Kind regards,

Hendrik

Former Member
0 Kudos

Hello Alex,

First you set the state property of the drop down ui element as required

then on action method where you want to check the empty field or not write following code before processing your  other logic.

data:lref_view_controller type ref to    if_wd_view_controller,

        lt_msg                  type           cl_wd_dynamic_tool=>t_check_result_message_tab,

lref_view_controller ?= wd_this->wd_get_api( ).

cl_wd_dynamic_tool=>check_mandatory_attr_on_view(

   exporting
   view_controller = lref_view_controller
   display_messages = abap_true
   importing
   messages = lt_msg ). "end of code to check mandatory fields

Former Member
0 Kudos

Hello!

Many thanks!

I found the view and set the field required true.

No I need the check logic.

I found a method CHECK_CUST_REQUIRED and there some checks regarding to the CATEGORY.

if ls_cc_req_context-REQ_CATEGORY = 'X' and ls_nd_add_context-CATEGORY is INITIAL.
       lv_msg = WD_ASSIST->IF_WD_COMPONENT_ASSISTANCE~GET_TEXT( 'E15' ).

       CALL METHOD lo_message_manager->REPORT_ATTRIBUTE_ERROR_MESSAGE
         EXPORTING
           MESSAGE_TEXT              = lv_msg
           ELEMENT                   = lo_el_nd_add_context
           ATTRIBUTE_NAME            = 'CATEGORY'

endif.

How can I adapt the check logic for the fields?


Former Member
0 Kudos

Hello Alex,

You just need to make the field as required and put the logic which i have given in the previous post

"How can I adapt the check logic for the fields?"


i am not getting what you are looking for from above line