cancel
Showing results for 
Search instead for 
Did you mean: 

About cl_wd_dynamic_tool

Former Member
0 Kudos

Hi,

I would like to use cl_wd_dynamic_tool=>check_mandatory_attr_on_view to check the mandatory fields in the view.

However, I cannot found this method and some msg is shown:

Method "CHECK_MANDATORY_ATTR_ON_VIEW" is unknown or PROTECTED or PRIVATE.	

Anybody know why?

Regards,

Edmond

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Edmood,

If you want to work with UI elements at runtime you have to write code in wddomodify.

Regards,

Nikita

IanStubbings
Active Participant
0 Kudos

And CL_WD_DYNAMIC_TOOL is a public active class in se24?

IanStubbings
Active Participant
0 Kudos

Hi Edmond

You will need something like this:

data: lt_messages TYPE cl_wd_dynamic_tool=>t_check_result_message_tab.

cl_wd_dynamic_tool=>check_mandatory_attr_on_view(

EXPORTING

view_controller = iv_view_controller

display_messages = abap_false

IMPORTING

messages = lt_messages ).

In this instance, iv_view_controller is an import parameter as the code resides in the component controller and the view I wish to check is passed in to the method.

Hope that helps

Ian

Former Member
0 Kudos

Some msg like :

The type "T_CHECK_RESULT_MESSAGE_TAB" is unknown.

when I use

data: lt_messages TYPE cl_wd_dynamic_tool=>t_check_result_message_tab.

cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
EXPORTING
view_controller = iv_view_controller
display_messages = abap_false
IMPORTING
messages = lt_messages ).

Former Member
0 Kudos

Hi,

Try this.

data: lt_messages TYPE cl_wd_dynamic_tool=>t_check_result_message_tab.

data : io_view_controller type ref to IF_WD_VIEW_CONTROLLER.
 
cl_wd_dynamic_tool=>check_mandatory_attr_on_view(
EXPORTING
view_controller = io_view_controller
display_messages = abap_false
IMPORTING
messages = lt_messages ).

Thanks.

Former Member
0 Kudos

hi edmond.....

mention the coding you have used....

---regards,

alex b justin

Former Member
0 Kudos

I just normally call the method like this:

CALL METHOD CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW
EXPORTING
VIEW_CONTROLLER = lo_api_controller
DISPLAY_MESSAGES = ABAP_TRUE
IMPORTING
MESSAGES = lt_messages
.

Former Member
0 Kudos

hi ed mond....

use it in the wddomodify method.


types:
    begin of t_check_result_message,
      t100_message      type symsg,
      context_element   type ref to if_wd_context_element,
      attribute_name    type string,
    end of t_check_result_message .

data:
     message type standard table of t_check_result_message.

CALL METHOD CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW
  EXPORTING
    VIEW_CONTROLLER  = view
    DISPLAY_MESSAGES = ABAP_TRUE
  IMPORTING
    MESSAGES         = message.
    .

---regards,

alex b justin