cancel
Showing results for 
Search instead for 
Did you mean: 

Webdypro Select Options

Former Member
0 Kudos

Hi team,

I have an issue in webdynpro select-options. I set the field obligatory in

Method          WDDOINIT.

* add a new field to the selection

   WD_THIS->M_HANDLER->ADD_SELECTION_FIELD( I_ID = 'ZCOUNTRY'

   IT_RESULT = LT_RANGE_TABLE I_READ_ONLY = READ_ONLY

     i_value_help_type        IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_SEARCHHELP

      i_value_help_id         = 'H_T005_LAND'

     i_obligatory            = 'X'

       ).



But when I am executing on action for search button ( Event Handler   ONACTIONSEARCH).Then it checking the field as mandatory. But after checking I have some code and it also executing that means if the Zcountry displaying error message and also procedding further.If any error message it should stop How to achecive this.Please any one can help.


Event Handler   ONACTIONSEARCH


  rt_count = wd_this->m_handler->get_range_table_of_sel_field( i_id = 'ZCOUNTRY').

   ASSIGN rt_count->* TO <fs_count>.



Thanks and regards,

Umakanth

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Uma,

Please use the bellow code to stop further processing and display the error message. RETURN is the key word to stop processing.

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.

If lv_abc is initial.

* report message

       CALL METHOD lo_message_manager->report_message

         EXPORTING

           message_text = 'Abc Error'

           message_type = '2'.  "Error message type

       RETURN.

endif.

Let me know if it works.

Former Member
0 Kudos

Hi Amar,

Thanks for your reply .But even if I didnot kept any validation it is throwing error message.I need to capture if any errors are avaiable for validations.How to capture that error.

Thanks and Regards,

Uma

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Uma,

WD ABAP works on phase model. If you throw a error message it won't stop at that method call itself. It executes the remaining code in the method on which you have raised the error message. So have a flag and control the remaining code which is after the call of the error message using the flag.

BR,

Arun.

Former Member
0 Kudos

Hi Team,

Could any one please suggest solution for the above issue?

Thanks and Regards,

Uma